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
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 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
Reset entity's skill #110307
02/02/07 11:30
02/02/07 11:30
Joined: Dec 2006
Posts: 40
viktoria Offline OP
Newbie
viktoria  Offline OP
Newbie

Joined: Dec 2006
Posts: 40
How can i call all entities(about 50), and reset it all from another function? They were created in Wed and dont"t have entity pointer in Script, but have an action function.
Something of the kind:
Code:

define blocked, skill1;
numberOfEntities = 50;

function f1{
while (i<= numberOfEntities){
["entityName"+i].blocked = 0;
i +=1;
}
}



Re: Reset entity's skill [Re: viktoria] #110308
02/02/07 12:47
02/02/07 12:47
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
There is an instruction called "ent_next(entity)"
please refer to the manual for more information.

Here is the example code rewritten to fit your needs:
Code:

define blocked, skill1;

function reset_skill()
{
you = ent_next(NULL);

while(you != NULL)
{
you.blocked = 0;
you = ent_next(you);
}
}



Re: Reset entity's skill [Re: Xarthor] #110309
02/02/07 13:09
02/02/07 13:09
Joined: Dec 2006
Posts: 40
viktoria Offline OP
Newbie
viktoria  Offline OP
Newbie

Joined: Dec 2006
Posts: 40
Thanks.
It helped me.

One more question: Can i generate an entity name? Something of the kind:

entity* myPointer;

myPointer = 'someName'+1;
myPointer.blocked = 1;

if the entity with the name someName1 exists in WED?

Re: Reset entity's skill [Re: viktoria] #110310
02/02/07 13:15
02/02/07 13:15
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
yes however you would need to use this instruction:
Quote:


ent_for_name (STRING* name);


Returns a pointer to the entity with the given WED name. Names can be assigned to entities through [Properties] in WED. This way, entities placed in a level can be accessed in functions even if they have no action themselves. Only the first 20 characters of the entity name are evaluated.





So what you can do:
Code:

entity* myPointer;

myPointer = ent_for_name('myEntityName');



Oh I see you want to connect a string plus a number:
Code:

string ent_name;
string temp_str;

entity* myPointer;

...
str_for_num(temp_str,1);
str_cpy(ent_name,"someName");
str_cat(ent_name,temp_str);

myPointer = ent_for_name(ent_name);



Re: Reset entity's skill [Re: Xarthor] #110311
02/02/07 13:34
02/02/07 13:34
Joined: Dec 2006
Posts: 40
viktoria Offline OP
Newbie
viktoria  Offline OP
Newbie

Joined: Dec 2006
Posts: 40
Danke dir, ich habe gerade gesehen, dass du aus Deutschland bist.
Es war genau, was ich suchte!


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