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/ hero directions

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
miss_sinister




Joined: 09 Jun 2011
Posts: 10
Location: Wales

PostPosted: Thu Jun 09, 2011 2:28 pm    Post subject: Problem with NPC/ hero directions Reply with quote

Ok, first of all, I'm new so : Hi everyone Razz

I've been using OHRRPGCE for about a year or so now. I've just got a new computer, reinstalled the program, and I've started making games again.

The problem I'm having is, when i use a script to determine which direction an NPC or hero will face or travel, they just won't respond. It doesn't matter whether I use compass point directions or the more informal right, left etc. They just face south and do nothing. Thanks for any help you can give me (and apologies if I am overlooking something simple here).
-Miss Sinister
-x-
Back to top
View user's profile Send private message Visit poster's website
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Thu Jun 09, 2011 3:17 pm    Post subject: Reply with quote

Hi, and welcome! We're going to need more information to be able to help you. Can you post the script, and describe what you want the result of the script to be? If you are trying to make a character face a certain direction, you need:
Code:
set npc direction ( 3, north )

where 3 is the ID number of the NPC in question. Even this could have problems though if there are more than one copy of NPC 3 on the map. If you are trying to move characters, you need to make sure they have non-zero speed in custom, and also that there are no walls or other NPCs in the way.

If you just want to DETERMINE the direction someone is facing, you use
Code:
variable ( My_Direction )
My_Direction := get npc direction (3)

This simply stores the direction in the variable named My_Direction and doesn't affect the NPC in question.

But yeah, to really help, we need more info.

PS: Please tell me your user name is a reference to X-Men villain Mr. Sinister.
_________________
My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161

This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com
Back to top
View user's profile Send private message Visit poster's website
miss_sinister




Joined: 09 Jun 2011
Posts: 10
Location: Wales

PostPosted: Thu Jun 09, 2011 3:26 pm    Post subject: Reply with quote

Well spotted, it most certainly IS an X Men reference! Big grin

I've checked the NPC speed, it's set to two, so it's not that. It's a very new game, so the entire script reads:

include, plotscr.hsd
include, bump.hsi

plotscript, new game, begin
suspend player
show text box (7)
wait for text box
set hero direction (me, west)
create npc (2, 9, 20, east)
walk npc (2, east, 4)
end

As you can see, I'm only the middle of setting up the introduction, I have my graphics, maps and even some basic attacks at the ready. But I've hit this problem right away. I don't recieve any kind of error message when I'm compiling it, I pretty much follow the How To's verbatim...I really can't work it out. I've verifified the NPC ID: she appears, looks the wrong way, and then can't walk because she winds up facing the wall. And no matter how I word it, when I ask my hero to face ANY direction she will only face south.

What I want to happen is: the NPC appears at one end of the map and moves in the direction of the hero/ the hero turns to face this direction.

Thanks for replying,
-Miss Sinister
-x-
Back to top
View user's profile Send private message Visit poster's website
Bob the Hamster
OHRRPGCE Developer




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

PostPosted: Thu Jun 09, 2011 3:49 pm    Post subject: Reply with quote

Code:

include, plotscr.hsd
include, bump.hsi

plotscript, new game, begin
   suspend player
   show text box (7)
   wait for text box
   set hero direction (me, west)
   create npc (2, 9, 20, east)
   walk npc (2, east, 4)
end


Your script looks correct. (except maybe for the lack of a "resume player") Is it possible that there is already another copy of NPC 2 somewhere on the map? If there was, that is the one that would be moved, not the new one creaded with your "create NPC" command.

If you could post a screenshot showing where the NPC appears, that might help us understand even better.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
miss_sinister




Joined: 09 Jun 2011
Posts: 10
Location: Wales

PostPosted: Thu Jun 09, 2011 3:59 pm    Post subject: Reply with quote

No way, the man himself! (Wayne's World 'We're not worthy!' moment Big grin )

There is only one NPC placed on the map, NPC 1, so it isn't that...I'm really not sure how to proceed. As you noticed, it is lacking a 'resume player' command, I like to test scripts piece by tedious piece ( Big grin ) , and I dropped everything when I noticed my commands had gone wrong somewhere.

Thank you for your time,
-Miss Sinister
-x-
Back to top
View user's profile Send private message Visit poster's website
Bob the Hamster
OHRRPGCE Developer




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

PostPosted: Thu Jun 09, 2011 4:41 pm    Post subject: Reply with quote

Hmmm... What do the walls look at 9, 20 on the map?

You mention that the NPC faces the wrong way, west, instead of east, correct?

Do you have any zones on the map, and is NPC 2 configured to be limited to a specific zone?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
miss_sinister




Joined: 09 Jun 2011
Posts: 10
Location: Wales

PostPosted: Thu Jun 09, 2011 4:49 pm    Post subject: Reply with quote

No I haven't gotten as far as zones yet. All I have is a basic map, the walkable area is a basic 2x2 corridor, and no matter which direction I want a character to go, if I use script commands they just turn south, straight into the wall Sad... The NPC isn't configured to do anything, there aren't even text boxes or tags linked to her. As I've mentioned, all I have done with her is create her in the map menu and set her speed, she isn't even placed yet (hence create NPC).
If you need any more info, no problem.
Thanks again.
-Miss Sinister
-x-
Back to top
View user's profile Send private message Visit poster's website
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Thu Jun 09, 2011 6:18 pm    Post subject: Reply with quote

Have you ever opened plotscr.hsd? Could there be a chance you accidentally changed something in there? It might help to redownload this file, just to be sure.

Also, you do not have any global variables defined with names like "east" or anything like that?

There are no invisible NPCs near the created NPC?

You say the NPC isn't configured to do anything else, but a suspend NPCs command (and resume afterwards) might be helpful.

It might also be helpful to type in
Code:
show value (east)

and let us know what appears in the bottom corner of the screen.

EDIT:
I don't think this can matter, but is your hero in the first slot in the catapillar party (has there been any swapping of characters before this that might have left your hero in slot 1 instead of slot 0)?

Also, Mr. Sinister was the best. I like that he totally just had his own thing going on, and would pop up in the middle of other storylines.
_________________
My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161

This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com
Back to top
View user's profile Send private message Visit poster's website
miss_sinister




Joined: 09 Jun 2011
Posts: 10
Location: Wales

PostPosted: Thu Jun 09, 2011 6:31 pm    Post subject: Reply with quote

Oh no, I'm not at the 'tinkering with plotscr.hsd' level quite yet! Happy Although I've used the program a lot, I literally started making the game yesterday, I haven't even looked at variables yet.

I tried the show value command for east, the number it showed was one. I have no idea whether that's right.

Caterpillar party IS enabled, but there are no changes to the party until AFTER the introductory script.

Thank you again Happy
-Miss Sinister
-x-

PS: Best. Villain. Ever.
Back to top
View user's profile Send private message Visit poster's website
mswguest
Guest






PostPosted: Thu Jun 09, 2011 7:20 pm    Post subject: Reply with quote

Other possibilities:

How is this script called?
Are there any other scripts in the game?
Does it make a difference to put a wait for npc command at the end of the script?
Back to top
miss_sinister




Joined: 09 Jun 2011
Posts: 10
Location: Wales

PostPosted: Thu Jun 09, 2011 7:31 pm    Post subject: Reply with quote

OH MY GOD!!! So simple...so brilliant! Wait for NPC....

I'm a little red in the face now lol! Thank you so so much, that seems to have straightened everything out. I don't know how, but both my hero and NPC now face the correct directions, I've tested it with each direction and they're responding fine.

Thanks again,
-Miss Sinister
(hanging her head in shame)
_________________
"Your mind is like a parachute- it doesn't work when it's closed" - Frank Zappa
Back to top
View user's profile Send private message Visit poster's website
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Thu Jun 09, 2011 7:44 pm    Post subject: Reply with quote

Good to hear! (PS: Welcome!)
Wait for NPC? If this fixed things, then it means that there is another script happening afterwards (prehaps a map autorun script or something like that) which is interfering with your NPC/hero.

I plan to add a log showing which scripts are triggered/run and why, I hope that will help to solve these kinds of problems (which are pretty common, I make this kind of mistake often).
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
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