 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Tue Nov 29, 2005 10:08 am Post subject: New problem, music related, may be plotscripting related... |
|
|
I have an 'instead of battle' script that runs on my outworld map to do various things. Trouble occurs when running away from battles. If I run away normally, it is fine. But if my characters are in a vehicle (it is a boat), then after running away there is an extra blank screen before returning to where I was, and while this screen is up the normal overworld song is playing, and then it switches to the boat music once I press ESC to get rid of the blank screen and get back to my boat. Any ideas as to why this happens? |
|
Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Tue Nov 29, 2005 1:53 pm Post subject: |
|
|
Okay, I don't have the script with me now (and I don't have the internet at home), so I'll try to sum it up to see if that helps. If this is not enough, let me know and I will save my script on a disk and bring it to an internet computer next time I have a chance.
Basically, the 'instead of battle' script goes like this:
1. suspend players, npcs, random enemies [suspend commands only]
2. next, go through the heroes teaching them certain spells depending on what level they are on (this is a workaround so that players don't know what they can get in certain random spell lists) [declares and uses local variables, nested if statements, plenty of 'get hero level' commands and teaching of spells, no waits]
3. next, 'fight formation (the argument passed to it, which is the formation number of the enemy as usual)'
4. next, go through and make certain heroes forget certain spells, ones that can only be used outside [uses same commands as number 2]
POTENTIAL PROBLEM SPOT
5. next, check to see if player is in boat, and if so, stop the current song. Then check to see if they have upgraded the boat, and if so, play a song for the upgraded boat. If not, play the song for the regular boat. [uses if checks, accesses tags, one of which is the tag assigned to the boat vehicle NPC, and the stop song and play song commands]
6. next, call the script MainMapAuto, which is usually the autorun script for the outside map. I'll discuss this one below.
7. resume players, NPCs, random enemies [uses only resume commands]
Okay, about MainMapauto from number 6, this is a pretty complicated script that is used for a number of purposes. I can't remember offhand what order these things occur in, but here goes what happens in MainMapAuto:
1. 'update' the map based on things the player has done [uses if checks, tags, and map tweaking commands only]
2. check to see if the hero has just entered the map from a town where they had just saved, and if so, record the position of the boat (this is to replace the boat if the player dies, because I have a custom death system; this block of code should never run after a battle, but I need to double check this) [uses if checks, accesses and alters global variables and tags]
3. another block of code that I am sure is never run coming from a battle, placing the boat where it was last dismounted
I am almost certain that there are absolutely no 'wait' commands anywhere in any of that code. Another helpful fact might be that my boat vehicle has a mounting script, which stops the current song and plays one of the two boat songs depending on whether you've upgraded the boat or not.
I'm pretty sure that that is everything, but I will look into it more when I get home. Any input you guys might have is certainly appreciated. |
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Tue Nov 29, 2005 5:15 pm Post subject: |
|
|
Okay, I had a chance to look at the scripts again, and there were a couple of mistakes. First of all, I do not have any commands to suspend anything. Second, the potential bad section where the boat music is played (number 5) is actually part of the MainMapAuto script, so it occurs when that script is called (and it is the first thing to happen in that script). I also looked for any wait commands and there were indeed none.
Secondly, I don't know if I made it clear enough before that this only happens when the player successfully RUNS AWAY from a battle WHILE IN A VEHICLE. The screen goes blank (like a fade screen out command), and the game does not come back until the player presses ESC (no other keys seem to work, but I didn't sit and try them all; certainly the SPACE BAR and the ARROWS don't work). |
|
Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Tue Nov 29, 2005 10:34 pm Post subject: |
|
|
Hmm, do you have a game-over script?
Anyway, while I was reading your first post, I was gonna suggest saving the current music in a variable (current song), and just playing it after the battle. However...
I'm still a bit confused as to the order things happen in. MainMapAuto is what kind of script? And, if possible, I'd like to look at the scripts themselves. You can PM me, if you don't want to post them here. _________________ I stand corrected. No rivers ran blood today. At least, none that were caused by us.
Final Fantasy Q
OHR Developer BLOG
Official OHRRPGCE Wiki and FAQ |
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Wed Nov 30, 2005 8:10 am Post subject: |
|
|
Okay, first the script MnMpBattle. This script is set as the 'instead of battle' script in custom for the main map:
Code: | script,MnMpBattle,enemy,begin
variable(Dlevel)
if(10<<getherolevel(findhero(hero:Xa))),then
begin
teachspell(findhero(hero:Xa),atk:SnowCard)
end
Dlevel:=getherolevel(findhero(hero:Dalis))
if(10<<Dlevel),then
begin
teachspell(findhero(hero:Dalis),atk:EagleSeed)
if(17<<Dlevel),then
begin
teachspell(findhero(hero:Dalis),atk:Story)
if(19<<Dlevel),then
begin
teachspell(findhero(hero:Dalis),atk:MusicBox)
if(24<<Dlevel),then
begin
teachspell(findhero(hero:Dalis),atk:WarHorn)
end
end
end
end
if(checktag(tag:defeatedEmperor)==true),then
begin
if(enemy>=151,and,enemy<=157),then
begin
decrement(enemy,7)
end
end
settag(tag:Dead,false)
fight formation(enemy)
forgetspell(findhero(hero:Dalis),atk:EagleSeed)
if(checktag(tag:dead)==false),then (MnMpAuto(-1))
end |
Okay, next I'll post MnMpAuto. This script is set as the 'autorun' script for the main map in custom, but I've discovered that autoruns do not run after battles, so I also call it after every battle, because it does important things to the map:
Code: | script, MnMpAuto,battle, begin
if(checktag(tag:Boat)==on),then
begin
stopsong
if(checktag(tag:FastBoat)==on),then
begin
playsong(song:FastBoat)
end
else
begin
playsong(song:Boat1)
end
end
if(checktag(tag:Part6)==on),then
begin
write map block(41,60,27)
write pass block(41,60,1+4)
settag(tag:foundCrypt,off)
end
if(checktag(tag:BeatLassia)==on),then
begin
write map block(192,104,27)
write pass block(192,104,1+4)
end
if(checktag(tag:DstryWMtBase)==on),then
begin
writemapblock(148,68,59)
end
if(checktag(tag:DefeatedEmperor)==on),then
begin
writemapblock(154,31,60)
writemapblock(155,31,61)
writemapblock(165,67,62)
writemapblock(166,67,63)
writemapblock(165,66,0)
writemapblock(166,66,0)
end
if(checktag(tag:SavedErdrick)==on),then
begin
writemapblock(197,131,60)
writemapblock(198,131,61)
end
if((checktag(tag:Boat)==on),and,(battle<>-1)),then
begin
if(checktag(tag:BoatSave)==on),then
begin
SvBtX:=BoatX
SvBtY:=BoatY
settag(tag:BoatSave,off)
end
createnpc(20,BoatX,BoatY)
end
end |
I do have a 'gameover' script, which I assumed only got called when you died, NOT when you ran away. I will post that next:
Code: | script,Death1,begin
suspend player
suspend npcs
settag(tag:Dead,on)
wait(1)
fadescreenout(63,0,0)
wait(1)
fadescreenout(0,0,0)
if(SvMap>>0),then
begin
waitforall
end
if(SvMap==-1),then #This is for ending of Part4
begin
deletehero(hero:Cerandin)
swapinhero(hero:Matheis)
SvMap:=17
SvX:=47
SvY:=50
end
if(SvMap==-2),then #This is for dying while saving Kahn
begin
swapouthero(hero:Kahn)
lockhero(hero:Kahn)
settag(tag:SavedKahn,off)
SvMap:=OldSM
end
if(SvMap==-3),then #This is for dying in West Mt. Base
begin
settag(tag:BeatWMBguards,false)
settag(tag:BeatWMBComm,false)
if(checktag(tag:settimebomb)==true),then
begin
settag(tag:settimebomb,false)
getitem(item:TimedBmb)
end
SvMap:=OldSM
end
if(SvMap==-4),then #This is for Ma&Mo East Mt. Base
begin
swapbyname(hero:Ma,P1Hero0)
swapbyname(hero:Mo,P1Hero1)
swapinhero(P1Hero2)
swapinhero(P1Hero3)
lockhero(hero:Erdrick)
SvMap:=OldSM
end
variable(money,counter)
money:=(PayAll/2)
getmoney(money)
for(counter,0,3),do
begin
setherostat(counter,stat:HP,getherostat(counter,stat:HP,maximumstat)/2)
setherostat(counter,stat:SP,getherostat(counter,stat:SP,maximumstat)/2)
end
teleporttomap(SvMap,SvX,SvY)
BoatX:=SvBtX
BoatY:=SvBtY
waitforhero(me)
setherodirection(me,north)
wait(8)
fadescreenin
resume npcs
resume player
resume randomenemys
end |
In that script, PayAll is an autonumber script that clears the hero's money and returns how much they had. The various if(svmap==-#) blocks are for special scenarios when just sending the player back to where they were could cause a problem.
I'm also going to post the mounting script for the vehicle in question, because I have a hunch that the problem lies in what happens in game.exe after you run from a battle while you were on a vehicle. I am guessing that it does NOT immediately place you back in the vehicle, but instead somehow waits before remounting the vehicle (this is only the slightest guess, borne out of the fact that the regular outworld music plays until the player hits ESC to get out of the blank screen that occurs after running, but not after winning or after using the F4 debugging key):
Code: | script,BoatMount,begin
stopsong
if(checktag(tag:FastBoat)==true),then
begin
alternpc(20,npcstat:MoveSpeed,10)
playsong(song:FastBoat)
end
else
begin
playsong(song:Boat1)
end
end |
I think that these are all the relevant scripts. I hope that this helps solve the problem. |
|
Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Wed Nov 30, 2005 9:22 am Post subject: |
|
|
Well, everything looks fine to me... I'll do some tests to see if the condition really IS running away while mounted.
Edit: Well, it's not running away on-board byitself. I'll try plotscriptin' it up, and see what happens... Try running the Absolute latest version of game, and see if it still happens. _________________ I stand corrected. No rivers ran blood today. At least, none that were caused by us.
Final Fantasy Q
OHR Developer BLOG
Official OHRRPGCE Wiki and FAQ |
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Sun Dec 11, 2005 9:54 am Post subject: |
|
|
Has there been any more news on this? I won't get a chance to try downloading the 'latest version' and trying it with game for a while, possibly until Christmas (although maybe this coming weekend). |
|
Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Mon Dec 12, 2005 11:31 am Post subject: |
|
|
I'm not sure that this matters at all, but there is a separate song playing during the battle, but there is no song set as a victory music.
Also, I'm pretty sure the boat is vehicle zero, and is set as NPC 20. |
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Wed Dec 21, 2005 11:40 am Post subject: |
|
|
Same problem with the latest version. I tried some more buttons, nothing seems to work to get out of the blank screen except for ESC. When trying to reproduce this, make sure you let go of ESC before your characters reach the edge of the screen. One time this bug did NOT happen, but I may have left my finger on the ESC key just long enough for it to count as cancelling out the black screen. |
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Thu Jan 05, 2006 10:57 am Post subject: |
|
|
Well, has anyone gotten anything? Would it be helpful for me to send my .sav file with my game, so that you could try it for yourself when the bug does happen? Or might this be a lost cause? |
|
Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot 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
|