Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by mistery. 12/05/26 12:48
contractUpdate() is filtering if >2 rows
by mistery. 12/04/26 19:03
Removing outliers from files
by AndrewAMD. 12/02/26 15:26
SGT_FW
by Aku_Aku. 11/30/26 08:19
Experiences with cTrader
by JeyKey II. 11/27/26 09:04
make a complaint
by EW_bytes. 11/26/26 23:00
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (Grant), 2,494 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[HELP] Counting the number of entities in a level. #399739
04/19/12 03:33
04/19/12 03:33
Joined: Apr 2005
Posts: 796
U.S.A. Michigan
exile Offline OP
User
exile  Offline OP
User

Joined: Apr 2005
Posts: 796
U.S.A. Michigan
Hey there. I am trying to figure out a way to count the number of a certain entity within a level. Then each entity gets its own number. How could I do this? I tried using "for" and I couldnt figure it out. Thanks guys.

Re: [HELP] Counting the number of entities in a level. [Re: exile] #399742
04/19/12 04:19
04/19/12 04:19
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Code:
function count_all_ents()
{
  var entcount = 0
  for(you = ent_next(NULL); you; you = ent_next(you)) 
    entcount ++;
  }
return(entcount);
} 


[...]
var allentities = count_all_ents();



ent_next helps alot laugh


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: [HELP] Counting the number of entities in a level. [Re: exile] #399743
04/19/12 04:58
04/19/12 04:58
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline
Senior Member
3dgs_snake  Offline
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
You can also use stats functions num_entities

Best regards.

Re: [HELP] Counting the number of entities in a level. [Re: 3dgs_snake] #399744
04/19/12 05:19
04/19/12 05:19
Joined: Apr 2005
Posts: 796
U.S.A. Michigan
exile Offline OP
User
exile  Offline OP
User

Joined: Apr 2005
Posts: 796
U.S.A. Michigan
haha thanks, didnt even know about ent_next!

Problem solved.

Thanks guys, youre a great help!


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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