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

something not working

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




Joined: 17 Jun 2011
Posts: 14

PostPosted: Thu Jul 28, 2011 1:23 pm    Post subject: something not working Reply with quote

So I just made a couple scripts for my game.

The first one I really dont know where the error is. Its a script near the beginning of the game. You grab the party members, one of which sets on a tag with one of the txt boxes; (tag:2). Then tag 2 makes an invisible (walk-on activation) NPC appear. When you walk on it, it triggers the script.

Code:
include, plotscr.hsd
include, Wars of Hordinia.hsi

#----------------------------------------------
#intro battle in Galoa

Plotscript, goblin, begin
  suspend player
  suspend NPCs
  set hero direction (down)
  Play song (2)
  pan camera (south,2)
  wait for camera
  create NPC (8,21,30,up)
  Walk NPC (8,up,2)
  Wait for NPC (8)
  Show text box (22)
  wait for text box
  Show text box (23)
  wait for text box
  Show text box (24)
  wait for text box
  wait (10)
  walk NPC (8,up,3)
  Wait for NPC (8)
  wait (10)
  resume player
  resume NPCs
  camera follows hero
  fight formation (5)
end



The scripts starts fine. Song #2 starts, the camera pans down properly and the NPC appears properly. Now the problem is that the NPC does not move up. The txt boxes appear normaly and the fight starts normaly though. Basically everything works as plan except for the NPC movement.

Heres a screenshot:


Also, NPC 8 is unique when created on that map and his speed is set at 1. There are no walls, doors, etc in between the hero and the monster.

-------------------------------------------------------------------------------------

For the second script its simple, its just not complete

I'm trying to have tag 3 turn on when the player goes on Zone 1. And off when he goes off the zone. I can't find enough information in the plotscript dictionnary to make this work (or I dont understand that given information).

This is so i can have an item that can only be use on the main world map. preferably in specific areas. (its an item that is similar to the "Tent" from the FF series)

Heres what i have so far:


Code:
include, plotscr.hsd
include, Wars of Hordinia.hsi
 
#-----------------------------------------------------
#autorun script to run on Main map for Camping zone.

plotscript, zone1, begin
  If (zone1) then (set tag (3, ON))
end


thanks in advance
_________________
Oria Productions
www.oria.ca
Back to top
View user's profile Send private message Send e-mail
Bob the Hamster
OHRRPGCE Developer




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

PostPosted: Thu Jul 28, 2011 2:00 pm    Post subject: Reply with quote

For the first script, make sure that NPC 8 is not restricted to any zones.

For the second script, you want something like this:

Code:

plotscript, zone check each step, begin
  if (read zone(1, hero x(me), hero y(me)))
     then (set tag (3, ON))
     else (set tag (3, OFF))
end


Note that this needs to be an each-step script if you want it to update each time you take a step on the map. If you do it as a map autorun script, it will only update once for the tile you happen to be standing on when the map first loads.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Silveroria




Joined: 17 Jun 2011
Posts: 14

PostPosted: Thu Jul 28, 2011 3:18 pm    Post subject: Reply with quote

Awesome on the zone script. That works perfectly, my camping item spawns an INN whenever used inside Zone 1.

Thank you!

The other script for the Goblin attacking the town, Is still had the same issue.
There are no zones on this map.

Heres my settings for that NPC


_________________
Oria Productions
www.oria.ca
Back to top
View user's profile Send private message Send e-mail
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Thu Jul 28, 2011 4:04 pm    Post subject: Reply with quote

Is there an invisble NPC above that NPC, blocking it? BTW, you can press Ctrl+F11 in-game to see all NPCs (the top number is the negated NPC reference,the bottom number is the ID). Note that NPCs can walk over other NPCs only as long as they are disabled by a tag (these are shown with a negative reference number in the NPC debugger.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Silveroria




Joined: 17 Jun 2011
Posts: 14

PostPosted: Thu Jul 28, 2011 5:59 pm    Post subject: Reply with quote

there is one invisible NPC actualy. He is the one the hero steps on to trigger the script. He ends up under the Hero, so I didnt think he would block the other one. Could that be the problem and if so, should i make an extra line in the beginning of the script to delete him?
_________________
Oria Productions
www.oria.ca
Back to top
View user's profile Send private message Send e-mail
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Fri Jul 29, 2011 2:52 am    Post subject: Reply with quote

No, that wouldn't be a problem.

Double check that there are really are no walls in the way, and that there really is no copy of NPC 8 on the map -- not placed in Custom, nor created by any other script. Try creating the NPC facing downwards instead of up. If it turns up, then there's some kind of wall in the way, if it doesn't, then there's another copy of NPC 8 on the map. If that's not the case, then I can't think of any other possible explanation, and it's an engine bug.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Silveroria




Joined: 17 Jun 2011
Posts: 14

PostPosted: Fri Jul 29, 2011 11:06 am    Post subject: Reply with quote

oh I feel like an idiot... Yeah it was a dulpicate NPC. When I first made the map, I made NPC number 8 to test something. then I deleted him (well reseted all the stats on the NPC data), but didn't remove him from the map.

That sort of reminds me of the invisible NPC in FF1.
_________________
Oria Productions
www.oria.ca
Back to top
View user's profile Send private message Send e-mail
Bob the Hamster
OHRRPGCE Developer




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

PostPosted: Fri Jul 29, 2011 11:56 am    Post subject: Reply with quote

There is a good way to avoid the problem of multiple copies, and that is to use NPC references.

Code:

Plotscript, goblin, begin
  variable(ref)
  suspend player
  suspend NPCs
  set hero direction (down)
  Play song (2)
  pan camera (south,2)
  wait for camera
  ref := create NPC (8,21,30,up)
  Walk NPC (ref,up,2)
  Wait for NPC (ref)
  Show text box (22)
  wait for text box
  Show text box (23)
  wait for text box
  Show text box (24)
  wait for text box
  wait (10)
  walk NPC (ref,up,3)
  Wait for NPC (ref)
  wait (10)
  resume player
  resume NPCs
  camera follows hero
  fight formation (5)
end


The "create NPC" command returns an NPC reference that you can store in a variable. This reference will point to the specific copy of the NPC you created, no matter how many other copies of NPC 8 might exist on the map.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Silveroria




Joined: 17 Jun 2011
Posts: 14

PostPosted: Fri Jul 29, 2011 1:53 pm    Post subject: Reply with quote

thats good to know actualy. Was planning on doing some sort of invasion later on with a lot of the same NPCs on one map.

Thanks a bunch Happy
_________________
Oria Productions
www.oria.ca
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