Gamestudio Links
Zorro Links
Newest Posts
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (EternallyCurious, AndrewAMD, TipmyPip, Quad), 902 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Entity creator problem #254054
02/28/09 18:23
02/28/09 18:23
Joined: Oct 2008
Posts: 112
N
Ness Offline OP
Member
Ness  Offline OP
Member
N

Joined: Oct 2008
Posts: 112
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:

Click to reveal..
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 frown


Last edited by Ness; 02/28/09 18:26.
Re: Entity creator problem [Re: Ness] #254102
03/01/09 08:39
03/01/09 08:39
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline
Senior Member
Jaxas  Offline
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
first change "function babybox()" to "action babybox()" and then create local variables like heart or what ever you want, or you can use skills for that wink


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: Entity creator problem [Re: Jaxas] #254105
03/01/09 09:32
03/01/09 09:32
Joined: Apr 2006
Posts: 624
DEEP 13
badapple Offline
User
badapple  Offline
User

Joined: Apr 2006
Posts: 624
DEEP 13
it doesnt matter whether baby box is a function or an action really there the same , as for heart use a define like this
#define HEART skill17 a define is like a global var but everybodys HEART value can be different like so my.HEART=100;

hope that helps

Re: Entity creator problem [Re: badapple] #254391
03/02/09 22:57
03/02/09 22:57
Joined: Oct 2008
Posts: 112
N
Ness Offline OP
Member
Ness  Offline OP
Member
N

Joined: Oct 2008
Posts: 112
PROBLEM:
I cant use vector skills! BAD BAD!
because:

action mainbox
{
..
....
my.defineplayer = player.z;
}

ent_CREATE("babybox.md.",my.defineplayer,babyfunction);

I get 0 for kopfhoehe!
How the hell can i do this without skills???

Re: Entity creator problem [Re: Ness] #254492
03/03/09 18:52
03/03/09 18:52
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline
Senior Member
Jaxas  Offline
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
whay can't be

skill1 = player.x;
skill2 = player.y;
skill3 = player.z;

?


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: Entity creator problem [Re: Jaxas] #255927
03/13/09 16:50
03/13/09 16:50
Joined: Oct 2008
Posts: 112
N
Ness Offline OP
Member
Ness  Offline OP
Member
N

Joined: Oct 2008
Posts: 112
Damn it,does nobody know ONE example about this entity creating if its so easy o.OŽ?!
I only know that its called OOP programming or capsuling like in Delphi,C++ BUT HOW does THIS function
in C-Script???
Can someone make a script,where i can create a entity and if i click on it i can see his heart on a panel....?

It would be very nice smile

PS: If you think that i can do nothing than its WRONG! I tried but i get some fatal results which are bad!

Re: Entity creator problem [Re: badapple] #261882
04/20/09 21:13
04/20/09 21:13
Joined: Oct 2008
Posts: 112
N
Ness Offline OP
Member
Ness  Offline OP
Member
N

Joined: Oct 2008
Posts: 112
Originally Posted By: badapple
it doesnt matter whether baby box is a function or an action really there the same , as for heart use a define like this
#define HEART skill17 a define is like a global var but everybodys HEART value can be different like so my.HEART=100;

hope that helps


How can i check on a panel which heart var i mean?
I have only 1 model and its the player which creates the babyplayers! each babyplayer has this my.heart = 100!
Let me ask something: if i clicked at babyplayer2,how can i now that its my.heart(babyplayer2)?
what do i have to write in:
digits(0,0,30*,1,???)
to get the heart level of babyplayer2?

Re: Entity creator problem [Re: Ness] #261945
04/21/09 08:15
04/21/09 08:15
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline
Senior Member
Jaxas  Offline
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
you write babyplayer2.heart wink you should learn again about local and global variables, and especial about skills smile


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: Entity creator problem [Re: Jaxas] #266336
05/17/09 15:05
05/17/09 15:05
Joined: Oct 2008
Posts: 112
N
Ness Offline OP
Member
Ness  Offline OP
Member
N

Joined: Oct 2008
Posts: 112
you made me more stupid than before...
whats wrong?

Re: Entity creator problem [Re: Jaxas] #266344
05/17/09 15:20
05/17/09 15:20
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
Originally Posted By: Jaxas
first change "function babybox()" to "action babybox()" and then create local variables like heart or what ever you want, or you can use skills for that wink
he doesnt have to...

what i would do, is define local variables in each baby player and have a global variable for the health bar, something like...
Code:
var globvar;

function babyplayer()
{
var my_health;
while(1)
 {
  if (myselected)//player selected this baby to view its health
  {
  globvar=my_health;
  }
  wait(1); 
 }
}


Last edited by darkinferno; 05/17/09 15:21.

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1