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

Post Reply  Post Oekaki 
 

Posted By Message

hapsi



Registered
  11/13/2003
Points
  666
14th June, 2012 at 6/14/2012 7:15:48 PM -

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
  6/4/2006
Points
  3180

Candle
14th June, 2012 at 6/14/2012 10:10:38 PM -

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

 
.

vetmora120



Registered
  1/7/2010
Points
  281
14th June, 2012 at 6/14/2012 11:45:15 PM -

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

 
The universe of Vetmora.
   

Post Reply



 



Advertisement

Worth A Click