• 🏆 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!

Region Variable Problem

Status
Not open for further replies.
Level 2
Joined
Aug 13, 2010
Messages
8
I can't seem to select a non-constant region variable as part of the event(unit enters/exits region) for my trigger.

Upon map initialization I have regions being created by triggers, these regions are then stored in variables, but when I go to access them in the event field of another trigger they are not on the list. After fiddling around with it for awhile I tried checking the constant box on the region variables, this allowed them to be selected by the event, but of coarse then they were useless because the map init. triggers could not set the created regions to them.

I know that I can create the regions in the constant variables themselves, but that seems too restrictive, I would hope there is another way to make this work.
Any ideas?
 
Level 2
Joined
Aug 13, 2010
Messages
8
You could use custom script to register events.

In example, do this:

JASS:
    TriggerAddEventUnitRegion(gt_(Name Of your trigger without spaces), null, gv_Yourglobalvariable, true);

Custom scripting is a bit beyond my knowledge base at the moment, but I tried plugging that in and got a syntax error.

Not sure If I used it correctly, I created a new custom script in the left hand pane and put in my trigger and variable names as such:

TriggerAddEventUnitRegion(gt_(MapWrap_Northwall), null, gv_MapWrap_Northwall, true);

I took out the spaces as you said, the underscores are in the trigger and variable names.

As a side question, are there any good scripting tutorials I should check out?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Events when passed variables reference the object in the variable and not the variable thus there is no linking. Instead you will have to add the events to a trigger as part of another trigger. Try checking for such actions under the trigger cateorgry.

With script there should be no problem cause as long as the code is valid, it will axcept any objects.

The best scripting tutorials are any programming language ones. Once you have the hang of 2 programming languages learning scripting languages is easy.
 
Status
Not open for further replies.
Top