Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (OptimusPrime, AndrewAMD), 14,580 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Entity Question #244662
01/06/09 03:30
01/06/09 03:30
Joined: Jan 2009
Posts: 17
48th_Ronin Offline OP
Newbie
48th_Ronin  Offline OP
Newbie

Joined: Jan 2009
Posts: 17
if I define a entity example:

entity* megan_fox;

and make a action:

action sel_player {

megan_fox = my;

my.skill5 = 100;

}

1) does that make everything within the quotations marks megan_fox when i use my,

2) say I create a action weapon() in another wdl. for instance

action weapon {

while (1)
{
if (my.skill5 > 0 ) {wait(1);}

c_trace(megan_fox.x, enemy.x, ignore_me | ignore_passable);

if (you == enemy)
{
status_txt.string = "SEES ENEMY!";
enemy.invisible = off;
}
else
{
if (you != enemy ){
status_txt.string = "ALL CLEAR!";
enemy.invisible = on;
}
}
status_txt.visible = on; // show the text
sleep (1); // for 1 second

}
}

I put the action weapon() within the megan_fox action, will the action know megan_fox = my or do I need to include it again in the weapon() action or change my.skill51 to megan_fox.skill51




Last edited by 48th_Ronin; 01/06/09 03:37.
Re: Entity Question [Re: 48th_Ronin] #244827
01/07/09 02:00
01/07/09 02:00
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
hey,

1) if something is given an action, that action will then respond to me commands, (e.g my.pan += 100;)

2) if you're not applying the action in WED then declare it as a function, and pass the me variable
so use
Code:
function weapon(ent){
me = ent;
... //blah blah
}

action sel_player{
//blah again
weapon(me);


Re: Entity Question [Re: 48th_Ronin] #244845
01/07/09 05:36
01/07/09 05:36
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline
Member
heinekenbottle  Offline
Member

Joined: Oct 2008
Posts: 218
Nashua NH
The "my" pointer is a local pointer. "My" points to the entity which is attached to the action (either in WED or through ent_create). Both entities can use "my" without interfering with each other.

So if you have two entities, one with the action "sel_player" and the other with the action "weapon()," you can simply use "my."


I was once Anonymous_Alcoholic.

Code Breakpoint;

Gamestudio download | 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