Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Collision Bug

Author
Message
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 5th Dec 2009 08:55
Hello, i am trying to get collision working with my npcs. I had it working with a single Npc but now i cant seem to get it working again.



Basically when the npc walks into the player i want it to stop so it doesnt walk all over the player. Sometimes it works sometimes it does not. Sometimes it will move the npc to a random spot, even though the old location doesn't equal that spot at all. Here is all relevant code please tell me why it only works some of the time.

Also it may only happen when the npc is on the lower half off my screen. But it may not. its hard to tell.

All the Npcs animated sprite numbers are the sprite + 200. So sprite 1 would be sprite number 201

Randomize movement only happens once at beginning of application start.




Create NPC (gets the data from mikenet)



Show Npc



Npc Movement (random).









Collision Code!. My collision with NPCS works great. but not npc collision with me. Sometimes it works fine. Sometimes it puts them somewhere random.













Sorry i know its alot of code. But i cant figure out whats causing the npcs to go somewhere random when i touch them. Then other times it seems to work fine. Could someone please attempt to figure it out.
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 6th Dec 2009 08:13
Any ideas?
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 6th Dec 2009 17:26
Bump
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 6th Dec 2009 21:01
dont bump a 1 day old thread
TWICE

and no sorry i cant help you



Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 7th Dec 2009 05:07 Edited at: 7th Dec 2009 05:12
Alright this is really confusing me



It will show the npcx having a value of say 500. Then the oldnpcx having a value of say 17.

Even though i just told them to be the same value. I am very confused. Any idea what i am doing wrong? can you not assign integers to another integer with the equal symbol?

[EDIT]

YES!!!!!!!!!, i figured it out. The npcx was a integer. The oldnpcx was a byte. So if the value was over 255 it started counting from 0 again. Thanks for trying to figure it out if anyone did .

Login to post a reply

Server time is: 2024-10-01 18:24:12
Your offset time is: 2024-10-01 18:24:12