Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 945 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
An entity having a Large Local Array in C-Script #462600
10/13/16 17:54
10/13/16 17:54
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Hi friends!

Anyone have any clever way to get an entity to have a local array that only it can access and change? I could just make a bunch of global arrays and then assign each array to each entity, but I would like to see if I can get an entity to have its own array, an array with more than 3 values.

Re: An entity having a Large Local Array in C-Script [Re: jumpman] #462601
10/13/16 18:23
10/13/16 18:23
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You could use the entity's skill array like this:

my.skill[10+i] = i;

At least I think it's like that in C-Script, too, with skill1,2,... just as defines of said array (this means skill1 = skill[0], skill2 = skill[1],...).

Alternatively, it should be possible to allocate memory dynamically in C-Script, right? You could do that for each entity and save the pointer in a skill.

Or, the worst option, you could make a big global array and use let's say 16 entries for each entity which they access via some ID-skill, like this:

my.skill10 = enemy_id;
enemy_id = enemy_id+1;
...
global_array[(my.skill10*16)+i] = i


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: An entity having a Large Local Array in C-Script [Re: Superku] #462602
10/13/16 18:46
10/13/16 18:46
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Hey Superku!


I dont think you can do this in C-script:
my.skill[10+i] = i;

What I'm looking for is to have each entity have a list of values, each value storing an entity ID number. However I would like to have each entity have around 300 values! Is that possible?

Are you using the bitwise stuff?

Re: An entity having a Large Local Array in C-Script [Re: jumpman] #462603
10/14/16 10:54
10/14/16 10:54
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Originally Posted By: jumpman
I dont think you can do this in C-script:
my.skill[10+i] = i;

Have you tried it at least?
Entities have 100 skills for quite a long time now, and I bet it's just a 100 var array named skill, too.

If you need more than 100 skills you probably need to take one of the other 2 options I've posted above. I don't have a C-Script manual anymore so I can't look it up sadly.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: An entity having a Large Local Array in C-Script [Re: Superku] #462608
10/14/16 16:33
10/14/16 16:33
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Hwy Superku,

Yea Ive tried it, it doesnt work frown

I might just end up having to do seperate Arrays for each entity. Thanks for your help so far laugh


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

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