Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Problem with NPC movement

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Uncommon
His legend will never die




Joined: 10 Mar 2003
Posts: 2503

PostPosted: Sun Nov 09, 2003 11:43 pm    Post subject: Problem with NPC movement Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Flamer
The last guy on earth...




Joined: 04 Feb 2003
Posts: 725
Location: New Zealand (newly discovered)

PostPosted: Mon Nov 10, 2003 1:51 am    Post subject: Reply with quote

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 Raspberry!
(no offense to anyone that was mentioned)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Minnek
Conjurer




Joined: 03 Jun 2003
Posts: 430
Location: Somewhere

PostPosted: Mon Nov 10, 2003 3:29 am    Post subject: Reply with quote

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. Big grin
_________________
* SDHawk has joined #Minnek
SDHawk> AAAAAAAAAAAAAUUUUUUUUUGH
* SDHawk has left #Minnek (Leaving)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Uncommon
His legend will never die




Joined: 10 Mar 2003
Posts: 2503

PostPosted: Mon Nov 10, 2003 6:11 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Minnek
Conjurer




Joined: 03 Jun 2003
Posts: 430
Location: Somewhere

PostPosted: Mon Nov 10, 2003 7:50 am    Post subject: Reply with quote

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 Oookay...
_________________
* SDHawk has joined #Minnek
SDHawk> AAAAAAAAAAAAAUUUUUUUUUGH
* SDHawk has left #Minnek (Leaving)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
DemocraticAnarchist
Sleep Deprived




Joined: 26 Apr 2003
Posts: 137
Location: :noitacoL

PostPosted: Mon Nov 10, 2003 12:21 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Uncommon
His legend will never die




Joined: 10 Mar 2003
Posts: 2503

PostPosted: Mon Nov 10, 2003 12:32 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Mon Nov 10, 2003 3:40 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
LeRoy_Leo
Project manager
Class S Minstrel



Joined: 24 Sep 2003
Posts: 2683
Location: The dead-center of your brain!

PostPosted: Mon Nov 10, 2003 5:50 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Mon Nov 10, 2003 7:29 pm    Post subject: wait for all Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Flamer
The last guy on earth...




Joined: 04 Feb 2003
Posts: 725
Location: New Zealand (newly discovered)

PostPosted: Tue Nov 11, 2003 5:06 am    Post subject: Reply with quote

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 Raspberry!
(no offense to anyone that was mentioned)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
DemocraticAnarchist
Sleep Deprived




Joined: 26 Apr 2003
Posts: 137
Location: :noitacoL

PostPosted: Tue Nov 11, 2003 1:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Uncommon
His legend will never die




Joined: 10 Mar 2003
Posts: 2503

PostPosted: Tue Nov 11, 2003 11:36 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group