The Daily Click ::. Forums ::. Klik Coding Help ::. NPC type problem..
 

Post Reply  Post Oekaki 
 

Posted By Message

hapsi



Registered
  13/11/2003
Points
  775
14th June, 2012 at 14/06/2012 19:15:48 -

I usually assemble my npc's in most of my games from multiple active objects and i always have to make some sort of collision shields to prevent them from stealing parts from each other. Now however i can't/ don't want to do it that way. Is there any way to keep npc's parts on their original owners when they overlap?

I've tried following:

[Start of frame] --> Set value x of "npc base" to random (9999)

[start of frame + "parts of npc" is overlapping "npc base"] --> set value x of "parts of npc" to value x of "npc base"

[if values are the same..] --> set direction and position to "npc base" dir. and pos.

..and it does not work. Well it works on only one npc at a time. This might be a little confusing, im very tired.



 
[Signature][/Signature]

s-m-r

Slow-Motion Riot

Registered
  04/06/2006
Points
  1078

Candle
14th June, 2012 at 14/06/2012 22:10:38 -

Looks like Spread Value can come to the rescue here. There are some remarkable articles about how to use the process to sort things like this. Here's one:

http://www.create-games.com/article.asp?id=1798

 
n/a

vetmora120



Registered
  07/01/2010
Points
  273
14th June, 2012 at 14/06/2012 23:45:15 -

Yeah, I think Spread Value would be a better solution, and would avoid the possible chance (if ever so small) of having the same number picked.

Perhaps flags may come in handy as well. So only "connect" all your NPC parts to the NPC base if their flag X is off, then set flag X to on. Not sure exactly how you're working things though, so I just may be giving you useless advice

 
n/a
   

Post Reply



 



Advertisement

Worth A Click