HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Variable Array Type Thingy... :(

03-04-2003, 01:55 AM#1
Tearsong
I've asked before, but I'll try again...

I have a unit, and say I give "Bubba" (the unit) a variable. Now when "Bubba" dies I want "Bubba's" variable to transfer to "Pappa" who respawns when "Bubba" dies.

How do I go about doing this?

Thanks.
03-04-2003, 01:57 AM#2
DaKaN
player onwed unit event (or you can use specific)

condition:
unit is = to varible (bubba)

actions

set pappa = to bubba
(the unit is a hero i assume?)hero - revive hero instanly at regionX
if not.. create unit pappa at regionX


this is if i read what you wanted correctly
03-04-2003, 02:01 AM#3
Tearsong
Thanks, I'll try it out 2maro. :D
03-04-2003, 05:42 PM#4
Tearsong
Is it possible to do this with a regular unit?
03-04-2003, 06:02 PM#5
DaKaN
yep, same way, but you would have to create the new unit instead of revive.

set varible = to type of dying unit (not the actual unit because that unit would be "dead")

then create a type of that dying unit
03-04-2003, 06:04 PM#6
Tearsong
Hmm... can this same trigger be used multiple times with mutliple spawning regions?

(Its for the ladder bearers in Helm's Deep)
03-04-2003, 06:20 PM#7
DaKaN
convert it to custom text and make 1 complex ifThenElse statment that checks to see player number or whatever else you want it to compair then have it run another function and pass in the player, and region to spawn in
03-04-2003, 07:12 PM#8
Tearsong
I got it working, a different method though...

Events
___________________________
A Unit Enters Ladder2Exit
___________________________
Conditions:
(iLadder2NPosition=1) and (Entering Unit = XXXX)
___________________________
Actions:
Unit - Kill Random Unit from(Units in Ladder2 matching (Ladder Carrier equal to Ladder carrier)


Thanks for your help! It works, yippee, so I guess I dont need any variables!
03-04-2003, 11:16 PM#9
DaKaN
(Ladder Carrier equal to Ladder carrier)

that part of the code is useless for it will allways be true thats like saying a unit enters region x and kill it if 1=1

that statement will never be false, ladder carrier should = entering unit, or triggering unit (actualy i think in that situation you should use matching unit)
03-04-2003, 11:22 PM#10
Tearsong
Yah, I revised it after posting that... now it looks like this...

Actions:
__________________________________
Kill - Unit(Random Unit from(Units in Ladder2 <gen>(((Matching Random Unit from(Units of type Ladder Carrier)) is in (Units owned by Player 12 (Brown) of type Ladder Carrier)) Equal to True)))


Works like a charm even with multiple units int he area! :D