hello,i am trying to programm an entity creator like!
There is a main model like a box!
it has his action mainbox!
His stats are:
function test();
function babytest();
function babybox();
action box
{
player = me;
my.enable_click = on;
my.event = test;
}
function test()
{
if(event_type == event_click)
{
ent_create("babybox.mdl",player.x,babybox);
}
}
function babybox()
{
my.enable_click = on;
my.event = babytest;
}
function babytest()
{
if(event_type == event_click)
{
ent_create("babybox.mdl",player.x,babybox);
}
}
well to this point it should function well!
The problem is i want that every model have to be INDIPENDENT!
Meaning: Every entity should have his own heart var!!!!,own position VAR!
Meaning: If i click a babybox,it should post his heart as a text!
If i click another babybox it should show HIS own heart!
So how can i make this????
I cant use public vars because i can use them only in the function where i created the var!
Global vars are not possible too because 1 VAR can not have all stats of the created entitys! Someone said i have to use skills! And i think there have to be something with arrays too?! Could someone post a tutorial or something like this how it is makeable?
I cant solve this creating problem!
PS:
1)The try to post wait(1); in every function DOES NOT WORK!
2)The fake indipendet thingy wouldnt work too! Meaning: creating for every entity creating his own vars is too much work! and i want that i can create hundreds of entitys with own stats... i want this interactive function!Creating lots of entitys
greetings ness