Decision making and Scripts How to do?

Talk about making games.

Decision making and Scripts How to do?

Postby Jan » Fri Apr 01, 2005 10:25 am

Hi, I’m trying to make a board game. It will involve some decision making and there is where I get stuck. The player has to role a dice and can move the number that the dice shows. The player presses an arrow to move in a certain way (north, south, west and east) How do I stop the player from moving when he did his last move.

Who can help?
Jan
 
Posts: 12
Joined: Fri Apr 01, 2005 10:14 am
Location: Netherlands
Score: 1 Give a positive score

Postby jazz_e_bob » Fri Apr 01, 2005 2:50 pm

If a player throws a 4 how do you stop the player from moving more than 4 times?

You could use an actor variable called "movesRemaining".


Throw the dice.

Set movesRemaining to the dice value.

On atttempt to move:

if ( movesRemaining > 0 )
{
move player
movesRemaining -= 1;
}

Image
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby Just4Fun » Fri Apr 01, 2005 7:39 pm

Nice one Jazz! :D
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby jazz_e_bob » Fri Apr 01, 2005 7:50 pm

:)

8)
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby Jan » Fri Apr 01, 2005 10:19 pm

thanks jazz.

Allthough I still had some puzzeling to do (Just started this week with GE) You pointed me in the right direction and I got it to work.

The final code looks like this now:

if ( movesRemaining > 0 )
{
MoveTo("pion3", -25.000000, 0.000000, 5.000000, "pion3");
movesRemaining -= 1;
dice.textNumber = dice.textNumber - 1;
}

Rest a sure that I will be back with some more questions :?: the comming weeks.
Jan
 
Posts: 12
Joined: Fri Apr 01, 2005 10:14 am
Location: Netherlands
Score: 1 Give a positive score

Postby willg101 » Sun Apr 03, 2005 2:57 am

You just started and you're that good with the code already?!! maan!
:shock:
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 Jan » Sun Apr 03, 2005 12:47 pm

I just started with GE. But have been trying to program stuff for about 25 years now. GE is the best I have come accross till so far. Maybe some of you can remember the Commodore Amiga. I used Amos then. Also a need program. but I always ran out of memory. Did some nice things with it though. Getting the scripts right is always the hardest part and a good manual would be great. I made a flow chard in Word of the creation of my clock so if someone is interrested, just send me a note.
It's quite detailed and maybe way to simple for advanced programmers, but for beginners it can be helpfull (I think).

I also send the clock and flow chard to Makslane. Maybe he will put it somewhere for others to download.

Image
Jan
 
Posts: 12
Joined: Fri Apr 01, 2005 10:14 am
Location: Netherlands
Score: 1 Give a positive score

Postby Just4Fun » Sun Apr 03, 2005 4:10 pm

Jan:
That is just so neat. I am an old AMOS user too. Though I have to admit to owning the program more than using it. I did love the gradients that you could make using AMOS though. Guess that pretty much dates me, but my very first real "computer" was an Atari 400!!! So you can just call me Methusla. :wink:
I, too, am enjoying GE and learning C programming at the same time! It is a great C programming tutor as well as an outstanding program in general. I'm an authoring systems nut though... :shock: I love to investigate them. It seems to me that we aren't seeing as many authoring sytems being developed these days.
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby Jan » Sun Apr 03, 2005 4:39 pm

My first computer was the ZX Spectrum. Man that seems like 1000 years back and some how it looks like yesterday. Who remembers Sir Clive Sinclair? But what does guys with a few K. of memory was unbelievable. I think he is the course that there is a pc in almost every home at this moment.

Ever since that first computer I am hooked on programming. Not that I made world shocking thinks but it's just fun to try to get things to do what you want on a pc.

My All Time favourites games where Out Run, The Great Escape, The Eagels Nest and Dogs of War. These are the games I would like to make in GE, but if it will ever work out I don't know. But never the less it's fun to try.


Image
Jan
 
Posts: 12
Joined: Fri Apr 01, 2005 10:14 am
Location: Netherlands
Score: 1 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest