Post new topic    
King Slime
Send private message
Scripting Fail 
 PostThu Aug 11, 2011 3:15 am
Send private message Reply with quote
So, this script I am working on is a bandit attack. It shows three bandits, and a merchant. The hero approaches the area. The bandits all move up, then they go to the hero. Boss warning script, then fight. After the fight is where the problem starts. The textboxes go off, but the movements that go after them also. Then, the movement glitches out, and then a textbox is left on the screen, and the hero cannot move nor adavance the box. Here is the script.

Quote:
#---------------------
plotscript, bandit attack, begin
suspend player
show text box(13)
wait for text box
walk hero to X(me,89)
wait for hero(me)
walk hero to Y(me,6)
wait for hero(me)
wait(15)
show text box(15)
wait for text box
wait(15)
set NPC direction(3,down)
set NPC direction(4,down)
set NPC direction(5,down)
show text box(16)
wait for text box
walk NPC(4,down,1)
wait for NPC(4)
show text box(17)
wait for text box
walk NPC(5,down,1)
wait for NPC(5)
show text box(18)
wait for text box
walk NPC(3,down,1)
wait for NPC(3)
show text box(22)
wait for text box
walk NPC(3,down,2)
walk NPC(4,down,4)
walk NPC(5,down,4)
wait for NPC(5)
wait for NPC(4)
wait for NPC(3)
set NPC direction(4,right)
set NPC direction(5,left)
boss battle
fight formation(1)
walk NPC(3,up,1)
set NPC direction(3,up)
wait for NPC(3)
show text box(23)
wait for text box
walk NPC(4,up,3)
wait for NPC(4)
walk NPC(4,right,1)
wait for NPC(4)
set NPC direction(4,up)
show text box(24)
wait for text box
walk NPC(2,right,2)
walk NPC(3,up,3)
walk NPC(4,up,2)
walk NPC(5,up,6)
wait for NPC(5)
wait for NPC(4)
wait for NPC(3)
wait for NPC(2)
wait(25)
walk NPC(2,left,2)
wait for NPC(2)
walk NPC(2,down,4)
wait for NPC(2)
show text box(25)
wait for text box
walk NPC(2,left,8)
wait for NPC(2)
set tag(2, ON)
resume player
end


Is there anything wrong here that would cause what I said above?
Liquid Metal King Slime
Send private message
 
 PostThu Aug 11, 2011 12:30 pm
Send private message Reply with quote
I believe this is the wait for textbox and suspend player not getting along well issue. Basically, because the player is suspended they can't advance the textbox and so the script continues on anyways instead of waiting forever, like it should.

So you're going to want to move your suspend player command till after your wait for textbox command and then put a resume player command before every wait for textbox command
Metal Slime
Send private message
 
 PostThu Aug 11, 2011 1:19 pm
Send private message Reply with quote
Suspend player does not stop the player from advancing text boxes. More likely there is a hidden problem somewhere else. I'm not noticing anything in that script, but perhaps you should post the script for "boss battle". Also, it might be helpful to know if there is any after-battle scripts on this map, and what they might be trying to do.
I am Srime
Slime Knight
Send private message
 
 PostThu Aug 11, 2011 2:35 pm
Send private message Reply with quote
I learned a long time ago that I should never help people with scripting (because I'm not great myself), but it looks like you're just missing a few "wait for npc" commands.

Also, if you gave the NPCs a move behavior (wander/left turns/etc.), the you will want to add suspend NPCs and resume NPCs to the beginning and end of your script, respectively. (I usually do this out of habit, anyway).

Maybe this will work:

Quote:
plotscript, bandit attack, begin

suspend player
suspend NPCs

show text box(13)
wait for text box

walk hero to X(me,89)
wait for hero(me)
walk hero to Y(me,6)
wait for hero(me)

wait(15)

show text box(15)
wait for text box

wait(15)

set NPC direction(3,down)
set NPC direction(4,down)
set NPC direction(5,down)
wait for npc (3)
wait for npc (4)
wait for npc (5)


show text box(16)
wait for text box

walk NPC(4,down,1)
wait for NPC(4)

show text box(17)
wait for text box

walk NPC(5,down,1)
wait for NPC(5)

show text box(18)
wait for text box

walk NPC(3,down,1)
wait for NPC(3)

show text box(22)
wait for text box

walk NPC(3,down,2)
walk NPC(4,down,4)
walk NPC(5,down,4)
wait for NPC(5)
wait for NPC(4)
wait for NPC(3)

set NPC direction(4,right)
set NPC direction(5,left)
wait for npc (4)
wait for npc (5)


boss battle

fight formation(1)

walk NPC(3,up,1)
wait for npc (3)

set NPC direction(3,up)
wait for NPC(3)

show text box(23)
wait for text box

walk NPC(4,up,3)
wait for NPC(4)

walk NPC(4,right,1)
wait for NPC(4)

set NPC direction(4,up)
wait for npc (4)

show text box(24)
wait for text box

walk NPC(2,right,2)
walk NPC(3,up,3)
walk NPC(4,up,2)
walk NPC(5,up,6)
wait for NPC(5)
wait for NPC(4)
wait for NPC(3)
wait for NPC(2)

wait(25)

walk NPC(2,left,2)
wait for NPC(2)

walk NPC(2,down,4)
wait for NPC(2)

show text box(25)
wait for text box

walk NPC(2,left,8)
wait for NPC(2)

set tag(2, ON)

resume player
resume NPCs

end
King Slime
Send private message
 
 PostThu Aug 11, 2011 3:54 pm
Send private message Reply with quote
@SW: No, the suspend player wouldn't be my problem. Your thinking of suspend box advance.

@G-Wreck: The set NPC direction is instant effect.

Anyways, I found my problem. It was in the boss intro script all along. I forgot to put resume box advance in.
Thanks everyone for your help!
Liquid Metal King Slime
Send private message
 
 PostFri Aug 12, 2011 12:02 am
Send private message Reply with quote
Ah yes, it is suspend box advance, but your problem was the exact same problem you get with that so I guess I was confused.
I'm glad you were able to fix your script.
Display posts from previous: