|
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
Senior Expert
|
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: jumpman]
#462603
10/14/16 10:54
10/14/16 10:54
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
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
|
|
|
|