• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

[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: 168
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