Quantcast
Channel: ZDoom
Viewing all articles
Browse latest Browse all 3391

Scripting • Re: Decorate / ZScript - actor-instance data

$
0
0
For now, I have a somewhat hacky solution:

I have a lookup array with indices of actor TID's, and values of script-specific, incremental actor-ids. I can then store custom actor data in separate arrays that are indexed by the script-specific actor-id from the lookup array.

Any acs script the actor calls gets passed the actor's TID. The script then starts with the lookup to get the actor-specific values it needs.

This solution works, but the lookup array is very sparse data: it needs at least <max TID> entries, but it might only have a few that are worthwhile. For example if I have 3 actors with custom data, and those 3 actors have TIDs of 7, 13, and 25, then the lookup array will be size 26, but only have 3 meaningful entries. The data arrays only need one entry per actor, though, so that's good.

Statistics: Posted by violgamba — Thu Apr 18, 2024 7:49 pm



Viewing all articles
Browse latest Browse all 3391

Latest Images

Trending Articles



Latest Images