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.
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
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?)
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.
_________________
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?
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
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.
_________________
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?
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)
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.
_________________
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?
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.
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