 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
Silveroria

Joined: 17 Jun 2011 Posts: 14
|
Posted: Thu Jul 28, 2011 1:23 pm Post subject: something not working |
|
|
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 |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Thu Jul 28, 2011 2:00 pm Post subject: |
|
|
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 |
|
 |
Silveroria

Joined: 17 Jun 2011 Posts: 14
|
Posted: Thu Jul 28, 2011 3:18 pm Post subject: |
|
|
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 |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Jul 28, 2011 4:04 pm Post subject: |
|
|
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 |
|
 |
Silveroria

Joined: 17 Jun 2011 Posts: 14
|
Posted: Thu Jul 28, 2011 5:59 pm Post subject: |
|
|
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 |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Jul 29, 2011 2:52 am Post subject: |
|
|
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 |
|
 |
Silveroria

Joined: 17 Jun 2011 Posts: 14
|
Posted: Fri Jul 29, 2011 11:06 am Post subject: |
|
|
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 |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Fri Jul 29, 2011 11:56 am Post subject: |
|
|
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 |
|
 |
Silveroria

Joined: 17 Jun 2011 Posts: 14
|
Posted: Fri Jul 29, 2011 1:53 pm Post subject: |
|
|
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  _________________ Oria Productions
www.oria.ca |
|
Back to top |
|
 |
|
|
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
|