• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

How can I go about doing this?

Status
Not open for further replies.
Level 6
Joined
Mar 17, 2012
Messages
105
When a structure (RandomBuilding) is built, it is supposed to be replaced immediately in the same position with a new random structure (structures A, B, C, D, or E). The probability for each structure being picked is equal.

How can I go about making a trigger that allows for this? I feel like this requires variables, but I have no skill with that. So. If anyone could help me, it'd be greatly appreciated.
 
Level 2
Joined
Mar 30, 2012
Messages
28
[TRIGGER="RANDOM BUILD'z"]
Events
A unit build blah blah
Conditions
Actions
Set B = Last build'z
Set BP = Build'z Point'z (UNIT POINT'z)
Unit - Replace B with Blah blah..[/TRIGGER]
 
Level 6
Joined
Mar 17, 2012
Messages
105
When a structure - lets called it StructureA - is built, it is supposed to be immediately replaced by one of three structures. The choice of which structure is random. These are the structures:

StructureX
StructureY
StructureZ

How can I make a trigger that does this?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Create a unit type variable, set them at map initialization.

set variable[0] = unit type A
set variable[1] = unit type B
set variable[2] = unit type C

Unit finishes construction
Unit type of constructed structure == your unit type
Replace constructed structure with variable[randim integer between 0 and 2]
 
Status
Not open for further replies.
Top