Should objects and traps know where they are?

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Should objects and traps know where they are?

#1 Post by yufra »

A bit of background... in VR there are people hiding behind locked doors (what would you do if zombies started appearing?) and to handle this I have placed a "x" on doors that you hear noises behind. The "x" is actually an object that has a can_talk variable set, so bumping into it will initiate a chat. Now say you convince the NPC to open the door within the chat... well the object currently doesn't store its x and y position... problem.

I suggest engine.Zone:addEntity add the position to objects and traps as well as actors and projectiles. The terrain should be left untouched since a single copy is used for all of the similar type, but I think all objects and traps are different copies and thus can store their position just fine. So... any reason not to?
<DarkGod> lets say it's intended

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Should objects and traps know where they are?

#2 Post by darkgod »

done
<DarkGod> yufra, now defining a "__position_aware" property on any entity/entity class will make the map code store its location
<DarkGod> in a x/y field
<DarkGod> so if you want your obejcts to know their position just add:
<DarkGod> _M.__position_aware = true to your obejct class
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply