wc3edit.net

United Warcraft 3 map hacking!
It is currently April 23rd, 2024, 11:41 am

All times are UTC




Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: November 27th, 2011, 7:26 pm 
Offline
Old Wrinkly Member
User avatar

Joined: April 19th, 2009, 12:46 pm
Posts: 234
Hey guys, I recently started trying to add a small repick system into the Twilight's eve map for me and my friends, but I've come across some problems, when I run the syntax check in JASS everything is fine, but it says the game isn't found when I try to play it.

Here is where I placed stuff and what I used.

Globals
Spoiler:
trigger gg_trg_Repick_Red=CreateTrigger()
trigger gg_trg_Repick_Blue=CreateTrigger()
trigger gg_trg_Repick_Teal=CreateTrigger()
trigger gg_trg_Repick_Purple=CreateTrigger()
trigger gg_trg_Repick_Yellow=CreateTrigger()
trigger gg_trg_Repick_Orange=CreateTrigger()
trigger gg_trg_Repick_Green=CreateTrigger()
trigger gg_trg_Repick_Pink=CreateTrigger()
trigger gg_trg_Repick_Gray=CreateTrigger()
trigger gg_trg_Repick_LightBlue=CreateTrigger()
trigger gg_trg_Repick_Red_Female=CreateTrigger()
trigger gg_trg_Repick_Blue_Female=CreateTrigger()
trigger gg_trg_Repick_Teal_Female=CreateTrigger()
trigger gg_trg_Repick_Purple_Female=CreateTrigger()
trigger gg_trg_Repick_Yellow_Female=CreateTrigger()
trigger gg_trg_Repick_Orange_Female=CreateTrigger()
trigger gg_trg_Repick_Green_Female=CreateTrigger()
trigger gg_trg_Repick_Pink_Female=CreateTrigger()
trigger gg_trg_Repick_Gray_Female=CreateTrigger()
trigger gg_trg_Repick_LightBlue_Female=CreateTrigger()


Endglobals
Spoiler:
function Trig_Repick_Red_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Blue_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Teal_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Purple_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Yellow_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Green_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Pink_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Gray_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_LightBlue_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Red_Female_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Blue_Female_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Teal_Female_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Purple_Female_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Yellow_Female_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Green_Female_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Pink_Female_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Gray_Female_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_LightBlue_Female_Actions takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction


Function Main
Spoiler:
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Red,Player(0),"-repick male",true)
call TriggerAddAction(gg_trg_Repick_Red,function Trig_Repick_Red_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Blue,Player(1),"-repick male",true)
call TriggerAddAction(gg_trg_Repick_Blue,function Trig_Repick_Blue_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Teal,Player(2),"-repick male",true)
call TriggerAddAction(gg_trg_Repick_Teal,function Trig_Repick_Teal_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Purple,Player(3),"-repick male",true)
call TriggerAddAction(gg_trg_Repick_Purple,function Trig_Repick_Purple_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Yellow,Player(4),"-repick male",true)
call TriggerAddAction(gg_trg_Repick_Yellow,function Trig_Repick_Yellow_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Orange,Player(5),"-repick male",true)
call TriggerAddAction(gg_trg_Repick_Orange,function Trig_Repick_Orange_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Green,Player(6),"-repick male",true)
call TriggerAddAction(gg_trg_Repick_Green,function Trig_Repick_Green_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Pink,Player(7),"-repick male",true)
call TriggerAddAction(gg_trg_Repick_Pink,function Trig_Repick_Pink_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Gray,Player(8),"-repick male",true)
call TriggerAddAction(gg_trg_Repick_Gray,function Trig_Repick_Gray_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_LightBlue,Player(9),"-repick male",true)
call TriggerAddAction(gg_trg_Repick_LightBlue,function Trig_Repick_LightBlue_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Red_Female,Player(0),"-repick female",true)
call TriggerAddAction(gg_trg_Repick_Red_Female,function Trig_Repick_Red_Female_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Blue_Female,Player(1),"-repick female",true)
call TriggerAddAction(gg_trg_Repick_Blue_Female,function Trig_Repick_Blue_Female_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Teal_Female,Player(2),"-repick female",true)
call TriggerAddAction(gg_trg_Repick_Teal_Female,function Trig_Repick_Teal_Female_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Purple_Female,Player(3),"-repick female",true)
call TriggerAddAction(gg_trg_Repick_Purple_Female,function Trig_Repick_Purple_Female_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Yellow_Female,Player(4),"-repick female",true)
call TriggerAddAction(gg_trg_Repick_Yellow_Female,function Trig_Repick_Yellow_Female_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Orange_Female,Player(5),"-repick female",true)
call TriggerAddAction(gg_trg_Repick_Orange_Female,function Trig_Repick_Orange_Female_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Green_Female,Player(6),"-repick female",true)
call TriggerAddAction(gg_trg_Repick_Green_Female,function Trig_Repick_Green_Female_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Pink_Female,Player(7),"-repick female",true)
call TriggerAddAction(gg_trg_Repick_Pink_Female,function Trig_Repick_Pink_Female_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_Gray_Female,Player(8),"-repick female",true)
call TriggerAddAction(gg_trg_Repick_Gray_Female,function Trig_Repick_Gray_Female_Actions)
call TriggerRegisterPlayerChatEvent(gg_trg_Repick_LightBlue_Female,Player(9),"-repick female",true)
call TriggerAddAction(gg_trg_Repick_LightBlue_Female,function Trig_Repick_LightBlue_Female_Actions)

_________________
ImageImageImage


Top
 Profile  
 
PostPosted: November 27th, 2011, 11:21 pm 
Offline
Forum Spammer

Joined: March 30th, 2009, 9:02 pm
Posts: 682
whats enum unit o.o
theres no picked unit so enum unit doesn't exist...
try...call RemoveUnit(FirstofGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
and add a function named HERO (in this case) that checks if the unit is a hero or not


Top
 Profile  
 
PostPosted: November 28th, 2011, 1:19 am 
Offline
Old Wrinkly Member
User avatar

Joined: April 19th, 2009, 12:46 pm
Posts: 234
Ok, well did both of those, but it still doesn't work ;-/.

I assume it should look like this?
Spoiler:
function HERO takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)!=null)
endfunction
function Trig_Repick_Red_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Blue_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Teal_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Purple_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Yellow_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Green_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Pink_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Gray_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_LightBlue_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Red_Female_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Blue_Female_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Teal_Female_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Purple_Female_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Yellow_Female_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Green_Female_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Pink_Female_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_Gray_Female_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction
function Trig_Repick_LightBlue_Female_Actions takes nothing returns nothing
call RemoveUnit(FirstOfGroup(GetUnitsOfPlayerMatching(GetTriggerPlayer(),Condition(function HERO))))
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction


Or should I make a function of HERO (different names) for every color.

_________________
ImageImageImage


Top
 Profile  
 
PostPosted: November 28th, 2011, 11:03 am 
Offline
Forum Spammer

Joined: March 30th, 2009, 9:02 pm
Posts: 682
ok first, this has kinda been bothering me....but why did you make a separate trigger for each player =/
just make one (two, one for male and one for female) action function and register the chat event all to one trigger?
you have the same stuff in each function anyway...

two, not rly sure about condition functions o.o
i heard it was buggy at times (from a raging mapmaker but still....maybe it was true?)

three, what doesn't work o.o


Top
 Profile  
 
PostPosted: November 28th, 2011, 2:21 pm 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
Just to get things orginized. I took your code and changed it, into jass, I just can't stand that GUI>JASS shit as its making things way more complicated than it should be. So here is what you are doing... (first post) orginized.

Code:
globals
trigger trgRepick=CreateTrigger()
endglobals
function Repick takes nothing returns nothing
local string str=StringCase(GetEventPlayerChatString(),false)
if SubString(str,8,12)=="male"then
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H002',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
elseif SubString(str,8,14)=="female"then
call RemoveUnit(GetEnumUnit())
call CreateUnit(GetTriggerPlayer(),'H001',1088.,-11584.,270.)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
else
call DisplayTextToPlayer(GetTriggerPlayer(),0,0,"use -repick male/female")
endif
set str=""
endfunction
function main takes nothing returns nothing
local integer looper=0
loop
exitwhen looper>=11
call TriggerRegisterPlayerChatEvent(trgRepick,Player(looper),"-repick",false)
call TriggerAddAction(trgRepick,function Repick)
set looper=looper+1
endloop
endfunction


So here is what happens.
A player is writing -repick (not case sensitive).
if he didnt specify male or female it shows him the error message.
if he did specify, lets take for example male.
It will remove the picked unit, which makes no sense as there doesn't have to be a picked unit, what if he picked a neutral unit? or a unit that doesn't belong to him?
Then it creates the unit H002 (I didn't take the time to see what that unit is) at some place for the triggering player.
and then it sets its lumber and gold to 0.

Now, I didnt check the code if it works, but you can already see that the logic has holes in it as mentioned above. I dont play the map, so I dont know the best way way to code the repick system.
But the sure thing is, you need a different method.

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
PostPosted: November 28th, 2011, 7:58 pm 
Offline
Forum Spammer

Joined: March 30th, 2009, 9:02 pm
Posts: 682
lol...that and the fact that he said it didn't work o.o
he just didn't specify how it didn't work

and...pretty sure H001 and H002 are the basic characters
but now that I think of it....this is TEVE...so go to the save system, take the variable for the hero, remove that, and spawn a new one (make sure to set the new hero to the var)
if theres no variable for hero, take the method it gets the hero


Top
 Profile  
 
PostPosted: November 28th, 2011, 11:36 pm 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
naturesfury wrote:
lol...that and the fact that he said it didn't work o.o
he just didn't specify how it didn't work

and...pretty sure H001 and H002 are the basic characters
but now that I think of it....this is TEVE...so go to the save system, take the variable for the hero, remove that, and spawn a new one (make sure to set the new hero to the var)
if theres no variable for hero, take the method it gets the hero

That is the strange thing. This code is bad, right. But it is not a reason to make the map NOT work. That is the odd thing I see.

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
PostPosted: November 28th, 2011, 11:39 pm 
Offline
Old Wrinkly Member
User avatar

Joined: April 19th, 2009, 12:46 pm
Posts: 234
Ah, ty for all your help guys, please excuse my stupidity, still a newbie here and trying to learn, just a quick question, could you explain what this line does?

local string str=StringCase(GetEventPlayerChatString(),false)

_________________
ImageImageImage


Top
 Profile  
 
PostPosted: November 28th, 2011, 11:45 pm 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3815
Location: JEW LAND
Declaring a string variable called "str" that will hold the chat string written by the triggering player, and to make things easy, it will turn that certain string into lower-case letters.
so if you write "-Repick" the variable str will be set to "-repick".
I use it to make the commands NOT case sensitive.

_________________
Image
Spoiler:
(02:24:09)
Code:
ChatBot: FatherSpace logs into the Chat.
(02:24:28) Lanaya: Gtfo ken.
(02:24:33) ChatBot: FatherSpace logs out of the Chat.
(02:24:40) Lanaya: Thought so. bitch.
(02:24:44) ChatBot: FatherSpace logs into the Chat.
(02:24:48) FatherSpace: Can I come back yet?
(02:24:51) Lanaya: What'd i say earlier.
(02:24:51) Lanaya: No.
(02:24:58) FatherSpace: Let's try this...
(02:25:01) ChatBot: Lanaya has been logged out (Kicked).
Code:

(14:33:51) 2Pac: Do you know what'S so funny?
(14:34:01) Lanaya: No, please show me.
(14:34:07) 2Pac: This.
(14:34:09) ChatBot: Lanaya has been logged out (Kicked).
(14:34:10) 2Pac:


Code:
(14:35:59) haxorico: No one will belive me if I say "I got this song from 2pac on MSN" lolz ^^
(14:36:02) Lanaya: lolz.
(14:36:16) 2Pac: I AIN'T DEAD FFS.
(14:36:26) 2Pac: I'm a living legend, y'now.
(14:37:17) haxorico: why is 2Pac a legend?
(14:37:28) Lanaya: He's the worse rapper evar.

Code:
(15:42:51) Lanaya: can i suck , . . .

Code:
(13:55:21) ChatBot: 2Pac rolls 1d100 and gets 1.
(13:55:21) ChatBot: haxorico rolls 1d2 and gets 2.
(13:55:27) haxorico: owned?

Code:
GeorgeMots: xplain what happens in SP. Why cant you save?
dast.-:i need play with 2 players

Code:
(21:53:08) (673237): plzplzplz, im sorry about before.
(21:53:26) FatherSpace: I'm sorry you were born.
(21:53:31) ChatBot: (673237) has been logged out (Kicked).


Code:
(10:08:02) Bartimaeus: you do know run I youtube channel for my favorite music, right?


Top
 Profile  
 
PostPosted: November 28th, 2011, 11:48 pm 
Offline
Old Wrinkly Member
User avatar

Joined: April 19th, 2009, 12:46 pm
Posts: 234
Ah ok thanks a lot, and just got an error saying that there wasn't enough memory and wc3 shut down when I ran the map, I compiled(flushed) and optimized it, or is there a different issue im over-looking? It showed a .cpp file in the error message.

_________________
ImageImageImage


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)