Script question(variable)

Talk about making games.

Script question(variable)

Postby Troodon » Wed Dec 20, 2006 5:51 pm

Hi,
How can I make in create actor script:

geeni(my variable) is random from range: creator actor.geeni <1 && >1?

Thanks
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby makslane » Thu Dec 21, 2006 11:44 am

Can you explain better what you want?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Troodon » Thu Dec 21, 2006 11:57 am

Sorry, I wrote that in hurry. There is a actor variable called "geeni". Actor SINI makes new SINI actors. I would like to make so that the 'new' SINI has almost the same geeni value than the creator SINI.
So something like:
timer: script editor: create actor: SINI | new sini's geeni value is bigger, smaller or equal to creator SINI's geeni value

It's little difficult to explain it because my english isn't perfect. :roll: :wink:
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby makslane » Fri Dec 22, 2006 12:49 am

Like this? (in Create Actor event)

Code: Select all
geeni = creator.geeni + rand(10);
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Troodon » Fri Dec 22, 2006 10:16 am

Not exactly. Wouldn't that just add to creator.geeni a number value from 0 to 10?
I mean something like this:
Code: Select all
child.geeni = actor.geeni (-2 or -1 or 0 or +1 or +2)


:wink:
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Postby makslane » Fri Dec 22, 2006 5:11 pm

Here:

Code: Select all
geeni = creator.geeni + round(rand(4)) - 2;


This code will give you the value of creator + (-2, -1, 0, 1, or 2)[/code]
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Troodon » Fri Dec 22, 2006 7:19 pm

That's working but I need the opposite of the 'creator'. I need the 'created' actor. Is it possible?

EDIT: I think I found out another way. Thanks! :D :D

EDIT 2: I couldn't find the way. I'll try to explain the whole problem with images:

Image
In my project there is an actor called SINI. SINI has a gene (actor variable) which effects on how they look, behave etc. In this image, there is a group of common SINIs and one big and one which produces chemical to slow monsters.

Image
A timer makes every SINI produce eggs occasionally.

Image
After some time the egg creates new SINI.

I would like to make so that every new SINI are almost clones of their parents...their creators. However this causes many problems.
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest