• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Variable region in "Unit enters region"

Status
Not open for further replies.
Level 9
Joined
Jun 22, 2012
Messages
472
Hi!

My problem looks fucking stupid, but it makes me really crazy :

I boot some variables like that :
  • Initialisation
    • Events
      • Units - A unit Ends construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Market
    • Actions
      • Set Market = (Constructed structure)
      • Set Point_market = (Position of Market)
      • Set Region_market = (Region centered at Point_market with size (800.00, 800.00))
And it's impossible to use the variable "Region_market" in an event "Unit enters region" in another trigger!

Is anyone could explain me what's wrong?

Thanks in advance.
 
Level 9
Joined
Jun 22, 2012
Messages
472
Thanks for the quick answer!

but the event won't change if the variable changes.

But just a question : that means that if my Market is destroyed and that I build another one on another place, the event will stay on the previous region?

Edit : I can't choose in the event "A unit enter..." the region "rect"...
Here is the complete trigger :
  • Initialization
    • Events
      • Unit - A unit Ends the construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Market
    • Actions
      • Set Unit_market = (Constructed structure)
      • Set Point_market = (Position of Unit_market)
      • Set Region_market = Temp region <gen>
      • Region - Center Region_market on Point_market
  • Patrol
    • Events
      • Unit - A unit Begins to cast an ability
    • Conditions
      • (Ability being cast) Equal to Trade with King's Landing
    • Actions
      • Set Unit_wagon = (Casting unit)
      • Set Player_wagon = (Owner of Unit_wagon)
      • Player group - Add Player_wagon to Group_wagon
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit_market is alive) Equal to FALSE
        • Then - Actions
          • Game - Display to Group_wagon the text: No market
        • Else - Actions
          • Unit - Order Unit_wagon to Go to (Target point of ability being cast)
          • Wait until ((Market Kings Landing <gen> contains Unit_wagon) Equal to TRUE), checking every 1.00 seconds
          • Unit - Order Unit_wagon to Patrol to Point_market
          • Set Integer_test = 1
  • Merchandises
    • Events
      • Unit - A unit enters (here is the problem)
    • Conditions
      • Integer_test Equal to 1
      • (Unit-type of Unit_wagon) Equal to (Unit-type of (Entering unit))
    • Actions
      • Player - Add 400 to Player_wagon Current gold
      • Player - Add 200 to Player_wagon Current lumber
 
Last edited:
Level 9
Joined
Jun 22, 2012
Messages
472
This is another mean of gathering gold and lumber by trading with your allies. Concretely, a wagon patrols between the Market of the player and the Market of his ally and when the wagon enters the region of the Market of the player he earns gold and lumber. The problem is that I have to define the place of this region in function of the place of the constructed Market (Markets of allies are already built at the beginning of the game, so that simplifies the problem).

Am I enough clear or do you need extra information?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
That's pretty clear to me, thank you :).
I do have some questions left though: each player can have only 1 market at any given time, correct?
And how many allies can a player have? Are they pre-set, or can they change in-game?

I'm either over-thinking it, or it's actually not that easy to do in GUI.
In JASS, you could create a trigger for every market there is (create trigger and event) and destroy that trigger if the market gets destroyed.
In GUI, you could potentially save the ally's market(s) and periodically check whether a wagon is near that market or not (no regions required for that).
 
Level 9
Joined
Jun 22, 2012
Messages
472
Yes only one market per player, and two preseted allies per player (without taking into account human allies).

JASS and GUI are two logical languages, right? If that is that, I have non-existent knowledges about it... (C language is enough for my engineering studies ^^)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
GUI isn't actually a language, it's (as the name already implies) a graphical user interface for JASS. JASS is the language that runs all the wc3-maps.
The thing is that Blizzard didn't convert all JASS-natives to support GUI, that's why it's easier to work with JASS (though it's easier to learn GUI, because you basically just push some buttons :p).

I'll see what I can do about your problem, though I can't do it now (got my mind on other things).
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
You know, I've been playing with this for a while now, but it just seems too complicated for what it does D:.
It works and haven't found any bugs so far, but it's still complicated.

Also: I didn't add any settings to easily change the system yet, this is just the raw version to see if this is what you actually wanted :p.
 

Attachments

  • MarketSystem.w3x
    29.4 KB · Views: 70
Level 9
Joined
Jun 22, 2012
Messages
472
It seems to fit with what I expected!

However there is some details that do not correspond :
- the wagon should be selectable (and so killable, etc...), and trade orders should be given from the wagon (with a dummy ability for instance)
- it should be one wagon (or more) per allied market. The wagon has not to visit all allied markets before to "come home" ^^

But for a first draft it is the good system, thanks!

There is also another point (but I think I could fix it alone), it should be two kinds of wagon : the proper wagon and a horse with wallets that provides less resources.

One more time, thank you for your help!
 
Last edited:
Status
Not open for further replies.
Top