How to start?
by Flory Madrilejos · in General Discussion · 10/04/2008 (8:44 am) · 6 replies
Hello to everyone, I ask you all on how to script this. I have no idea because I am newbie in scripting.
I made adventure game, in the first level I want the player to collect information that he may use during boss fight. How do I start scripting?
Example. if the player touches scroll the message or GUI "paper" with information will appear with button continue... if he collects all the information he will continue to level two.
Also, how I make script in boss fight? It is question and answer fight. If he answer the question he will hit the enemy but if he's not the enemy will hit him.
maybe random information for level one also random questions for boss fights. How can I make scripts? Please help me... Thank you in advance...
I made adventure game, in the first level I want the player to collect information that he may use during boss fight. How do I start scripting?
Example. if the player touches scroll the message or GUI "paper" with information will appear with button continue... if he collects all the information he will continue to level two.
Also, how I make script in boss fight? It is question and answer fight. If he answer the question he will hit the enemy but if he's not the enemy will hit him.
maybe random information for level one also random questions for boss fights. How can I make scripts? Please help me... Thank you in advance...
#2
10/04/2008 (11:31 am)
Shane I want this game to develop, this game is our thesis. This idea was on our proposal that we submitted. We don't have a choice but to do it. I am studying scripting now, but I don't know how to start it exactly on the idea. So please help...
#3
You could do a raycast for when the mouse is over the scroll, open the gui over the play gui. When the mouse moves away from the gui, the gui closes.
Place your questions in a text file with the correct answer. Make an input gui and have your script check the answer against the answer in your text file. If the answer is correct, switch missions to the boss fight mission. (if I am understanding what you are attempting correctly)
10/04/2008 (12:42 pm)
Quote:Example. if the player touches scroll the message or GUI "paper" with information will appear with button continue... if he collects all the information he will continue to level two.
You could do a raycast for when the mouse is over the scroll, open the gui over the play gui. When the mouse moves away from the gui, the gui closes.
Quote:Also, how I make script in boss fight? It is question and answer fight. If he answer the question he will hit the enemy but if he's not the enemy will hit him.
Place your questions in a text file with the correct answer. Make an input gui and have your script check the answer against the answer in your text file. If the answer is correct, switch missions to the boss fight mission. (if I am understanding what you are attempting correctly)
#4
maybe Shane is right, this game didn't suit to my capabilities. Maybe I change it to puzzle like collecting objects. when all of the objects collected it will load next level. To become educational I put some objects that make the user think what it is.
What do you think?
10/04/2008 (10:45 pm)
Mike, not mouse... I mean, when the character touches the object like scroll then the the message will pop up.maybe Shane is right, this game didn't suit to my capabilities. Maybe I change it to puzzle like collecting objects. when all of the objects collected it will load next level. To become educational I put some objects that make the user think what it is.
What do you think?
#5
That later is easiest. Just add a fuction to player collision so that if he walks over it, it opens the gui.
The easiest way, for any way you decide, would be to place a trigger on it. When the player enters the trigger, open the new gui. You can add your button to the gui to close it easy enough. The only thing you have to make sure to do with the trigger is to add code so that once the player closes the gui, it doesn't open again until after the player has left it, and walks back in. Doing things that are beyond your capabilities is how you learn. (at least it's how I learn)
Let's step thru this one with the trigger.
If you look in "server/scripts/", you will find a file called "triggers.cs". Open it and look. It's a basic trigger with a couple of functions. Copy it to another place and rename it to whatever you want.
Inside, you'll see:
datablock TriggerData(DefaultTrigger)
Change DefaultTrigger to another name, and make sure to change it in all the functions. Now you have your very own custom trigger.
In function DefaultTrigger::onEnterTrigger(%this,%trigger,%obj) between the braces {} add your code to open your gui. (you'll need to look in client/scripts to find this information)
You will have to do a commandToClient to fire your client side script.
That should get you going. It's not as difficult as it seems.
10/05/2008 (7:26 am)
By touches, do you mean when clicked? or when the player walks on it?That later is easiest. Just add a fuction to player collision so that if he walks over it, it opens the gui.
The easiest way, for any way you decide, would be to place a trigger on it. When the player enters the trigger, open the new gui. You can add your button to the gui to close it easy enough. The only thing you have to make sure to do with the trigger is to add code so that once the player closes the gui, it doesn't open again until after the player has left it, and walks back in. Doing things that are beyond your capabilities is how you learn. (at least it's how I learn)
Let's step thru this one with the trigger.
If you look in "server/scripts/", you will find a file called "triggers.cs". Open it and look. It's a basic trigger with a couple of functions. Copy it to another place and rename it to whatever you want.
Inside, you'll see:
datablock TriggerData(DefaultTrigger)
Change DefaultTrigger to another name, and make sure to change it in all the functions. Now you have your very own custom trigger.
In function DefaultTrigger::onEnterTrigger(%this,%trigger,%obj) between the braces {} add your code to open your gui. (you'll need to look in client/scripts to find this information)
You will have to do a commandToClient to fire your client side script.
That should get you going. It's not as difficult as it seems.
#6
I want it onCollision, then the Image will prompt to the player. The Idea is this "If the player touches/pick-up the object(Coin) the image(gui) will prompt to the player. This Scroll will have information(text written on it) and will have button to continue collecting the object(Coin)."
In the reference I found in the previous thesis the developer uses Array of information then once the user touches the scroll the image(paper) prompt with continue button.
I'm working on this script now... If you guys have ideas please reply... Thanks
PS:
It will serve as 1st level... Collecting of information.
When the player collects it all he will proceed to level 2.
10/30/2008 (11:06 am)
Thanks Mike... and sorry for the late reply. I set aside this part because it's hard to me to get it easy. I create the basics a while ago and now I am here again and I am doing now this part.I want it onCollision, then the Image will prompt to the player. The Idea is this "If the player touches/pick-up the object(Coin) the image(gui) will prompt to the player. This Scroll will have information(text written on it) and will have button to continue collecting the object(Coin)."
In the reference I found in the previous thesis the developer uses Array of information then once the user touches the scroll the image(paper) prompt with continue button.
I'm working on this script now... If you guys have ideas please reply... Thanks
PS:
It will serve as 1st level... Collecting of information.
When the player collects it all he will proceed to level 2.
Torque Owner Shane09