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

load a timer

Status
Not open for further replies.
Level 1
Joined
Apr 4, 2013
Messages
2
item for random unit

im creating a "who is the killer/alien/werewolf" game. how do i make that 1 player becomes the killer?, im trying to create an object and give it to that unit, but sometimes its given to the corsep of a dead player.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Store the killer player's unit in a global unit variable. Any items for the killer go to the unit in that variable.

If you use the GUI unit replacement action at any time on the killer unit then you need to update the global unit variable to refer to the new unit. Unlike morphs and chaos which change unit type without changing the unit reference, the GUI replace action makes an entirely new unit and removes the old unit (and anything it does not check to transfer).
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Not everyone plays your game, you have to elaborate on that next time.

Let me get this straight, in the game of yours, every player can control 1 unit, right ?
And, after certain event (such as day turns to night), 1 random Player will turn to something else (wolves, etc).
And you want to give object (or an item) to the affected player unit, right ?

So, what happen if other player has been killed by the wolf ?
Does that player still in the game or what ?
 
Level 1
Joined
Apr 4, 2013
Messages
2
Not everyone plays your game, you have to elaborate on that next time.

Let me get this straight, in the game of yours, every player can control 1 unit, right ?
And, after certain event (such as day turns to night), 1 random Player will turn to something else (wolves, etc).
And you want to give object (or an item) to the affected player unit, right ?

So, what happen if other player has been killed by the wolf ?
Does that player still in the game or what ?

im not trying to morph it. i will give a random unit a spellbook with certain spells to kill the others, but he will look just like any other player the entire game.before the event "choose a random killer", everybody is ally. if a player is killed by anyone or anything, he will become a ghost, but i already have that trigger. the problem is: if one player doesnt move from starting zone, he will be killed (like the explosion in vampirism). when the event "give spellbook to one unit to make him the killer" happens, it can be given to the corsep of that killed players, it appears on the ground, even when the object is undropable, and dont fall when the unit dies.
 
Status
Not open for further replies.
Top