Gamestudio Links
Zorro Links
Newest Posts
EntryDelay Clarification
by Ger1
Yesterday at 22:11
strf length-limitation
by Grant
Yesterday at 18:49
Deformers struct in MDL7 abspeichern.
by tagimbul
Yesterday at 17:41
Compiling Trading Strategies with C++
by pascalx
Yesterday at 12:18
global breakeven of a portfolio inside tmf function
by kmerlo
08/19/17 12:21
AUM Magazine
Latest Screens
AckCon'17: Lotter vs The World
Triton Wing
ZeaL
Computer Repair Simulator
Collider (working title)
Who's Online
11 registered (3dgamelight, Grant, alibaba, Iglarion, jrath, JoFo, jyd, tagimbul, mk_1, 1 invisible), 447 Guests and 4 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
mqo, Aimak, Grant, Marce, pascalx
17719 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
Serious User

Registered: 04/17/02
Posts: 1057
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: 6580
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
Serious User

Registered: 04/17/02
Posts: 1057
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: 6580
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
Serious User

Registered: 04/17/02
Posts: 1057
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