|
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
PK-Gamer Currently making an RPG
Joined: 11 Jan 2013 Posts: 23 Location: MD
|
Posted: Sat Sep 14, 2013 2:54 pm Post subject: A couple of problems. |
|
|
Hi all,
I'm having a couple of problems with plotscripting. The first problem is, I have a NPC to move automatically in a room but when I exit the room there is a script error since the NPC doesn't exist in the new room. What can I do to fix this?
My second problem is that I'm trying to make the screen shake like an
earthquake however the pancamera method doesn't work for some reason.
The room I use the plotscript is 16x10. Could it be that my plotscript is wrong. Here is the actual plotscript.
plotscript,DiscoverSecret,begin
suspend player
suspend box advance
suspend npcs
skippable waits := false
camera follows hero(me)
advance text box
show text box(1570)
skippable wait(60)
advance text box
show text box(1571)
skippable wait(60)
advance text box
walk hero(me,north,1)
wait for hero(me)
advance text box
show text box(1572)
skippable wait(70)
advance text box
show text box(1573)
skippable wait(80)
advance text box
show text box(1574)
skippable wait(80)
advance text box
stop song
play sound(sfx:DragonCoin)
skippable wait(60)
play sound(sfx:earthquake, true, true)
pancamera(up,1,20),waitforcamera
pancamera(down,2,20),waitforcamera
pancamera(up,2,20),waitforcamera
pancamera(down,1,20),waitforcamera
pancamera(up,1,20),waitforcamera
pancamera(down,2,20),waitforcamera
pancamera(up,2,20),waitforcamera
pancamera(down,1,20),waitforcamera
pancamera(up,1,20),waitforcamera
pancamera(down,2,20),waitforcamera
show text box(1575)
pancamera(up,2,20),waitforcamera
pancamera(down,1,20),waitforcamera
pancamera(up,1,20),waitforcamera
pancamera(down,2,20),waitforcamera
pancamera(up,2,20),waitforcamera
pancamera(down,1,20),waitforcamera
pancamera(up,1,20),waitforcamera
pancamera(down,2,20),waitforcamera
pancamera(up,2,20),waitforcamera
pancamera(down,1,20),waitforcamera
pancamera(up,1,20),waitforcamera
pancamera(down,2,20),waitforcamera
pancamera(up,2,20),waitforcamera
pancamera(down,1,20),waitforcamera
pancamera(up,1,20),waitforcamera
pancamera(down,2,20),waitforcamera
pancamera(up,2,20),waitforcamera
pancamera(down,1,20),waitforcamera
pancamera(up,1,20),waitforcamera
pancamera(down,2,20),waitforcamera
pancamera(up,2,20),waitforcamera
pancamera(down,1,20),waitforcamera
pancamera(up,1,20),waitforcamera
pancamera(down,2,20),waitforcamera
pancamera(up,2,20),waitforcamera
pancamera(down,1,20),waitforcamera
pancamera(up,1,20),waitforcamera
pancamera(down,2,20),waitforcamera
pancamera(up,2,20),waitforcamera
pancamera(down,1,20),waitforcamera
pancamera(up,1,20),waitforcamera
pancamera(down,2,20),waitforcamera
pancamera(up,2,20),waitforcamera
pancamera(down,1,20),waitforcamera
pancamera(up,1,20),waitforcamera
pancamera(down,2,20),waitforcamera
pancamera(up,2,20),waitforcamera
pancamera(down,1,20),waitforcamera
pancamera(up,1,20),waitforcamera
pancamera(down,2,20),waitforcamera
pancamera(up,2,20),waitforcamera
pancamera(down,1,20),waitforcamera
pancamera(up,1,20),waitforcamera
pancamera(down,2,20),waitforcamera
pancamera(up,2,20),waitforcamera
pancamera(down,1,20),waitforcamera
pancamera(up,1,20),waitforcamera
pancamera(down,2,20),waitforcamera
pancamera(up,2,20),waitforcamera
pancamera(down,1,20),waitforcamera
pancamera(up,1,20),waitforcamera
pancamera(down,2,20),waitforcamera
pancamera(up,2,20),waitforcamera
pancamera(down,1,20),waitforcamera
pancamera(up,1,20),waitforcamera
pancamera(down,2,20),waitforcamera
pancamera(up,2,20),waitforcamera
pancamera(down,1,20),waitforcamera
advance text box
camera follows hero(me)
stop sound(sfx:earthquake)
use door(3)
stop song
skippable wait(50)
advance text box
show text box(1576)
skippable wait(70)
advance text box
show text box(1577)
skippable wait(70)
advance text box
show text box(1578)
skippable wait(70)
advance text box
delete item(item:³Hydrabi)
play song(get ambient music)
set tag(tag:SecretSpotCheck,on)
set tag(tag:SecretSpotBoss,on)
set tag(tag:SecretSpot,off)
resume box advance
resume player
resume npcs
end |
|
Back to top |
|
|
Bob the Hamster OHRRPGCE Developer
Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Sat Sep 14, 2013 3:01 pm Post subject: |
|
|
Hello, PK-Gamer!
For your first issue, you could have the script check the "current map" command and exit if the map number has changed.
Code: |
if(current map <> 3) then(exit script)
|
For the second issue, the camera will not be able to move if the map is 16x10 tiles, unless you change the map edge mode to "default tile" or "wrap" instead of "crop"
If your map edge mode is "default tile" and the "pan camera" command still is not working correctly, please let me know. I recently fixed a bug in the "focus camera" command that prevented it from working close to the edge of a map. I don't think that same bug would affect "pan camera" but I didn't test it. |
|
Back to top |
|
|
PK-Gamer Currently making an RPG
Joined: 11 Jan 2013 Posts: 23 Location: MD
|
Posted: Mon Sep 16, 2013 7:27 am Post subject: |
|
|
Thank you, Bob!
However, I wanted the NPC to continue moving in a certain pattern when
the player is in the room. I basically had a while statement with what I want the NPC to do. When I exit the room and go to another, it gives me an error since the script is in a loop.
Here is my code...
plotscript,dockNPCs,begin
if(current map <> 89)
then,begin
exit script
end,else,begin
while(NPC is walking(16)==false)
do,begin
set NPC direction(15,east)
walk NPC(16,west,2)
wait for NPC(16)
walk NPC(16,south,2)
wait for NPC(16)
walk NPC(16,east,2)
wait for NPC(16)
walk NPC(16,north,2)
wait for NPC(16)
end
end
end
See, I want NPC 16 to continue doing the movement until the player leaves the room that NPC 16 is in. |
|
Back to top |
|
|
Bob the Hamster OHRRPGCE Developer
Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Mon Sep 16, 2013 11:16 am Post subject: |
|
|
You will have to check the map number before each npc command
Code: |
plotscript,dockNPCs,begin
while(NPC is walking(16)==false)
do,begin
if(current map <> 89) then(exit script)
set NPC direction(15,east)
if(current map <> 89) then(exit script)
walk NPC(16,west,2)
if(current map <> 89) then(exit script)
wait for NPC(16)
if(current map <> 89) then(exit script)
walk NPC(16,south,2)
if(current map <> 89) then(exit script)
wait for NPC(16)
if(current map <> 89) then(exit script)
walk NPC(16,east,2)
if(current map <> 89) then(exit script)
wait for NPC(16)
if(current map <> 89) then(exit script)
walk NPC(16,north,2)
if(current map <> 89) then(exit script)
wait for NPC(16)
if(current map <> 89) then(exit script)
end
end
|
However, there might be an easier way to do this. You just want NPC 16 to walk in a small circle, right?
In the map editor, go to "Edit Zones" and define zone 1 to cover just the tiles where NPC 16 is allowed to walk.
Then go to "Edit NPCs" and edit NPC 16. Change "Movement zone" to 1, and change "Move Type" to left turns.
Now he will walk in circles inside that zone. The zone will be invisible when you play, and it will not block the hero from walking through it. |
|
Back to top |
|
|
PK-Gamer Currently making an RPG
Joined: 11 Jan 2013 Posts: 23 Location: MD
|
Posted: Mon Sep 16, 2013 1:05 pm Post subject: |
|
|
Thanks again, Bob! I appreciate it! The edit zone tactic worked. |
|
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
|