Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

interupting my intro

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
cavemanerick




Joined: 03 Aug 2008
Posts: 74

PostPosted: Fri Jul 17, 2009 11:07 am    Post subject: interupting my intro Reply with quote

Well i've been fiddling with this for quite a few hours now, ive tried on key press command, i've tried hooking a textbox that sends u to another script in, i've tried the press keys commands, nothing seems to work.The probelm is when another script starts the one before which is listed below keeps interupting the main menu and new game scripts. So i'm asking for some help heres my basic script of my intro scene without any tweaks i currently have on it, that i'm testing to see if it will work just seeing if u guys have any other ideas cuse i seem to be running out of my own. This is proably the hardest part of programming for my game so as soon as this is done i can start on my demo. So any help will be appreicited.

heres my code

Code:
plotscript,titlescreen,begin


suspend player

show backdrop (39)
wait (38)
Fade screen out
wait (20)

wait(15)
play song(song:beginning)
wait(5)


show backdrop (2)
wait(1)
fade screen in
wait (23)
fade screen out



show backdrop (12)
wait(15)
fade screen in
wait(23)
fade screen out

wait(-4)
show backdrop (8)
wait(20)
fade screen in
wait(80)
fade screen out

wait(8)
show backdrop (4)
wait(1)
fade screen in
wait(7)
fade screen out

wait(1)
show backdrop (6)
wait(1)
fade screen in
wait(7)
fade screen out

wait(-1)
show backdrop (16)
wait(1)
fade screen in
wait(9)
fade screen out

wait(1)
show backdrop (14)
wait(1)
fade screen in
wait(14)
fade screen out

wait(4)
show backdrop (14)
wait(1)
fade screen in
wait(14)
fade screen out

wait(1)
show backdrop (40)
wait(-1)
fade screen in
wait(10)
fade screen out

wait(44)
show backdrop (11)
wait(1)
fade screen in

stop song
resume player
Back to top
View user's profile Send private message
Spoon Weaver




Joined: 18 Nov 2008
Posts: 421
Location: @home

PostPosted: Fri Jul 17, 2009 11:36 am    Post subject: Reply with quote

First, wait commands with negative time? Really? does that work? it happens before it would normally happen?!

Second, what you'll want to do it not use Wait commands at all.

Replace all your wait commands with If statements referring to a variable that is getting increased every time your script loops. then have the loop dependent on whether or not a key is press.

kind of like this:

Code:

plotscript,titlescreen,begin

varaible ( time )

 while (key is pressed (28)==false) do , begin
# key press code 28 is for the ENTER key

time:=time+1

suspend player
if (time==2) then (show backdrop (39))
if (time==38) then ( Fade screen out)

if (time==73) then ( play song(song:beginning) )
if (time==78) then (show backdrop (2))
if (time==80) then (fade screen in)
if (time==103) then (fade screen out)

if (time==104) then (show backdrop (12))
if (time==118) then (fade screen in)
if (time==140) then (fade screen out)

if (time==144) then (show backdrop (8))
if (time==164) then (fade screen in)
if (time==244) then (fade screen out)

if (time==252) then (show backdrop (4))
if (time==253) then (fade screen in)
if (time==260) then (fade screen out)

if (time==261) then (show backdrop (6))
if (time==262) then (fade screen in)
if (time==269) then (fade screen out)

if (time==270) then (show backdrop (16))
if (time==271) then (fade screen in)
if (time==280) then (fade screen out)

if (time==281) then (show backdrop (14))
if (time==282) then (fade screen in)
if (time==296) then (fade screen out)

if (time==300) then (show backdrop (14))
if (time==301) then (fade screen in)
if (time==315) then (fade screen out)

if (time==316) then (show backdrop (40))
if (time==317) then (fade screen in)
if (time==327) then (fade screen out)

if (time==371) then (show backdrop (11))
if (time==372) then (fade screen in)


##
wait (1)
##

 end

stop song
resume player


EDITED


Last edited by Spoon Weaver on Fri Jul 17, 2009 8:32 pm; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cavemanerick




Joined: 03 Aug 2008
Posts: 74

PostPosted: Fri Jul 17, 2009 12:09 pm    Post subject: Reply with quote

thanks i'll try it immedentally and also negatives do work that way i accidentally stumbled on it. As most of my interesting finds in this form of programming. Also i needed the negative numbers to speed up things cuse my intro is put to a tune that the pictures match so it worked great. I was surpised they worked tho too.
Back to top
View user's profile Send private message
cavemanerick




Joined: 03 Aug 2008
Posts: 74

PostPosted: Fri Jul 17, 2009 12:27 pm    Post subject: Reply with quote

i tried your way spoon and it gave me this error

ERROR in line:392

line: if (time==78 then (

if statement has 2 conditions. It should only have one. Use and or or for complex situations.

if theres a way to make it work from my (wait)script somehow it would look better but i'm taking what i can get here as i need to get to the main production of this game. I just wish there was a way to immendantly stop scripts without the compiler mistaking it for an extra end command, or turn the bit back on titlescreen. thru scripting.
Back to top
View user's profile Send private message
Spoon Weaver




Joined: 18 Nov 2008
Posts: 421
Location: @home

PostPosted: Fri Jul 17, 2009 2:25 pm    Post subject: Reply with quote

you copied the script wrong.

You have it looking like this:

Code:
 if (time==78 then (


It should look like this

Code:
 if (time==78) then (


note the extra ) . Those are needed.


There's also another problem with it, that I just noticed. I originally was doing the script another way, and then changed some stuff, basically those )))) at the end are in fact wrong...... my bad.
Anyways, I changed the code. Try again.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Fri Jul 17, 2009 2:44 pm    Post subject: Reply with quote

cavemanerick wrote:
thanks i'll try it immedentally and also negatives do work that way i accidentally stumbled on it. As most of my interesting finds in this form of programming. Also i needed the negative numbers to speed up things cuse my intro is put to a tune that the pictures match so it worked great. I was surpised they worked tho too.


A wait command with a negative number does not do time-travel! The laws of physics do not permit it! :)

A negative number on a "wait" command does not do anything at all. it is exactly the same as "wait(0)"
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Spoon Weaver




Joined: 18 Nov 2008
Posts: 421
Location: @home

PostPosted: Fri Jul 17, 2009 5:19 pm    Post subject: Reply with quote

awww.... The prospect of time travel had really got me excited. Darn you Mr. Reasonable!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cavemanerick




Joined: 03 Aug 2008
Posts: 74

PostPosted: Fri Jul 17, 2009 7:58 pm    Post subject: Reply with quote

I tried the new script spoon all it did was make my screens not show and the music never stop. Also when i tried to close window wouldn't let me. So now i don't know what to do i have 2 theories myself i'll try but i'm still open for suggestions of any type people.

I'm gonna try useing timer set commmands, if thats possible at all to do this with. Also i'm gonna try connecting a textbox with another script and see if the other script having (break) command then "begin, do" will allow it to stop other command but continue its own. If neither of these work i may have to resort to changing my plans completely for the intro.

edit: Since it seems to problematic right now i'm just going to make my company dropbacks the titles. The pics that come next i'm gonna transfer to when u pick a newgame it still works just not what i exactly wanted and now it works perfectly together thanks anyways guys appreciate it.
Back to top
View user's profile Send private message
Spoon Weaver




Joined: 18 Nov 2008
Posts: 421
Location: @home

PostPosted: Fri Jul 17, 2009 8:32 pm    Post subject: Reply with quote

sorry, It needs a wait command. I always forget that. Here I'll alter it. Kinda funny, seeing as how I was saying you didn't want to use wait commands and that's what I forgot to put in. All loops need a wait(1) command to work properly.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cavemanerick




Joined: 03 Aug 2008
Posts: 74

PostPosted: Fri Jul 17, 2009 9:13 pm    Post subject: Reply with quote

Thanks anyways man maybe someone will stumble on this later on down the road and get help from it. I've already redone everything and it actually looks really good only thing i'm missing now is a title music theme lol. Besides that i'm pretty much done this part of my game 2% done now the rest to go lol.Also i've spent a total of 18 hours so far now and i'm not stoping constant work whenever i get home till its done too.( not toal time i've put about a whole years time already into this game thru the years)
Back to top
View user's profile Send private message
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Sat Jul 18, 2009 11:16 am    Post subject: Reply with quote

As an end note here, it might be less trouble to write a custom wait script that looks something like this:

Code:
script, my wait, ticks, begin
 variable(i, skip wait)
 for(i, 1, ticks) do (
  if (skip wait == false) then (wait(1))
  if (key is pressed(whatever)) then (skip wait := true)
 )
 return(skip wait)
end


Then all you need to do is replace every instance of wait(x) with if (my wait(x)) then (exit returning(1)) and it will do exactly what you wanted.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Sat Jul 18, 2009 8:26 pm    Post subject: Reply with quote

Moogle1 wrote:
Then all you need to do is replace every instance of wait(x) with if (my wait(x)) then (exit returning(1)) and it will do exactly what you wanted.


Hamsterspeak has a perfectly good "exit script" command!
Code:
if (my wait(x)) then (exit script)



It's currently not possible to exit another script without also exiting the currently running script, and even then only by using something like tags or the return value from Moogle's wait script; but it will be possible in the relatively near future.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
cavemanerick




Joined: 03 Aug 2008
Posts: 74

PostPosted: Mon Jul 20, 2009 12:13 am    Post subject: hate to ask for more help Reply with quote

edit: nevermind figured it out finally thanks anyways.


This is last thing you'll hear form me in a while after this is done. But i have one more problem i'm trying to set it where my load menu when you choose one of the 4 slots(its a menu i made) it checks if theres data in the saved files and if there isn't any i want it to go back to main menu.

i just need to know exactly how to get the return value (false, or true) of the command and use it somehow to continue on the next set of commands i need too.

This is the command i'm a bit confused on how do i get a return value from it and how can i use that return value in my script.If u could give me a good example i'm sure i'd be set thanks.

last save slot
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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