Post new topic    
King Slime
Send private message
Mysterious Script Failure... 
 PostTue May 22, 2012 10:58 pm
Send private message Reply with quote
My script won't work.

Code:
plotscript, out to sea, begin
   suspend player
   variable(to sea)
   to sea := current map + 4
   fade screen out
   wait(25)
   teleport to map(to sea,11,8)
   fade screen in
   set tag(18,ON)
   resume player
   end


It's supposed to fade out, bring players to a new map depending on their current map, then fade in. When it activates in game, it does not fade in. I can't find anything wrong with it.
Slime Knight
Send private message
 
 PostTue May 22, 2012 11:13 pm
Send private message Reply with quote
Funny, earlier I was having problems with a fadescreenin after teleporttomap! I couldn't figure anything out either, and eventually just made a door. Of course, making a door isn't always an option in such a case, so it'd be good to know why this happened.

My original script that didn't fade in properly:


Code:


plotscript, chosenewgame,
begin
fadescreenout
wait(1)
teleporttomap(5,5,2)
fadescreenin
end


SPELLSHARD: THE BLACK CROWN OF HORGOTH now COMPLETE! Grab it today!
Liquid Metal King Slime
Send private message
 
 PostTue May 22, 2012 11:59 pm
Send private message Reply with quote
Questions:

1) Does the screen fade out correctly?
2) Are you saying the screen remains black forever?
3) Are you saying that the screen fades out, and then the color snaps back instantly on the new map?
3) Are you saying that the screen fades out, then fades in still on the old map and then the teleport happens after the fade in as if the commands were switched?
King Slime
Send private message
 
 PostWed May 23, 2012 12:15 am
Send private message Reply with quote
1. Yes.
2. Yes.
3. No.
4. No.
Liquid Metal King Slime
Send private message
 
 PostWed May 23, 2012 1:47 am
Send private message Reply with quote
hmm... that does sound like a bug. Is this Zenzizenzic or nightly?

What happens if you insert a wait(1)?

Code:

   teleport to map(to sea,11,8)
   wait(1)
   fade screen in
King Slime
Send private message
 
 PostWed May 23, 2012 2:32 am
Send private message Reply with quote
Zenzizenzic, I don't use nightlies. The wait(1) does nothing.
Metal Slime
Send private message
 
 PostWed May 23, 2012 3:00 am
Send private message Reply with quote
The nightly from 10/31/11 also experiences this behavior. If you fade the screen out, wait, then use the teleport to map command it'll immediately show the screen regardless.
To friends long gone, and those I've yet to meet - thank you.
King Slime
Send private message
 
 PostWed May 23, 2012 3:17 am
Send private message Reply with quote
The weirder thing is that I use the same form of command in another part of the script, and it works fine.
Liquid Metal Slime
Send private message
 
 PostWed May 23, 2012 3:56 am
Send private message Reply with quote
For kicks, why don't you try teleporting to map in one line and then set hero position in another. I wonder if it's hanging on a bad teleport line. You may also want to try changing the coordinates to something farther from the map edge. It may not fix anything, but it's not like you have anything to lose:

Code:
variable (to sea)
suspend player
to sea := current map + 4
fade screen out (0,0,0)
wait (1)
teleport to map (to sea)
set hero position (0,12,12)
wait (1)
fade screen in
resume player
end


Maybe it'll help? Even if it doesn't put the player where you want, you can at least see if it works, and then change the numbers back as you search for the problem. You can also try adding in an extra wait after the fade in just in case.
Place Obligatory Signature Here
King Slime
Send private message
 
 PostWed May 23, 2012 4:51 am
Send private message Reply with quote
Tried, no effect.
Btw, I changed the coordinates back to 11,8, because 12,12 was on the side of the boat.
Slime Knight
Send private message
 
 PostWed May 23, 2012 11:12 am
Send private message Reply with quote
Confirming that its the same for me:

- fades out correctly
- remains black forever
- no combination of "wait" commands changes anything
- using the 5/03/2012 nightly
SPELLSHARD: THE BLACK CROWN OF HORGOTH now COMPLETE! Grab it today!
Metal King Slime
Send private message
 
 PostWed May 23, 2012 1:15 pm
Send private message Reply with quote
Could not reproduce. Do you have a map autorun script (or other script) on the new map which contains a wait or infinite loop? If so, the original script will not be resumed until the autorun script finishes.

It's not necessary to put a wait either before or after the 'teleport to map'. However this is a special case, because 'teleport to map' causes an implicit wait. In general, you should put a wait before both 'fade screen in' and 'fade screen out'.
King Slime
Send private message
 
 PostWed May 23, 2012 2:45 pm
Send private message Reply with quote
Err...yes. I have an autorun on every map, and it does have an infinite loop that contains a wait. However, I have done the same teleport before, to a map with an infinite autorun, and it had worked fine.

Code:
fade screen out
   teleport to map(cabin teleport,4,4)
   stop song
   set NPC position(2,3,4)
   alter NPC(2,NPCstat:picture,13)
   set hero direction(me,left)
   wait(25)
   fade screen in


Here's a another part of another script. It works fine. Why is this situation so different?

EDIT: Wait, I think I may know the problem...when I started the above script, I stopped the loop. So, i'll try doing that...

EDIT2: It works! I got it working!
Display posts from previous: