Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 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 | 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