• 🏆 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 - Entering Region > Create units

Status
Not open for further replies.
Have been on this case for a while now, but just cant make it to work

In my game after you have killed x amount of enemy units you get civilians
Civilians will work like money, if you have enough you can walk with them to certain regions and exchange them for units or other stuff like money.

I want:
When a civilian enters "Entering region" > Check for more civilians owned by owner of entering unit; If amount is 4 including entering unit > Remove civilians in "Entering region" for owner of entering unit, and if entering unit belongs to Player 1; create 10 Ghosts for player 1 at "Creating Region" > Else do > If entering unit belongs to Player 2; create 10 Ghosts for player 2 at "Creating Region Number 2"

How can one accomplish this piece of trigger?

enteringcreating.jpg

EDIT: Been trying this whole day now, still cant do this.. Tho I can totally do this in both Sc1 & wc3 editor
 
Last edited:
Level 9
Joined
Nov 4, 2007
Messages
931
Well this worked for me on a quick map I did.
Untitled Trigger 001
Events
Unit - Any Unit Enters Region 001
Local Variables
SCV Count = 0 <Integer>
SCV Group = (Empty unit group) <Unit Group>
Fixed # = 0 <Integer>
Conditions
And
Conditions
(Unit type of (Triggering unit)) == SCV
Actions
Variable - Set SCV Group = (SCV units in Region 001 owned by player (Owner of (Triggering unit)) matching Excluded: Missile, Dead, Hidden, with at most Any Amount)
Variable - Set SCV Count = (Number of Living units in SCV Group)
Variable - Set Fixed # = SCV Count
General - If (Conditions) then do (Actions) else do (Actions)
If
SCV Count >= 4
Then
General - For each integer Fixed # from SCV Count to (SCV Count - 4) with increment -1, do (Actions)
Actions
Unit - Kill (Random Living unit from SCV Group)
Unit - Create 10 Ghost for player (Owner of (Triggering unit)) at (Center of Region[(Owner of (Triggering unit))]) facing (Position of (Triggering unit)) (No Options)
Else


Just remember to have your global Region array setup to the region you want associated with each player if you want to try and copy this, I doubt this is optimized, its just to start you off on getting the trigger done.
 
Well this worked for me on a quick map I did.
Untitled Trigger 001
Events
Unit - Any Unit Enters Region 001
Local Variables
SCV Count = 0 <Integer>
SCV Group = (Empty unit group) <Unit Group>
Fixed # = 0 <Integer>
Conditions
And
Conditions
(Unit type of (Triggering unit)) == SCV
Actions
Variable - Set SCV Group = (SCV units in Region 001 owned by player (Owner of (Triggering unit)) matching Excluded: Missile, Dead, Hidden, with at most Any Amount)
Variable - Set SCV Count = (Number of Living units in SCV Group)
Variable - Set Fixed # = SCV Count
General - If (Conditions) then do (Actions) else do (Actions)
If
SCV Count >= 4
Then
General - For each integer Fixed # from SCV Count to (SCV Count - 4) with increment -1, do (Actions)
Actions
Unit - Kill (Random Living unit from SCV Group)
Unit - Create 10 Ghost for player (Owner of (Triggering unit)) at (Center of Region[(Owner of (Triggering unit))]) facing (Position of (Triggering unit)) (No Options)
Else


Just remember to have your global Region array setup to the region you want associated with each player if you want to try and copy this, I doubt this is optimized, its just to start you off on getting the trigger done.

Jesus Christ! O__O

I dont understand the half of this.. tho I made it except:
"Then
General - For each integer Fixed # from SCV Count to (SCV Count - 4) with increment -1, do (Actions)
Actions"

I couldnt do "SCV count - 4" so I did "SCV count" wich wont help me I guess

----

But srsly, isnt there an easier trigger to do then THAT O__O
In wc3 editor and Sc1 editor I can make this happen in a trigger for 2 minutes of triggering

Its not complex, its just:
  • Events
  • Unit enter region
  • Conditions
  • Unit belongs to me
  • Actions
  • If
  • units in region equal or greater then 4; AWESOME!
  • then
  • Kill random unit owned by me in that region x4 times
  • Also create the 10 other units at the other region
  • else
Is the editor really becoming this hard and non-user friendly that we need to go deeper and deeper and become experts in map-editing?
How hard will map editing be in Warcraft 4? Or Starcraft 3? Will only NASA scientists be able to use blizzards editors? XD
 
Last edited:
Level 9
Joined
Nov 4, 2007
Messages
931
Use arithmatic (math function) to do SCV Count - 4, keep in mind I did this trigger in about 3 minutes the best form I could think of off the top of my head.
 
Use arithmatic (math function) to do SCV Count - 4, keep in mind I did this trigger in about 3 minutes the best form I could think of off the top of my head.

Alright lets see if it works well, brb

Ffs, I quit school coz I hate to study, and now with Sc2 editor here, Its all about study once again..

EDIT: Alright it works PERFECT, except one little thingy, error message on the working trigger :S
Here's a pic:
bahfailworks.jpg
Looks like its because space is full where units spawned, but I got same message when I only spawned 10 ghosts, so its not a "more space required" issue
 
Level 9
Joined
Nov 4, 2007
Messages
931
I would think the problem stems from where your start location is, and the probablity that the game probably gives an error based on the relative size of a point as compared to the center of a region, I can't say for certain but the problem lies in one or both of those areas.
 
Level 1
Joined
Aug 17, 2010
Messages
2
I made on, a bit easier to understand, for me at least. I tried it and it works.
NOTE: You must make a variable with name "Civilians1" and as a unit group. just click add global variable.

ghostek.jpg
 
Status
Not open for further replies.
Top