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

[Trigger] Terrain Change by the owner Problem

Status
Not open for further replies.
Level 2
Joined
Nov 1, 2008
Messages
15
this is really hard trigger

I got my map got square / inside the square i made Region

I want make change terrain to Grass trim if someone build there
and if the owner die of the first building the terrain change to Dirt

i made simple trigger working . but i got 1 problem if blue or anyone else die all region turn to dirt can i set if you are the first to build you are the owner and only your terrain change to dirt if you die

can we assign to player those trigger

Here what i got
attachment.php
 

Attachments

  • trigger terrain problem.jpg
    trigger terrain problem.jpg
    284.9 KB · Views: 149
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
Just use a player variable for it...
Set the player variable to the owner of the builder and then create an if/then/else:
If Player_Variable = owner of entering unit
Then [all your actions]
Else you can create a game message, or just don't do anything... your choice :/

Ohh, the triggers leak... fix the leaks immeadiately.
 
Level 2
Joined
Nov 1, 2008
Messages
15
Just use a player variable for it...
Set the player variable to the owner of the builder and then create an if/then/else:
If Player_Variable = owner of entering unit
Then [all your actions]
Else you can create a game message, or just don't do anything... your choice :/

Ohh, the triggers leak... fix the leaks immeadiately.

not working
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Hm, I think I know what I've said wrong ^^
All right, set the Initial Value of the "Player" variable to "Neutral Hostile", or any unused player and do something like this: (Note: WE isn't open)
  • First Trigger
  • Events
    • Unit - a unit enters [region]
  • Conditions
    • ((Triggering unit) is a structure) = true
  • Actions
    • set Loc = Center of [region]
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Player[1] Equal to Neutral Hostile
      • Then - Actions
        • Set Player[1] = (Owner of (Entering unit))
        • Environment - Create your deformation-thing at Loc
        • Wait 0.30 seconds
        • Environment - Terrain-change at Loc
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Player[1] Equal to (Owner of (Entering Unit))
          • Then - Actions
            • Environment - Create your deformation-thing at Loc
            • Wait 0.30 seconds
            • Environment - Terrain-change at Loc
          • Else - Actions
    • Custom script: call RemoveLocation(udg_Loc)
This assigns a player to the region, the terrain deformation/change only applies for that player.
If another player builds in that area, the terrain will not change.

Do the same for the second trigger, but use "Player[2]" or something...
 
Level 2
Joined
Nov 1, 2008
Messages
15
... im to noob to make it ( how make Region to variable want to mean all region want someone build inside do something
 
Last edited:
Level 2
Joined
Nov 1, 2008
Messages
15
Hm, I think I know what I've said wrong ^^
All right, set the Initial Value of the "Player" variable to "Neutral Hostile", or any unused player and do something like this: (Note: WE isn't open)
  • First Trigger
  • Events
    • Unit - a unit enters [region]
  • Conditions
    • ((Triggering unit) is a structure) = true
  • Actions
    • set Loc = Center of [region]
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Player[1] Equal to Neutral Hostile
      • Then - Actions
        • Set Player[1] = (Owner of (Entering unit))
        • Environment - Create your deformation-thing at Loc
        • Wait 0.30 seconds
        • Environment - Terrain-change at Loc
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Player[1] Equal to (Owner of (Entering Unit))
          • Then - Actions
            • Environment - Create your deformation-thing at Loc
            • Wait 0.30 seconds
            • Environment - Terrain-change at Loc
          • Else - Actions
    • Custom script: call RemoveLocation(udg_Loc)
This assigns a player to the region, the terrain deformation/change only applies for that player.
If another player builds in that area, the terrain will not change.

Do the same for the second trigger, but use "Player[2]" or something...



Question : "Unit - a unit enters [region]" How to you make Variable Region mean every region ?

because i got over 150 region i cant do all this for each player
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Ohh, like that.... yeah.

Create a region variable with an array and in the init-trigger, set them all to the correct regions
(e.g.: "Set Region[1] = Region 001 <gen>").

Then just loop the trigger...

  • Example
  • Events
    • Unit - a unit enters Region 001
    • Unit - a unit enters Region 002
    • Unit - a unit enters Region 003
    • ... (all of them)
  • Conditions
  • Actions
    • For each integer A from 1 to 100 do
      • Loop - actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Region[Integer A] contains (Entering Unit) equal to true
          • Then - Actions
            • [MY PREVIOUS TRIGGER]
          • Else - Actions
 
Level 2
Joined
Nov 1, 2008
Messages
15
Ohh, like that.... yeah.

Create a region variable with an array and in the init-trigger, set them all to the correct regions
(e.g.: "Set Region[1] = Region 001 <gen>").

Then just loop the trigger...

  • Example
  • Events
    • Unit - a unit enters Region 001
    • Unit - a unit enters Region 002
    • Unit - a unit enters Region 003
    • ... (all of them)
  • Conditions
  • Actions
    • For each integer A from 1 to 100 do
      • Loop - actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Region[Integer A] contains (Entering Unit) equal to true
          • Then - Actions
            • [MY PREVIOUS TRIGGER]
          • Else - Actions


God you are intelligent ! XD // i will try when i will be more wake up thanks man
 
Status
Not open for further replies.
Top