Jump to content
Sign in to follow this  
Myruni

Custom map development - SetChaSideID question

Recommended Posts

Hi everyone,

 

I have been trying to create some new maps while studying CTF map available publicly that revolves around team etc and have the following issue/question:

 

I set the mob's chasideid to 2 in the map

piradef1 = CreateCha(1380, 35600, 46900, 310, 20000)
SetChaSideID(piradef1, 2)

I set the player chasideid to 2 when enter map

function after_enter_customgw(role, map_copy)

    local cha = TurnToCha(role)

        SetChaSideID(cha, 2)

    
end

I included within function isfriend the following to identify chaside and determine friendly or not.

    local map_name_cha1 = GetChaMapName(cha1)
    local map_name_cha2 = GetChaMapName(cha2)
    if (map_name_cha1 == map_name_cha2 and map_name_cha1 == "customgw") then
        if (GetChaSideID(cha1) == GetChaSideID(cha2)) then
            return 1
        else
            return 0
        end
    end 

However, when enter map, when I point my mouse to the mob, it still shows the sword mouse icon. However, I am unable to deal damage to it as I suppose the function identifies the mob as friendly. Not sure why it is still showing the sword mouse icon. If any one has any leads to rectify this will be very helpful.

 

Thanks

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...