• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] What is wrong with the way this Trigger is set up?

Status
Not open for further replies.
Level 4
Joined
May 20, 2011
Messages
59
Hey Guys,
Having an issue with a particular event Trigger, new to using Player Groups so I'm not sure If I'm setting these functions up wrong, must be because it won't work. What could be the problem here? It won't display any text when a unit enters the region.
  • Summon Diety
    • Events
      • Unit - A unit enters Summon Diety <gen>
    • Conditions
      • ((Owner of (Triggering unit)) Not equal to Neutral Hostile) and ((Owner of (Triggering unit)) Not equal to Neutral Passive)
    • Actions
      • Game - Display to (Player group((Triggering player))) the text: testtext
      • Player Group - Add (Triggering player) to DietySummonGroup
      • //Custom script: set DietyPlayer = GetTriggerPlayer() *This is disabled in the Trigger as it caused an error disabling me from Saving the map*
      • Game - Display to DietySummonGroup the text: testtext2
Only reason I have it assigning the Player to a Group is because I need to reference the same exact player in two other Triggers.

(DietySummonGroup is a Variable of type Player Group initially with no value)
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
Try Owner of Triggering Unit instead of Triggering Player. Also make sure that a unit group object exists before trying to add players to it.

Your custom script is wrong because of a lack of udg_ prefix?

Be aware player groups (JASS force type) are like unit groups so can leak unless properly cleaned up.

Check that the trigger runs by printing out a message to all players in a way you know works.
 
Level 4
Joined
May 20, 2011
Messages
59
That fixed it instantly, thank you! Also, as a side note, I've been experiencing a problem where if I have a Trigger Function to create 1 unit in a Region, it is creating two, I'm presuming this is because a unit is blocking the spawn point or something; is that possible?
 
Level 4
Joined
May 20, 2011
Messages
59
Try Owner of Triggering Unit instead of Triggering Player. Also make sure that a unit group object exists before trying to add players to it.

Your custom script is wrong because of a lack of udg_ prefix?

Be aware player groups (JASS force type) are like unit groups so can leak unless properly cleaned up.

Check that the trigger runs by printing out a message to all players in a way you know works.
I'm very unfamiliar with using Custom Scripts, what is a udg_prefix?
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
That fixed it instantly, thank you! Also, as a side note, I've been experiencing a problem where if I have a Trigger Function to create 1 unit in a Region, it is creating two, I'm presuming this is because a unit is blocking the spawn point or something; is that possible?
It means the trigger is firing twice. Or some other trigger is creating the same unit in response to the unit being created.

I'm very unfamiliar with using Custom Scripts, what is a udg_prefix?
What GUI global variables compile into in JASS.

In GUI you have a variable called myvar, but in the resulting JASS it is udg_myvar. Use a MPQ editor to look at the map JASS script file and right at a top you will see a global variable block with all the GUI created global variables and they will be prefixed with udg_.
 
Status
Not open for further replies.
Top