Help me with 2 very important questions please!!

Non-platform specific questions.

Help me with 2 very important questions please!!

Postby newbie » Thu May 19, 2005 9:22 pm

Hello, I would like to start off by saying that I'm doing a project for my 8th grade L.A class. And that project just happens to be to create a video game. I needed some software to help me create a game and that led me to game editor. I started at the beginning of this month and am almost done. My game has that caveman guy running around a level I created. I started off with something that was preloaded and added my own ideas and basically, enhanced the game. I made the objective of the game to get diamonds and beat the pacman-looking boss. But it would make the game alot more challenging if I knew how to create a 300 second timer that would be visible on the screen and would reduce by 1 number as every second goes by. I know I have to use the script editor for that and thats the problem. I am completely clueless when it comes to the script editor. I'm fairly good at adding events and animations but thats about it. And I really need a visible timer for my game. So I would really appreciate if someone could tell me what to write on the script editor to make my timer. There's also one more thing. When I export my game it works fine and everything, but is there any way to set it up so when I get destroyed I could push a key on my keyboard so the game restarts. Because when I'm presenting I think it would be nicer to the class if there was a way to just push a button to restart instead of closing and restarting the game. I would really appreciate any help from you more experienced guys. PLEASE HELP ME!!
newbie
 
Posts: 4
Joined: Thu May 19, 2005 9:06 pm
Score: 0 Give a positive score

Postby willg101 » Fri May 20, 2005 12:31 am

OK
First, the timer.
Start out by creating an actor ("timer"), make a text number on it ("300")
Then, Make an event "Create actor" --> "script editor" use this code:
Code: Select all
textNumber=300;

Next, make the event "Create actor" --> "Create timer" -->"Time", 1000 (ms), and repeats forever
Then, make the event "Timer" --> "Time" --> "Script editor"
Then, use this code:
Code: Select all
textNumber-=1;

Now, create an event "draw actor" --> "conditional action" --> "If [textNumber] [is less or equal to] [0]
From there, you can add your own actions.

OK, now on to restarting your game
On key down event, choose the key you want to have restart your game &, in script editor, use LoadGame followed by ("yourgame.exe"). It should look something like this:
Code: Select all
LoadGame("yourgame.exe")


**Note: replace yourgame with the file name of your game

If you need a demo of this, drop me a line!!

HTHs
http://www.wish-games.com
Old betas now available!!
User avatar
willg101
 
Posts: 473
Joined: Thu Dec 16, 2004 12:08 am
Location: West Michigan
Score: 5 Give a positive score

Postby newbie » Sat May 21, 2005 3:38 am

ok willg101, i'd just like to say thank you for the help with the timer. I followed your instructions and it worked. Of course i dint like it wen i found that after the timer hit zero it went to negative infinity. But i figured a way around that. I recreated the timer instead of to play infinitely to just play three hundred times. That way it takes away 1 number from the "timer" actor as each second goes by, but only for three hundred times. And i also made it destroy my actor so its good. But unexpectedly I encountered a problem with the restarting. This is EXACTLY what I did:

I went to the actor that I use as the player and clicked actor control. I created a key down event. I chose "Enter" as the key. I disabled repeat. Then I "added action" and went to "script editor." I clicked on variables/functions and chose LoadGame. I made the parantheses so it looked just like this.

LoadGame(GorlocksGreatAdventure4.exe);

GorlocksGreatAdventure4 is the current name of my game. And when I clicked "add action" it gave me this exact error:

"Error: Line 1: Undeclared identifier GorlocksGreatAdventure4"

I don't know what I did wrong and I was hoping you could help me out with that, since your instructions for the timer were excellent.
newbie
 
Posts: 4
Joined: Thu May 19, 2005 9:06 pm
Score: 0 Give a positive score

Postby makslane » Sat May 21, 2005 1:05 pm

You must use LoadGame("GorlocksGreatAdventure4.ged");
(Will load the .exe after export)
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby newbie » Sat May 21, 2005 4:36 pm

Tried that, same error.
newbie
 
Posts: 4
Joined: Thu May 19, 2005 9:06 pm
Score: 0 Give a positive score

thank you very much!

Postby newbie » Sun May 22, 2005 5:04 pm

thank you everyone for all your help i figured out what i did wrong. I didnt know I was supposed to put GorlocksGreatAdventure in quotation marks. I thought that was just for the forum, not for the script editor. Thank you makslane and willg101, you two saved my grade.
newbie
 
Posts: 4
Joined: Thu May 19, 2005 9:06 pm
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest