• 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.

How to create caged units?

Level 3
Joined
Aug 29, 2024
Messages
23
Hello! Trying to figure out how to place a unit into a cage and making him rescued by other players. ( I have the ability for rescue and such, just need the trigger figured out for putting someone in a cage) Thanks!

(saw this from a bit ago but not sure how if this is good and to get the Set temp point, etc:)
  • Untitled Trigger 001
    • Events
      • Destructible - Cage 0000 <gen> dies
    • Conditions
    • Actions
      • Set Temp_Point = (Position of (Dying destructible))
      • Unit - Create 1 Footman for Player 1 (Red) at Temp_Point facing Default building facing degrees
      • Custom script: call RemoveLocation( udg_Temp_Point )
Here's the map just in case.
 

Attachments

  • Nick and Aiden's Map.w3m
    171.7 KB · Views: 3

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
That's basically how you would do it.
  • A Cage Dies
    • Events
      • Destructible - Cage 0000 <gen> dies
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Position of (Dying destructible))
The variable/custom script is optional and is used to address memory leaks. I wouldn't concern yourself with those until you're far more familiar with triggering.

Edit:
The only issue here is that you cannot get the Player that killed the destructible, preventing you from creating the "rescued unit" for the "rescuing player".
However, I've created a little system to help fix this issue (see attached map). It's pretty straightforward and shouldn't cause any problems.

Note that my solution isn't perfect, it's more like a 99% chance to work and in those rare cases that it fails the system will default to Player 1.

So the above trigger would need to look like this if you wanted to use the system:
  • A Cage Dies
    • Events
      • Destructible - Cage 0000 <gen> dies
    • Conditions
    • Actions
      • Set VariableSet Cage_Rescued_Amount = 1
      • Set VariableSet Cage_Rescued_Unit_Type = Footman
      • Trigger - Run Cage Rescue Units <gen> (ignoring conditions)
First you define the amount of units that will be created and the type of unit that will be created. Then you run the Cage Rescue Units trigger which automatically handles the creation of the units and figures out who killed the cage using some basic logic.

So in this case when Cage 0000 dies it will create 1 Footman for the killing player.
 

Attachments

  • Cage Rescue System.w3m
    21 KB · Views: 1
Last edited:
Level 3
Joined
Aug 29, 2024
Messages
23
That's basically how you would do it.
  • A Cage Dies
    • Events
      • Destructible - Cage 0000 <gen> dies
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Position of (Dying destructible))
The variable/custom script is optional and is used to address memory leaks. I wouldn't concern yourself with those until you're far more familiar with triggering.

Edit:
The only issue here is that you cannot get the Player that killed the destructible, preventing you from creating the "rescued unit" for the "rescuing player".
However, I've created a little system to fix this issue. It's pretty straightforward and shouldn't cause any problems.

The above trigger would need to look like this if you wanted to use the system:
  • A Cage Dies
    • Events
      • Destructible - Cage 0000 <gen> dies
    • Conditions
    • Actions
      • Set VariableSet Cage_Rescued_Amount = 1
      • Set VariableSet Cage_Rescued_Unit_Type = Footman
      • Trigger - Run Cage Rescue Units <gen> (ignoring conditions)
First you define the amount of units that will be created and the type of unit that will be created. Then you run the Cage Rescue Units trigger which automatically handles the creation of the units and figures out who killed the cage using some basic logic.

So in this case when Cage 0000 dies it will create 1 Footman for the killing player.
Wow this was very straightforward and I'm pretty much learning as I go with your tidbits. Thanks a ton I appreciate it Unc.
 
Level 3
Joined
Aug 29, 2024
Messages
23
That's basically how you would do it.
  • A Cage Dies
    • Events
      • Destructible - Cage 0000 <gen> dies
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Position of (Dying destructible))
The variable/custom script is optional and is used to address memory leaks. I wouldn't concern yourself with those until you're far more familiar with triggering.

Edit:
The only issue here is that you cannot get the Player that killed the destructible, preventing you from creating the "rescued unit" for the "rescuing player".
However, I've created a little system to help fix this issue (see attached map). It's pretty straightforward and shouldn't cause any problems.

Note that my solution isn't perfect, it's more like a 99% chance to work and in those rare cases that it fails the system will default to Player 1.

So the above trigger would need to look like this if you wanted to use the system:
  • A Cage Dies
    • Events
      • Destructible - Cage 0000 <gen> dies
    • Conditions
    • Actions
      • Set VariableSet Cage_Rescued_Amount = 1
      • Set VariableSet Cage_Rescued_Unit_Type = Footman
      • Trigger - Run Cage Rescue Units <gen> (ignoring conditions)
First you define the amount of units that will be created and the type of unit that will be created. Then you run the Cage Rescue Units trigger which automatically handles the creation of the units and figures out who killed the cage using some basic logic.

So in this case when Cage 0000 dies it will create 1 Footman for the killing player.
Hey so as far as sounds go, I'm trying to make it to where (maybe) they talk when you break them out like "to arms" but more focused on the cage sound. (starting with just one sound first)

Does it go something like this? (got it from the sound editor and pasted it in)

Caged Unit 1
Events
Destructible - Cage 4843 <gen> dies
Conditions
Actions
Set VariableSet Cage_Rescued_Amount = 1
Set VariableSet Cage_Rescued_Unit_Type = Swordsman
Trigger - Run Cage Rescue Units <gen> (ignoring conditions)
Sound - Play CageDeath1 <gen>
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
When posting triggers on Hive simply wrap the trigger text with these two words:
[ trigger]
Your trigger text goes
[ /trigger]
But remove the space after [. That'll format it into a proper trigger like the ones I've been posting.

Anyway, when dealing with sounds you'll want to learn about the two types. There's universal sounds which play for everyone (what you're currently using) and there's 3D sounds which play at a specific point on the map. 3D sounds are more advanced as they have a cutoff range and require the Players to have their camera within range of the sound in order to hear it. So a universal sound would be something like the "An ally is under attack!" audio clip and a 3D sound would be a Footman's sword clanging against an enemy unit.

In your case it might make more sense to use a 3D sound and have it Play on the (Last created unit) which will be one of the rescued units. Note that you may have to double click the Sound in the Sound Editor and enable 3D sound if it's disabled for this to work.
 
Last edited:
Level 3
Joined
Aug 29, 2024
Messages
23
When posting triggers on Hive simply wrap the trigger text with these two words:

But remove the space after [. That'll format it into a proper trigger like the ones I've been posting.

Anyway, when dealing with sounds you'll want to learn about the two types. There's universal sounds which play for everyone (what you're currently using) and there's 3D sounds which play at a specific point on the map. 3D sounds are more advanced as they have a cutoff range and require the Players to have their camera within range of the sound in order to hear it. So a universal sound would be something like the "An ally is under attack!" audio clip and a 3D sound would be a Footman's sword clanging against an enemy unit.

In your case it might make more sense to use a 3D sound and have it Play on the (Last created unit) which will be one of the rescued units. Note that you may have to double click the Sound in the Sound Editor and enable 3D sound if it's disabled for this to work.
Hey I tried doing it by myself but kept messing up or it just not working. Is there a simple way like doing the caged units you told me, but for making hostile units? (not being rescued)
Just trying to add a skeleton or a ghoul or zombie or something in a cage next to someone to rescue. Thought it'd be more simple than that haha. Thanks.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,875
Find and click the Event "A destructible dies." Then click it's destructible value and select the pre-placed Cage on your map. Then find and click the Action "Create a unit". Then click it's position value and change it to -> Position of (Dying destructible). I imagine everything else will be familiar to you.
 
Level 11
Joined
Nov 15, 2007
Messages
800
What, exactly, are you trying to accomplish?
Trying to figure out how to place a unit into a cage and making him rescued by other players.
Does this mean you want, E.G. - a unit belonging to Player 1 is captured, then a unit belonging to Player 2 can destroy the cage and free that unit, which goes back to Player 1?

Or - the units are already in cages, and whoever destroys the cage gets the unit?
 
Level 3
Joined
Aug 29, 2024
Messages
23
Find and click the Event "A destructible dies." Then click it's destructible value and select the pre-placed Cage on your map. Then find and click the Action "Create a unit". Then click it's position value and change it to -> Position of (Dying destructible). I imagine everything else will be familiar to you.
Hey when I'm on the variable part, does it still need to be the caged_rescue_unit_type? Not exactly trying to rescue them. I got the amount and the triggers down for that part. Just trying to figure out the specifics.
When posting triggers on Hive simply wrap the trigger text with these two words:

But remove the space after [. That'll format it into a proper trigger like the ones I've been posting.

Anyway, when dealing with sounds you'll want to learn about the two types. There's universal sounds which play for everyone (what you're currently using) and there's 3D sounds which play at a specific point on the map. 3D sounds are more advanced as they have a cutoff range and require the Players to have their camera within range of the sound in order to hear it. So a universal sound would be something like the "An ally is under attack!" audio clip and a 3D sound would be a Footman's sword clanging against an enemy unit.

In your case it might make more sense to use a 3D sound and have it Play on the (Last created unit) which will be one of the rescued units. Note that you may have to double click the Sound in the Sound Editor and enable 3D sound if it's disabled for this to work.

What, exactly, are you trying to accomplish?

Does this mean you want, E.G. - a unit belonging to Player 1 is captured, then a unit belonging to Player 2 can destroy the cage and free that unit, which goes back to Player 1?

Or - the units are already in cages, and whoever destroys the cage gets the unit?
I got to where anyone {player 1-2) can rescue a unit and claim it as theirs from either a camp I made or a cage. Not just trying to figure out the hostile unit in a cage part.
 
Top