Looting?

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
Kiji8989
Posts: 209
Joined: Tue Jul 22, 2008 11:39 pm

Looting?

Post by Kiji8989 »

If I wanted t oloot a dead body, would I use the generic chest script or something else?
(\_/)
(O.o) copy bunny into your signature to
( >< )help him achieve world domination
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: Looting?

Post 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.
Pain is only psychological.
User avatar
Kiji8989
Posts: 209
Joined: Tue Jul 22, 2008 11:39 pm

Re: Looting?

Post 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)
(\_/)
(O.o) copy bunny into your signature to
( >< )help him achieve world domination
Post Reply