[Trigger] dungeon entry

Status
Not open for further replies.
Level 2
Joined
Feb 13, 2011
Messages
10
Events
Unit-A unit enters Region 000<gen>
Conditions
Actions
Unit - Move(Triggering unit) instantly to (Center of Region 001 <gen>)


i need help when i type -enter the unit move to other region but i tryed many ways and cant find how to made it. im making a rpg map but thats my main problem. +rep to those guy who help me and tnx anyway
 
You will have to store the unit for the said player, so that the engine recognizes which unit it is supposed to move with the command.
Let's say that you train your heroes:
  • Tr
  • Events
    • Unit - A unit finishes training a unit
  • Conditions
    • ((Trained unit) is a Hero) Equal to True
  • Actions
    • Set WhichHero[(Player number of (Triggering player))] = (Trained unit)
The trigger above allows multi player storage of the character in possession of the player.

Then,
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Trigger - Add to Trigger2 <gen> the event (Player - Player(IntegerA) types a message containing -enter as an Exact match
  • Trigger2
  • Events
  • Conditions
  • Actions
    • Set Id = (Player number of (Triggering player)) //Id is an Integer variable
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Region 000 <gen> contains WhichHero[Id]) Equal to True //Boolean comparison
      • Then - Actions
        • Set Point1 = (Center of Region 001 <gen>)
        • Unit - Move WhichHero[Id] instantly at Point1
        • Custom script: call RemoveLocation (udg_Point1)
      • Else - Actions
        • If (All conditions are true) then do (Actions) else do (Actions)
          • If - Conditions
            • (Region 001 <gen> contains WhichHero[Id]) Equal to True
          • Then - Actions
            • Set Point1 = (Center of Region 000 <gen>)
            • Unit - Move WhichHero[Id] instantly to Point1
            • Custom script: call RemoveLocation (udg_Point1)
          • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Trigger - Add to Untitled Trigger 002 <gen> the event (Player - Player 1 (Red) types a chat message containing 1 as An exact match)
  • Untitled Trigger 002
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Custom script: if GetTrainedUnit() == null then
      • Game - Display to Player Group - Player 1 (Red) the text: Do actions 1
      • Custom script: else
      • Game - Display to Player Group - Player 1 (Red) the text: Do actions 2
      • Custom script: endif
One could also use GetTriggerEventId() to recognize the event.
 
Level 2
Joined
Feb 13, 2011
Messages
10
can you give you variables to see what type of variables are WhichHero and Id.
and about Point1 tell me what is it too tnx so much for help. +rep
 
Level 2
Joined
Feb 13, 2011
Messages
10
about this
Set WhichHero[(Player number of (Triggering player))] = (Trained unit), im getting only this
Set WhichHero = (Trained unit)
and this too Unit - Move WhichHero[Id] instantly at Point1
Unit - Move WhichHero instantly at Point1 without the [id] can you help me how to resolve that problem. tnx anyway

Edit here is image Uploaded with ImageShack.us[/IMG]
 
No, Tavern sells heroes, which means that the event should be changed to sells a unit and the WhichUnit[] to (Sold unit).
An Altar trains a hero for exaple; basically, if you go to a building in the Object Editor and scroll to Techtree - Units trained, that field will fire the Unit finishes training a unit event.
How is your hero/-es going to be created in your map? Manually, by "Unit - Create Unit" action?
 
Level 2
Joined
Feb 13, 2011
Messages
10
im creating my heroes by using hero selection trigger
when whisp enter in circle the hero is selected. and i was going to ask can i make the 2 of the triggers to work together.
 
Status
Not open for further replies.
Top