Gamestudio Links
Zorro Links
Newest Posts
Random number not being random
by Ruben
Today at 03:24
physx unregister / disable ent bugs ?
by Reconnoiter
Yesterday at 14:47
User guide in PDF
by Sinuhet
Yesterday at 09:20
Experienced 2D|3D Character artist|Concept Artist@ Indie Prices|
by DeadlyMamba
03/21/17 16:38
Speed up with Zorro S
by Veli
03/21/17 15:08
AUM Magazine
Latest Screens
Triton Wing
ZeaL
Computer Repair Simulator
Collider (working title)
Space Rider
Who's Online
4 registered (mangoDave, jyd, Dalla, firecrest), 510 Guests and 6 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
GBA, TomJ, afoluj, szo, Zofan
17572 Registered Users
Topic Options
Rate This Topic
#462600 - 10/13/16 19:54 An entity having a Large Local Array in C-Script
jumpman Offline
User

Registered: 04/17/02
Posts: 935
Loc: 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.
_________________________
A8 Pro 8.47

Top
#462601 - 10/13/16 20:23 Re: An entity having a Large Local Array in C-Script [Re: jumpman]
Superku Offline
Senior Expert

Registered: 09/13/03
Posts: 6509
Loc: 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

Superku side-scroller: ~98.5% (??????!??)

Steam® Store Page ("Coming Soon"): http://store.steampowered.com/app/407570 Wowowowow!

Top
#462602 - 10/13/16 20:46 Re: An entity having a Large Local Array in C-Script [Re: Superku]
jumpman Offline
User

Registered: 04/17/02
Posts: 935
Loc: 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?
_________________________
A8 Pro 8.47

Top
#462603 - 10/14/16 12:54 Re: An entity having a Large Local Array in C-Script [Re: jumpman]
Superku Offline
Senior Expert

Registered: 09/13/03
Posts: 6509
Loc: 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

Superku side-scroller: ~98.5% (??????!??)

Steam® Store Page ("Coming Soon"): http://store.steampowered.com/app/407570 Wowowowow!

Top
#462608 - 10/14/16 18:33 Re: An entity having a Large Local Array in C-Script [Re: Superku]
jumpman Offline
User

Registered: 04/17/02
Posts: 935
Loc: 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
_________________________
A8 Pro 8.47

Top


Moderator:  HeelX, TSG_Torsten 

Gamestudio download | chip programmers | Zorro platform | shop | resources | magazine | manual | support faq | bugs | beta features

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) 3dgamestudio.net