Page 1 of 1

Script question(variable)

PostPosted: Wed Dec 20, 2006 5:51 pm
by Troodon
Hi,
How can I make in create actor script:

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

Thanks

PostPosted: Thu Dec 21, 2006 11:44 am
by makslane
Can you explain better what you want?

PostPosted: Thu Dec 21, 2006 11:57 am
by Troodon
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:

PostPosted: Fri Dec 22, 2006 12:49 am
by makslane
Like this? (in Create Actor event)

Code: Select all
geeni = creator.geeni + rand(10);

PostPosted: Fri Dec 22, 2006 10:16 am
by Troodon
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:

PostPosted: Fri Dec 22, 2006 5:11 pm
by makslane
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]

PostPosted: Fri Dec 22, 2006 7:19 pm
by Troodon
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.