script problems

Talk about making games.

script problems

Postby Kooldudese » Sun May 25, 2008 8:29 pm

i've been having scripting problems which i dont get... to me it looks like it should work, ok heres the idea.

theres three buttons, there are mouse enters as events, and when they enter it changes the value of a variable called "char"

what it does is select what character you're using

ok, the problem is when you start the game,
the event on the button is the following:
mousedown "left",script editor:


{
if (char1p=1);
CreateActor("Naruto1", "Narutorightbreath1", "(none)", "(none)", 502, -1424, true);

if (char1p=2);
CreateActor("Sakura1", "Sakurarightbreath", "(none)", "(none)", 502, -1424, true);

if (char1p=3);
CreateActor("Sasuke1", "Sasukerightbreath", "(none)", "(none)", 502, -1424, true);
}

i have no clue why this doesnt work and i need your help to fix this problem i greatly appreciate it THX
User avatar
Kooldudese
 
Posts: 128
Joined: Sat Jan 27, 2007 5:20 pm
Location: In a house
Score: 0 Give a positive score

Re: script problems

Postby stevenp » Sun May 25, 2008 8:43 pm

you say " when you start the game"

what do you mean by that? where is thiis event? in create actor? if it is, it wont work,

try putting it in the mouse down event

copy the { } script in each buton bu make sure that it is relative to the right place,
User avatar
stevenp
 
Posts: 403
Joined: Sat Dec 22, 2007 12:49 pm
Location: canada, ontario
Score: 16 Give a positive score

Re: script problems

Postby Kooldudese » Sun May 25, 2008 8:53 pm

when i say start game i mean, theres a button that says "start game" in the game itself, the even is on mouse button down (left)
User avatar
Kooldudese
 
Posts: 128
Joined: Sat Jan 27, 2007 5:20 pm
Location: In a house
Score: 0 Give a positive score

Re: script problems

Postby stevenp » Sun May 25, 2008 8:59 pm

if you make a sample, or example, i can do it for you, because i cant see your code
User avatar
stevenp
 
Posts: 403
Joined: Sat Dec 22, 2007 12:49 pm
Location: canada, ontario
Score: 16 Give a positive score

Re: script problems

Postby Kooldudese » Sun May 25, 2008 9:05 pm

ill try to make a sample, using the same way. but its going to be completely different from my actuel game, gimme a sec
User avatar
Kooldudese
 
Posts: 128
Joined: Sat Jan 27, 2007 5:20 pm
Location: In a house
Score: 0 Give a positive score

Re: script problems

Postby Kooldudese » Sun May 25, 2008 9:17 pm

hope you can help me fix this problem
Attachments
Example.zip
i made this quickly...
(464.6 KiB) Downloaded 125 times
User avatar
Kooldudese
 
Posts: 128
Joined: Sat Jan 27, 2007 5:20 pm
Location: In a house
Score: 0 Give a positive score

Re: script problems

Postby stevenp » Sun May 25, 2008 10:07 pm

skip post
Last edited by stevenp on Sun May 25, 2008 10:24 pm, edited 1 time in total.
User avatar
stevenp
 
Posts: 403
Joined: Sat Dec 22, 2007 12:49 pm
Location: canada, ontario
Score: 16 Give a positive score

Re: script problems

Postby Kooldudese » Sun May 25, 2008 10:22 pm

well, i dont think this will help me because, im using variables,
ok heres the real layout,
you have to select a character,
it saves it in the variable,
and later on when you
"start the game"
it creates that actor,
it doesnt create the
actor the instant you
select it, so it has
to be a saved value.
and also, the button
pressed to create the
actors is one button
for the three actors.
User avatar
Kooldudese
 
Posts: 128
Joined: Sat Jan 27, 2007 5:20 pm
Location: In a house
Score: 0 Give a positive score

Re: script problems

Postby stevenp » Sun May 25, 2008 10:33 pm

hows this?
Attachments
Example.zip
(502 KiB) Downloaded 126 times
User avatar
stevenp
 
Posts: 403
Joined: Sat Dec 22, 2007 12:49 pm
Location: canada, ontario
Score: 16 Give a positive score

Re: script problems

Postby Kooldudese » Sun May 25, 2008 10:47 pm

ty, this helps me alot
User avatar
Kooldudese
 
Posts: 128
Joined: Sat Jan 27, 2007 5:20 pm
Location: In a house
Score: 0 Give a positive score

Re: script problems

Postby makslane » Sun May 25, 2008 10:50 pm

In the if commands, use == not =
Don't put a ; after the if.

So, instead:

Code: Select all
if (char1p=1);
    CreateActor("Naruto1", "Narutorightbreath1", "(none)", "(none)", 502, -1424, true);


Use:

Code: Select all
if (char1p==1)
    CreateActor("Naruto1", "Narutorightbreath1", "(none)", "(none)", 502, -1424, true);
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: script problems

Postby Kooldudese » Sun May 25, 2008 11:47 pm

oh thx
User avatar
Kooldudese
 
Posts: 128
Joined: Sat Jan 27, 2007 5:20 pm
Location: In a house
Score: 0 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron