- Joined
- Feb 11, 2011
- Messages
- 1,860
Hi guys,
I have this issue which is quite silly. I have a region and when a player-owned hero enters it, the player receives 200 gold and the trigger is the deactivated. The problem is that it doesn't register when the hero enters the region. Here is my trigger and script:
Notes:
- My map is an arena where you choose a hero and kill creeps.
- I move the region to a random point for each new level.
- I reactivate the trigger for each new level (you can only find the hidden gold once per level).
Can someone please show me the error? I know that I should do everything in JASS, but I am still learning it and I would prefer to do it with both triggers and JASS.
Thanks for reading!
I have this issue which is quite silly. I have a region and when a player-owned hero enters it, the player receives 200 gold and the trigger is the deactivated. The problem is that it doesn't register when the hero enters the region. Here is my trigger and script:
-
Hidden Gold
-
Events
- Unit - A unit enters HiddenGold <gen>
-
Conditions
- ((Triggering unit) is A Hero) Equal to True
- (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
-
Actions
- Custom script: call Hidden_Gold(GetTriggerUnit())
-
Events
JASS:
function Hidden_Gold takes unit u returns nothing
call DisplayTextToForce(GetPlayersAll(), GetPlayerName(GetOwningPlayer(u)) + "has found the hidden gold!")
call SetPlayerState(GetOwningPlayer(u), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(GetOwningPlayer(u), PLAYER_STATE_RESOURCE_GOLD) + 200)
call DisableTrigger(gg_trg_Hidden_Gold)
set u = null
endfunction
- My map is an arena where you choose a hero and kill creeps.
- I move the region to a random point for each new level.
- I reactivate the trigger for each new level (you can only find the hidden gold once per level).
Can someone please show me the error? I know that I should do everything in JASS, but I am still learning it and I would prefer to do it with both triggers and JASS.
Thanks for reading!