View previous topic :: View next topic |
Author |
Message |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
Posted: Sun Nov 09, 2003 11:43 pm Post subject: Problem with NPC movement |
|
|
So, I'm having trouble with some npc movement. I have a box made of four npcs in a squares paatern, and I'm trying to get it to move in synchronization. This is working fine, the problem is that they move too far. This is a (seemingly) simple script for having the box move up one space, then back down again. The problem is that it sometimes movs down two instead, and becomes generally misaligned.
Any insights?
If it helps to know, obstruction and npcs are suspended at the time this script runs.
Code: | box 1 := npc reference (4,0)
box 2 := npc reference (4,1)
box 3 := npc reference (4,2)
box 4 := npc reference (4,3)
walk npc (box 1,up,1)
set npc direction (box 1,down)
walk npc (box 2,up,1)
set npc direction (box 2,right)
walk npc (box 3,up,1)
set npc direction (box 3,up)
walk npc (box 4,up,1)
set npc direction (box 4,left)
wait for all
walk npc (box 1,down,1)
set npc direction (box 1,down)
walk npc (box 2,down,1)
set npc direction (box 2,right)
walk npc (box 3,down,1)
set npc direction (box 3,up)
walk npc (box 4,down,1)
set npc direction (box 4,left)
wait for all |
|
|
Back to top |
|
 |
Flamer The last guy on earth...

Joined: 04 Feb 2003 Posts: 725 Location: New Zealand (newly discovered)
|
Posted: Mon Nov 10, 2003 1:51 am Post subject: |
|
|
that's wierd, generally that should work...
check to see what suspends and other obstacles could be the cause of the mishap.
have you tried replacing wait for all, with wait for npc(box1).
just one "wait for npc" on any of the npc should be enough, as none of them has any difference in movement. _________________ If we were a pack of dogs, IM would be a grand Hound, CN would be a very ficious little pitball, and Giz...well, it doesn't matter breed he is, he'd still be a bitch
(no offense to anyone that was mentioned) |
|
Back to top |
|
 |
Minnek Conjurer

Joined: 03 Jun 2003 Posts: 430 Location: Somewhere
|
Posted: Mon Nov 10, 2003 3:29 am Post subject: |
|
|
Heh. Try suspending obstructions, that might help. Not really sure what the problem may be though, since everything looks fine to me. Good luck with this problem though, hope you get it fixed.  _________________ * SDHawk has joined #Minnek
SDHawk> AAAAAAAAAAAAAUUUUUUUUUGH
* SDHawk has left #Minnek (Leaving) |
|
Back to top |
|
 |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
Posted: Mon Nov 10, 2003 6:11 am Post subject: |
|
|
Well, good to know that I didn't miss anything, since no one else sees any huge errors.
Flamer:
It was originally"wait for npc", but, now that I think about it, that command would wait for npc 0 by default. I'll try that, and see if it helps.
Minnek:
Obstruction is already suspended. I already told you that. Shrug, you must've missed it. |
|
Back to top |
|
 |
Minnek Conjurer

Joined: 03 Jun 2003 Posts: 430 Location: Somewhere
|
Posted: Mon Nov 10, 2003 7:50 am Post subject: |
|
|
Oops. *smacks himself* sometimes I get too focused on the problem and forget what's going on. Heh. Sorry about that...I'll try not to let it happen again  _________________ * SDHawk has joined #Minnek
SDHawk> AAAAAAAAAAAAAUUUUUUUUUGH
* SDHawk has left #Minnek (Leaving) |
|
Back to top |
|
 |
DemocraticAnarchist Sleep Deprived

Joined: 26 Apr 2003 Posts: 137 Location: :noitacoL
|
Posted: Mon Nov 10, 2003 12:21 pm Post subject: |
|
|
How about replacing up down left right with nort south east west? Sounds dumb, but it worked for me before. Also, check if they are bumping off each other or somthing if you are running 4 ath the same time without any wait commands seperating them. _________________ What cruel person decided lisp should have an s in it? |
|
Back to top |
|
 |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
Posted: Mon Nov 10, 2003 12:32 pm Post subject: |
|
|
Change in directional constants will help nothing. They are facing the proper direction already. And, as I have mentioned twice before, obstruction is suspended, so they are not bumping off of each other. Did you even read the problem? |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Nov 10, 2003 3:40 pm Post subject: |
|
|
Ohhh... tricky.
Are the npcs perfectly aligned at the start of this script, or they in between 2 tiles?
Do all the npcs sometimes move down an extra square, or just 1 or 2?
And, what happens after this in your script? _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
LeRoy_Leo Project manager Class S Minstrel

Joined: 24 Sep 2003 Posts: 2683 Location: The dead-center of your brain!
|
Posted: Mon Nov 10, 2003 5:50 pm Post subject: |
|
|
I have a similar problem, so any answer for unc will be an answer for me... _________________ Planning Project Blood Summons, an MMORPG which will incinerate all of the others with it's sheer brilliance...
---msw188 ---
"Seriously James, you keep rolling out the awesome like gingerbread men on a horror-movie assembly line. " |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Mon Nov 10, 2003 7:29 pm Post subject: wait for all |
|
|
I mistrust the "wait for all" command in this situation. It waits for all NPCs, all heroes, and all camera movement. It *should* work as advertised, but I will admit that I have give "wait for all" FAR less testing than any other "wait" type command. I am very curious to hear if switching to "wait for NPC(box 1)" works any differently. |
|
Back to top |
|
 |
Flamer The last guy on earth...

Joined: 04 Feb 2003 Posts: 725 Location: New Zealand (newly discovered)
|
Posted: Tue Nov 11, 2003 5:06 am Post subject: |
|
|
i'm curious as to why it's moving 2 down when it was told to move down 1.
do you have any commands inbetween this presented script??
if so then wait for all would be the last wait command you should be using...
anyway, i'm gonna test somethings out, and see if a can find anythin. _________________ If we were a pack of dogs, IM would be a grand Hound, CN would be a very ficious little pitball, and Giz...well, it doesn't matter breed he is, he'd still be a bitch
(no offense to anyone that was mentioned) |
|
Back to top |
|
 |
DemocraticAnarchist Sleep Deprived

Joined: 26 Apr 2003 Posts: 137 Location: :noitacoL
|
Posted: Tue Nov 11, 2003 1:07 pm Post subject: |
|
|
Are heroes suspended too, and if not have they any on keypress scripts etc that could be interfering? _________________ What cruel person decided lisp should have an s in it? |
|
Back to top |
|
 |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
Posted: Tue Nov 11, 2003 11:36 pm Post subject: |
|
|
Flamer and James had it right on the money. Changed the "wait for all"s to "wait for npc (box 4)", and it works perfectly. I'm uploading the bugfixed version as we speak.
Thanks a bunch, guys. |
|
Back to top |
|
 |
|