| 08-03-2003, 02:23 PM | #1 |
Okay, so what I am currently trying to do is first make a unit (coffin) appear when a hero dies. This works fine. Then I want the coffin to stay there for 10 seconds, then be deleted. So I have Wait 10 seconds... but then I can't figure out how to delete the coffin. Unit - Remove <Last Created Unit> doesn't work, because I have other units spawning that aren't related at all, and if they spawn it removes one of them instead of the coffin. Any suggestions? |
| 08-03-2003, 02:30 PM | #2 |
Try saving the coffin into a variable |
| 08-03-2003, 02:44 PM | #3 |
Sorry to be a newb, but haven't dealt with variables yet.. I select variables then edit variable and add in a unit-type one for the coffin... then what? I can't select the variable or anything? Don't understand how you use the variable. |
| 08-03-2003, 02:51 PM | #4 |
Use the action "set variable" to assign a value to your variable. |
| 08-03-2003, 02:53 PM | #5 |
Variables are pretty easy to use once you get used to them. For a coffin, make a Unit-type variable titled, say, "Coffin", then make a Set Variable Trigger, then set Coffin = [Insert Coffin-type Unit here], then that should work from there on. |
| 08-03-2003, 03:15 PM | #6 |
Okay, well... when I test the map here is what happends. It's a hero arena type game so when first thing is to select hero and when you select hero it kills the neutral hero at his/her beacon.. so when that hero dies the coffin appears, stays for 10 seconds, then disapears.. just like it should. But then I added another hero on the map just to test it out, so I go and kill it, the coffin appears... and stays there.. indefinately. Can't figure out why. My trigger looks like this: |
| 08-03-2003, 04:41 PM | #7 |
Nobody knows why this trigger wouldn't work? :| |
| 08-03-2003, 04:49 PM | #8 |
How about set coffin=last created unit and use remove coffin (variable) from game. Oh and put the set variable before the wait action. |
| 08-03-2003, 05:25 PM | #9 |
Try this trigger: Coffin Events Unit - A unit Dies Conditions ((Dying unit) is A Hero) Equal to True Actions Unit - Create 1 Coffin for (Owner of (Dying unit)) at (Position of (Dying unit)) facing Default building facing degrees Set Coffin = (Last created unit) Wait 10.00 game-time seconds Unit - Remove Coffin from the game |
| 08-03-2003, 05:47 PM | #10 |
Hmm... sounds like u could have use of arrays here. If u don't know the way arrays works there are some good tutorials on this forum. I'll explain how to fix your problem anyway: First, open the variable window and create the following variables: ![]() Remark the unit variable is an array. In order to make an array, mark the little checkbox marked "array" in the variable-create window. Don't even forget to set the integers initial value to 0 (by clicking on the blue hypertext in the same window and write 0). OK, that's the variables. Now create two triggers in this manner: Now, the trigger will work fine. And u, don't mind I've changed the event, thats just because I haven't got TFT yet...:nono: :nono: |
| 08-03-2003, 05:48 PM | #11 |
Its true, the variable button looks just like those 2 little red boxes!!! |
| 08-03-2003, 06:03 PM | #12 | |
Quote:
lol, yep, incredible, isn't it? (To the above poster 2 posts up: Perhaps if you posted the pictures to make them work, it'd explain stuff a bit better...) |
| 08-03-2003, 06:09 PM | #13 |
i think hes just pimping his signature, i mean, look, the pictures are all the same little red X |
| 08-03-2003, 09:49 PM | #14 |
Coffin isnt the triggering unit. Thats why your trigger didnt work. |
| 08-10-2003, 08:40 PM | #15 |
OK, hope u'll see the pictures now... Had to change my damn image host ://// :D |
