HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Dead Lumber

10-20-2005, 03:26 PM#1
Kabel
Hello. When a unit dies on my map, I want the player who killed the unit to instantly recieve one lumber. But if a player kills one of his own units, or one of his summoned unit dies due to the duration time, he wont recieve a lumber. How is the trigger for this?
(Oh, and I dont want buildings to generate lumber when killed)
Is it possible to make a building or upgrade to "change" the trigger?
For example, if I build a building called "Soul Storage" can I recieve 2 lumber per killed unit instead of only 1?
Is it possible to make a building who slowly generates lumber?
Is it possible to have an ability called Soul Harvest, who will work like Raise Dead, but instead of summoning a skeleton it will instantly give the player 1 lumber? Thanks.
10-20-2005, 04:23 PM#2
Ant
Yes. It's actually quite easy.

For a value that doesn't change, let's say lumber given stays at 1 forever, simply set player flags to enable bounty, and edit the unit properties in the object editor so they give 1 lumber.

Otherwise, just trigger it. You know how to detect when a unit dies, just add conditions to do whatever you want to do. Use a variable to change the amount of lumber given. Use an array if you want different values for different players.

Change triggers? Like how. Just create triggers with different conditions if you want different triggers to excecute for different types of units, or just create multiple triggers and turn them on and off.

For soul harvest, just summon a dummy invisible unit that dies after 0.01 seconds (not 0, that makes it last forever) and detect when the unit is summoned, then give the player 1 lumber.
10-31-2005, 05:11 PM#3
Kabel
Hm. When a unit dies it drops an item, I know the trigger for doing that, but instead I want a player to instantly recieve one lumber when he kills an enemy unit but it wont work for me. I am not very good at triggering so please show me the exact trigger. By the way, is it possible to make a building to slowly generate lumber to the player who controlls it?
11-01-2005, 01:06 AM#4
Tim.
Code:
Player - Add 1 to (Triggering player) Current lumber

Or owner of triggering unit.
11-01-2005, 08:50 PM#5
Kabel
Wiee! It works! Thanks! But there is a small problem. The owner of the killed unit recives the lumber and not the player who killed the unit.
11-01-2005, 11:09 PM#6
Tim.
Owner of killing unit? Somthing like that anyway.
11-02-2005, 01:47 PM#7
Kabel
Oh. I think I found out. I saw what Ant wrote about Bounty and it seems to work fine for me.

Event - Map Initialization
Condition - (None)
Actions:
Turn Gives Bounty On for Player 1 (Red)
Turn Gives Bounty On for Player 2 (Blue)
Turn Gives Bounty On for Player 3 (Teal)
And so on.

Is this correct?
11-02-2005, 04:58 PM#8
Soultaker
Quote:
Originally Posted by Kabel
Oh. I think I found out. I saw what Ant wrote about Bounty and it seems to work fine for me.

Event - Map Initialization
Condition - (None)
Actions:
Turn Gives Bounty On for Player 1 (Red)
Turn Gives Bounty On for Player 2 (Blue)
Turn Gives Bounty On for Player 3 (Teal)
And so on.

Is this correct?

Yes, that will do. But only if you added the 1 lumber bounty in the Units data.

Also, it would be easier to do:

[code]Pick all players in "All Players" and do action: Turn Gives Bounty On for "Picked Player"

Hope you understod the last part :D

-Soultaker
11-03-2005, 06:07 PM#9
Kabel
Regarding the skill Soul Harvest I talked about in the beginning of this thread. I use Raise Skeleton and replaces the summoned skeleton with a unit named Lumber Unit and set the duration time to 1 second. Then I created a trigger like this:

Event - A unit Dies
Conditions - (Unit-type of ((Triggering unit))Equal To Lumber Unit
Actions - Player add 1 to (Matching player)Current Lumber

But this don't work. I thought of creating 6 different triggers and replace the "Matching player" into "Player 1", "Player 2" etc
But that doesn't sound right.

I also tought of creating a building called Soul Storage. The building has the factory-ability which creates a Soul Unit every 20 second. The Soul Unit will live 1 second and when it dies it will give the player who owns the building 1 lumber.

So my question is what am I doing wrong?
Thanks.
11-03-2005, 09:31 PM#10
Ice_Keese
Quote:
Originally Posted by Kabel
Event - A unit Dies
Conditions - (Unit-type of ((Triggering unit))Equal To Lumber Unit
Actions - Player add 1 to (Matching player)Current Lumber

Use "Owner of Dying Unit" instead.