View previous topic :: View next topic |
Author |
Message |
Camdog
Joined: 08 Aug 2003 Posts: 606
|
Posted: Fri Oct 31, 2008 8:58 am Post subject: NPCs Walking Over Heroes? |
|
|
I'm making a sidescroller with the OHR, and I'd like to use pre-existing movement patterns for the NPCs that are enemies. I've noticed everything works fine if the player runs into the NPC (ie you die), but if the player stands around waiting for the enemy to walk into him, the NPC will turn around before a collision occurs. This is despite the suspend commands I've issued the game via plotscripting.
So, the question is, is there any way, short of plotscripting movement routines or changing the source code, that would cause an NPC to walk into a hero of it's own volition? |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Fri Oct 31, 2008 9:01 am Post subject: |
|
|
The question is, what is a mahna mahna?
You have suspend obstruction, suspend hero walls, and suspend npc walls? (I think you only need the first one, but why not throw them all in?) _________________
|
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Fri Oct 31, 2008 9:27 am Post subject: |
|
|
What you are seeing is probably related to '' . bug_title('22') . ''.
NPC activation code for step-on and touch NPCs is only checked when the hero moves, not when the NPCs move.
First it would be awesome if you could make a simple test case for this bug with both step-on ant touch NPCs and attach it to bug 22 or e-mail it to me. I already have a good understanding of why this bug is happening, but having the test case would save me the time of having to create one myself :)
If you want that effect without waiting for the bug to get fixed, you probably need a continuously running loop that does something like this:
Code: |
variable(x,y)
x:=hero x(0)
y:=hero y(0)
if(npc at spot(x, y)) then (do collision action)
if(npc at spot(x--1, y)) then (do collision action)
if(npc at spot(x+1, y)) then (do collision action)
if(npc at spot(x, y--1)) then (do collision action)
if(npc at spot(x, y+)) then (do collision action)
|
Which is a bit of a hack, but it should work well enough. |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Fri Oct 31, 2008 9:40 am Post subject: |
|
|
You're confusing the problem -- but that is a simpler solution: make them step on NPCs. They'll run through the hero that way. _________________
|
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Fri Oct 31, 2008 12:37 pm Post subject: |
|
|
Moogle1 wrote: | You're confusing the problem -- but that is a simpler solution: make them step on NPCs. They'll run through the hero that way. |
I know Camdog was talking about touch NPCs not step-on NPCs, but I am pretty sure the cause of the problem is the same. |
|
Back to top |
|
 |
Camdog
Joined: 08 Aug 2003 Posts: 606
|
Posted: Fri Oct 31, 2008 1:58 pm Post subject: |
|
|
Whoops! Actually, it turns out that I'm just an idiot. I could've sworn those NPCs were set to step on, but they were in fact set to use. Changing that fixes my problem. Sheesh.
Fortunately, I am using a custom collision detection script, so I don't need to worry about the bug he described. Thanks guys. |
|
Back to top |
|
 |
|