 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
Fenrir-Lunaris WUT

Joined: 03 Feb 2003 Posts: 1747
|
Posted: Mon Jun 02, 2008 11:34 pm Post subject: Script explosion! |
|
|
Okay, I know I'm missing SOMETHING in my scripts, but I've written it in so many ways I'm not sure what exactly is going wrong. So rather than simply explain and show the script, I'll even SHOW what happens step by step and see if anyone can nail down what's going wrong.
First we have a simple text box spoken by an NPC. (Note that the NPC is one of the original prototype versions of Frumpy before his final design, but I digress) This textbox links to a script ONLY if Frumpy is in the party...
Code: | script,FrumpyLINGUE,begin
suspend player #Always suspend the player in a script
suspend box advance #Suspend box advances so we can control the flow
suspend caterpillar #Suspend the caterpillar, we're about to do something
swap by position (0, find hero (hero:Frumpy)) #We've got to put Frumpy in the lead now!
wait (2) |
Okay, so far so good, nothing creepy or difficult to work through, and no errors. It may be a bit strung out, but it's readable.
Code: | walk hero to x (me,18) #Unneeded
walk hero to y (me,19) # Not needed either
wait for hero (me) # But JUST in case we HAVE to make sure you're at X18,Y19.
wait (2) # To give it a moment to think
set hero position (1,18,19) # Now put the other heroes in place
set hero position (2,18,19) # One by one, they all join the hero at the same point
set hero position (3,18,19) # Why? So they'll walk out of the leader!
wait (2) #Like in those Final Fantasy games I hear so much about!
set caterpillar mode (on) # Turning this on should make them all appear
wait (2) # And they do, right on schedule |
So there we go, all the heroes then appear right under the leader, all ready and raring to move off him, right?
Code: | walk hero (1,left,1) # hero 1 walks left
walk hero (2,right,1) # hero 2 walks right
walk hero (3,down,1) # hero 3 walks down
wait for hero (1) #Now we wait for them to reach their destination... |
And things SUDDENLY go horribly wrong RIGHT HERE for some reason. You see, the heroes mysteriously vanish right as they reach their intended destination! After popping in and making such a fuss only to disappear again! The next step is a simple text box, nothing special here. And the remainder of the script shouldn't have anything running that would cause the error AFTER it occurs.
So here we are, left watching the remainder of the scene play perfectly, EXCEPT for the fact that the rest of the heroes are missing too! To help test it out, the only two other scripts running in the background are a run on keypress script, and an after battle script (for blue magic purposes)
Code: | script,run,begin
if,begin
key is pressed (key:x)
#change this to choose your own key.
#By default, holding "x" when walking will make you run
end
then,begin
if (hero is walking (me)==false)
then,begin
set hero speed (me,5)
#This basically states that if "x" is held down, you'll move a little faster
if (checktag(tag:SPRINT)==on) then (set hero speed (me,10))
#This line shows that if the stated tag is on, you'll dash faster. This particular tag is set to the
#Brigand's "Is Leader" bitset, so when the brigand is in charge, you'll run quite fast.
if (checktag(tag:DASH)==on) then (set hero speed (me,20))
#This line is like the above lines in that if the tag is on, you'll run at a blazing 20 pixels per tick.
#That's one tile per tick!
end
end
else,begin
#This line states that if the player isn't holding "x", then the hero will only walk normally.
if (hero is walking (me)==false)
then,begin
set hero speed (me,4)
end
end
end |
And the after battle:
Code: | script,afterbattle,begin
#This section will increment the user of the CHicken Knife's accuracy by 1, if they have it equipped.
if (check equipment (me,1) == 118) then ( Add To Stat ((me),stat:Accuracy,1))
if (check equipment (1,1) == 118) then ( Add To Stat ((1),stat:Accuracy,1))
if (check equipment (2,1) == 118) then ( Add To Stat ((2),stat:Accuracy,1))
if (check equipment (3,1) == 118) then ( Add To Stat ((3),stat:Accuracy,1))
#Bluemagic time now, yes?
if (checktag(tag:Photoheal1 == on)) then (teach spell(hero:Renard,atk:Photoheal))
if (checktag(tag:Siphon1 == on)) then (teach spell(hero:Renard,atk:Siphon))
if (checktag(tag:Lifedrain1 == on)) then (teach spell(hero:Renard,atk:Lifedrain))
if (checktag(tag:Crush1 == on)) then (teach spell(hero:Renard,atk:Crush))
if (checktag(tag:Maim1 == on)) then (teach spell(hero:Renard,atk:Maim))
if (checktag(tag:Dissolve1 == on)) then (teach spell(hero:Renard,atk:Dissolve))
if (checktag(tag:Greenfire1 == on)) then (teach spell(hero:Renard,atk:Greenfire))
if (checktag(tag:Purplhaze1 == on)) then (teach spell(hero:Renard,atk:Purplhaze))
if (checktag(tag:Icewave1 == on)) then (teach spell(hero:Renard,atk:Icewave))
if (checktag(tag:Explode1 == on)) then (teach spell(hero:Renard,atk:Explode))
if (checktag(tag:Barrier1 == on)) then (teach spell(hero:Renard,atk:Barrier))
if (checktag(tag:Supernova1 == on)) then (teach spell(hero:Renard,atk:Supernova))
end |
And lastly, the gdebug text
Code: | Playing game Viking.RPG ( ) 06-03-2008 02:08:53
WANTIMMEDIATE BUG
run terminated, setting wantimmediate on frumpylingue
wantimmediate would have skipped wait on command 1 in frumpylingue, state = 1
needf = 0 |
So, any thoughts? |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Tue Jun 03, 2008 6:17 am Post subject: |
|
|
Isn't that an engine bug? '' . bug_title('430') . ''
Anyway, post the (harmless?) rest of the script just in case. _________________
|
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Jun 03, 2008 6:54 am Post subject: |
|
|
The part where the heroes vanish does sound like an engine bug. What build are you testing with? Does this still happen with the latest nightlies? TMC and Mike have both recently fixed a lot of the sprite loading code, so if you are using an older build, I can imagine that you are seeing some sort of evil interaction between the sprite loading code and the not-very-well-tested intricacies of turning caterpillar mode off and on.
And although g_debug.txt references '' . bug_title('430') . '' I think that is just a harmless warning, that may not be related to the actual problem here. |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Fri Jul 11, 2008 7:54 am Post subject: |
|
|
I am pretty sure I can solve this one if somebody will send me a .SAV file located right before the Cleric. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Jul 11, 2008 11:31 pm Post subject: |
|
|
Fenrir, we need a copy of the game. The version in SVN has a completely different script of the same name.
BTW. your afterbattle script is completely broken.
Code: | if (checktag(tag:Photoheal1 == on)) then (teach spell(hero:Renard,atk:Photoheal)) |
should be
Code: | if (checktag(tag:Photoheal1)) then (teach spell(hero:Renard,atk:Photoheal)) |
_________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sun Jul 13, 2008 7:23 am Post subject: |
|
|
I tried to reproduce it but couldn't; besides, it would seem like the problem happens in the part of the script immediately after what you posted. If you don't have anything further to go on, like the original script, we're just going to have to forget this. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Fenrir-Lunaris WUT

Joined: 03 Feb 2003 Posts: 1747
|
Posted: Sun Jul 13, 2008 11:50 am Post subject: |
|
|
Code: | script,FrumpyLINGUE,begin
suspend player #Always suspend the player in a script
suspend box advance #Suspend box advances so we can control the flow
suspend caterpillar #Suspend the caterpillar, we're about to do something
swap by position (0, find hero (hero:Frumpy)) #We've got to put Frumpy in the lead now!
walk hero to x (me,18) #Unneeded
walk hero to y (me,19) # Not needed either
wait for hero (me) # But JUST in case we HAVE to make sure you're at X18,Y19.
wait (2) # To give it a moment to think
set hero position (1,18,19) # Now put the other heroes in place
set hero position (2,18,19) # One by one, they all join the hero at the same point
set hero position (3,18,19) # Why? So they'll walk out of the leader!
wait (2) #Like in those Final Fantasy games I hear so much about!
set caterpillar mode (on) # Turning this on should make them all appear
wait (2) # And they do, right on schedule
walk hero (1,left,1) # hero 1 walks left
walk hero (2,right,1) # hero 2 walks right
walk hero (3,down,1) # hero 3 walks down
wait for hero (1) #Now we wait for them to reach their destination...
set hero direction (1,up)
set hero direction (2,up)
set hero direction (3,up)
wait (1)
wait (3)
set hero frame (me,1)
wait (1)
set hero frame (me,0)
wait (1)
set hero frame (me,1)
wait (1)
set hero frame (me,0)
wait (1)
show text box (1306)
wait (7)
wait for key (use key)
advance text box
show text box (1307)
wait (7)
wait for key (use key)
advance text box
Variable (var1)
Variable (var2)
#This next script part was originally done by Mad Cacti.
#Truthfully, I have no idea what's going on here.
#Seriously. But you should always try to indicate to the player that something BIG is coming.
wait (3)
#The new boss fight effect!
show text box (1361)
tweak palette (30,-10,-10)
fade screen in
play sound (sfx:WARNING,false,true)
wait (10)
reset palette
fade screen in
advance textbox
For (var1,0,2,1)
Do(for(var2,0,255,1)
Do(Write color (var2,var1,63--read color (var2,var1))))
Fade screen in
wait (1)
reset palette
#After the nifty color inverting takes place, we've got a battle to fight!
fight formation (158)
set hero frame (me,1)
wait (1)
set hero frame (me,0)
wait (1)
set hero frame (me,1)
wait (1)
set hero frame (me,0)
wait (1)
show text box (1308)
wait (7)
wait for key (use key)
advance text box
show text box (1309)
wait (7)
wait for key (use key)
advance text box
tweak palette (0,0,10)
update palette
play sound (sfx:Menu8Bit,false,true)
teach spell ((find hero(hero:Frumpy)),atk:Lingue)
wait (10)
reset palette
fade screen in
show text box (1310)
wait (7)
wait for key (use key)
advance text box
fade screen out (63,63,63)
wait (1)
set tag (tag:Frumling,on)
wait (1)
resume box advance
wait (2)
resume caterpillar
set caterpillar mode (off)
wait (1)
fade screen in
wait (2)
resume player
end
|
That was the original code. It also occurred in most of the other scripts in that same map, which doesn't make sense. I've since given up on trying to make the heroes walk out of the main character for that particular scene since it actually isn't needed for the scene. Only for aesthetic purposes.
I'll have a re-upload of the entire game and current scripts tonight, to try and fix the file size issue that cropped up. I still can't figure out why it was different. Hm. |
|
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
|