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

Walk the Walk

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Master K
Ex-Akatsuki Masked Ninja




Joined: 11 Jun 2011
Posts: 57
Location: Everywhere and Nowhere. Muahaha!

PostPosted: Wed Jun 15, 2011 7:15 pm    Post subject: Walk the Walk Reply with quote

Ok...so I am trying to make a sleep script, where screen fades out, and after a little bit, the players mom comes and wakes them up, and then leaves. But the mom shows up on a random tile, and won't walk, but instead twitches, and the hero won't walk right 1 tile. What am I doing wrong?!

Heres the script:

Quote:
Code:
Plotscript, sleepingathome, begin
      suspend player
      set hero direction(down)
      fade screen out
      suspend NPCs
      suspend map music
      play song(22)
      set NPC position(0,29,6)
      set NPC direction(0,left)
      wait(85)
      fade screen in
      show text box(8)
      wait for text box
      stop song
      play song(14)
      show text box(9)
      wait for text box
      set NPC direction(0,right)
      wait for NPC
      walk NPC(0,right,5)
      NPC is walking(0)
      wait for NPC
      walk NPC(0,up,2)
      NPC is walking(0)
      wait for NPC
      walk NPC(0,right,1)
      NPC is walking(0)
      wait(8)
      set NPC position(0,9,8)
      walk hero(right,1)
      wait for hero
      resume NPCs
      resume player
      end
Back to top
View user's profile Send private message
mswguest
Guest






PostPosted: Wed Jun 15, 2011 8:47 pm    Post subject: Reply with quote

Hm, I really am too lazy to log in anymore it seems.

A few problems:
1. Take out the "NPC is walking" lines. This command is only for use when checking for truth or falsehood, in logic chains like:
Code:
if (NPC is walking), then, begin

No need for that here.

2. The command "Wait for NPC" needs to be told which NPC it is waiting for. So you should have
Code:
wait for NPC (0)

instead of just "wait for NPC".

3. Same thing for the hero walking and waiting commands:
Code:
walk hero (me, right, 1)
wait for hero (me)


I don't know why the mom (NPC zero, I presume?) is showing up in a random place though.
Back to top
Master K
Ex-Akatsuki Masked Ninja




Joined: 11 Jun 2011
Posts: 57
Location: Everywhere and Nowhere. Muahaha!

PostPosted: Thu Jun 16, 2011 4:35 am    Post subject: Reply with quote

Thanks. And yes, the mom is number 0 on the map.

You see, with the mom random spot issue, the mom is meant to stand next to the hero, then turn, and leave. But, she sometimes shows up at the foot of the bed, a tile away from the bed, and she even appeared on the hero.
Back to top
View user's profile Send private message
mswguest
Guest






PostPosted: Thu Jun 16, 2011 4:57 am    Post subject: Reply with quote

Oh, so she only ever appears 1 step away from where she's supposed to be? After your suspend NPCs command, but before moving the mom, you should add
Code:
wait for NPC (0)


because if the mom was in the middle of walking when the NPCs were suspended, she would be set to finish her last step so that she was suspended on a tile, not between two of them. When you teleport her, she retains her command to finish her step.

At least, I'm pretty sure that's what is going on.
Back to top
Master K
Ex-Akatsuki Masked Ninja




Joined: 11 Jun 2011
Posts: 57
Location: Everywhere and Nowhere. Muahaha!

PostPosted: Thu Jun 16, 2011 8:22 am    Post subject: Reply with quote

The mom now shows up on the correct space, but still twitches on spot. What is wrong with her?
Back to top
View user's profile Send private message
Bob the Hamster
OHRRPGCE Developer




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

PostPosted: Thu Jun 16, 2011 8:40 am    Post subject: Reply with quote

Master K wrote:
The mom now shows up on the correct space, but still twitches on spot. What is wrong with her?


Can we see the current script?

Also, what is her walking speed?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Master K
Ex-Akatsuki Masked Ninja




Joined: 11 Jun 2011
Posts: 57
Location: Everywhere and Nowhere. Muahaha!

PostPosted: Thu Jun 16, 2011 9:14 am    Post subject: Reply with quote

Here it is.

Code:
Plotscript, sleepingathome, begin
      suspend player
      set hero direction(down)
      fade screen out
      suspend NPCs
      wait for NPC(0)
      suspend map music
      play song(22)
      set NPC position(0,29,6)
      set NPC direction(0,left)
      wait(85)
      fade screen in
      show text box(8)
      wait for text box
      stop song
      play song(14)
      show text box(9)
      wait for text box
      set NPC direction(0,right)
      wait for NPC(0)
      walk NPC(0,right,5)
      wait for NPC(0)
      walk NPC(0,up,2)
      wait for NPC(0)
      walk NPC(0,right,1)
      wait(8)
      set NPC position(0,9,8)
      wait for NPC(0)
      walk hero(me,right,1)
      wait for hero(me)
      resume NPCs
      resume player
      end[quote][/quote]
Back to top
View user's profile Send private message
Bob the Hamster
OHRRPGCE Developer




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

PostPosted: Thu Jun 16, 2011 9:41 am    Post subject: Reply with quote

This seems to be the part that isn't working.

Code:

      walk NPC(0,right,5)
      wait for NPC(0)


You say she just wiggles in place without moving? There are several things that I can think of that could cause that.

* Her walking speed might be zero
* She might be misaligned with her tile (but looking at the rest of the script, I think that is very unlikely)
* Another NPC could be blocking her (even NPCs that the hero can walk over cannot be walked over by an NPC) CTRL+F11 might help, since it makes all NPCs visible, even the ones that have no pictures.
* She is restricted to a Zone, and you moved her outside of the zone.
* You found an engine bug.

Lets first try to rule out the first four, and if none of those can possibly be the problem, we can move on to figuring out if this is a bug.

Also, there are a few minor problems with your script. None of these will break it, but I thought you would like to know.

Code:
suspend map music


This command does not do what you think it does. it does NOT stop the currently playing music on the map. It prevents the music from changing when you move to a different map, which never happens in this script.

Code:
play song(22)


This automatically stops the music that was playing before.

Code:

      set NPC direction(0,right)
      wait for NPC(0)


"set NPC direction" takes effect instantaneously, so the "wait for NPC" command after it does nothing. You only need to use wait for NPC after making the NPC walk, never for any other NPC commands.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Master K
Ex-Akatsuki Masked Ninja




Joined: 11 Jun 2011
Posts: 57
Location: Everywhere and Nowhere. Muahaha!

PostPosted: Thu Jun 16, 2011 10:54 am    Post subject: Reply with quote

Ahhhhhh I know whats wrong. She is restricted to a zone! You see, this NPC im using is the mother from the lower floor of the house, in the same map. I limited her to a zone, and that must be why she twitches when I removed her. I'll test it out now...ERR. Wrong. Still ain't working. I made a new mom for this, set her to speed 2, stand still, and replaced all 0's with 8's. She twitched in place too. I really don't understand whats wrong.

Heres the script:

Quote:
Code:
Plotscript, sleepingathome, begin
      suspend player
      set hero direction(down)
      fade screen out
      suspend NPCs
      wait for NPC(8)
      play song(22)
      set NPC position(8,29,6)
      set NPC direction(8,left)
      wait(85)
      fade screen in
      show text box(8)
      wait for text box
      stop song
      play song(14)
      show text box(9)
      wait for text box
      set NPC direction(8,right)
      walk NPC(8,right,5)
      wait for NPC(8)
      walk NPC(8,up,2)
      wait for NPC(8)
      walk NPC(8,right,1)
      wait(8)
      set NPC position(8,49,16)
      wait for NPC(8)
      walk hero(me,right,1)
      wait for hero(me)
      resume NPCs
      resume player
      end
Back to top
View user's profile Send private message
Bob the Hamster
OHRRPGCE Developer




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

PostPosted: Fri Jun 17, 2011 5:02 pm    Post subject: Reply with quote

Master K wrote:
..ERR. Wrong. Still ain't working. I made a new mom for this, set her to speed 2, stand still, and replaced all 0's with 8's. She twitched in place too. I really don't understand whats wrong.


Would you mind sending me a copy of your RPG file, and a .rsav file that starts right before the troublesome script?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Master K
Ex-Akatsuki Masked Ninja




Joined: 11 Jun 2011
Posts: 57
Location: Everywhere and Nowhere. Muahaha!

PostPosted: Fri Jun 17, 2011 5:23 pm    Post subject: Reply with quote

Nevermind James...the mother suddenly decided to work. I tested it four times in disbelief. Make that five...she works. She suddenly works...well, I no longer need this thread.

Thank you everyone who helped me with dealing with the mom issue!
Back to top
View user's profile Send private message
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