Page 1 of 1

Decision making and Scripts How to do?

PostPosted: Fri Apr 01, 2005 10:25 am
by Jan
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?

PostPosted: Fri Apr 01, 2005 2:50 pm
by jazz_e_bob
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

PostPosted: Fri Apr 01, 2005 7:39 pm
by Just4Fun
Nice one Jazz! :D

PostPosted: Fri Apr 01, 2005 7:50 pm
by jazz_e_bob
:)

8)

PostPosted: Fri Apr 01, 2005 10:19 pm
by Jan
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.

PostPosted: Sun Apr 03, 2005 2:57 am
by willg101
You just started and you're that good with the code already?!! maan!
:shock:

PostPosted: Sun Apr 03, 2005 12:47 pm
by Jan
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

PostPosted: Sun Apr 03, 2005 4:10 pm
by Just4Fun
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.

PostPosted: Sun Apr 03, 2005 4:39 pm
by Jan
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