Page 1 of 1
Looting?
Posted: Mon Jul 28, 2008 3:58 pm
by Kiji8989
If I wanted t oloot a dead body, would I use the generic chest script or something else?
Re: Looting?
Posted: Tue Jul 29, 2008 12:25 pm
by Juutis
You could do it with the enemy AI script. When the enemy dies it would go to a state where it checks if the player is near enough and then give the player some stuff, in other words modify the player's attributes. Something like this:
Code: Select all
loot[ ()
{
self.ThinkTime = 0.1;
if(FastDistance("Player",200)) // if the player is less than 200 texels away
{
ModifyAttribute("gold",10,"Player"); // give the player 10 gold
HighLevel("Remove");
}
} ]
Remove[ ()
{
FadeOut(1,0);
Remove(true);
} ]
And in case you don't know scripting yet, the earlier you start the better. Scripting lets you do some really wild stuff.
Re: Looting?
Posted: Tue Jul 29, 2008 3:41 pm
by Kiji8989
Yeah. I cant download any manuals yet, so I am trying to just work my way with the community. :3 (I'm not at my computer)