[Orpheu] Structs
Hi,
Im messing a bit with CBaseMonster, and I want to try and make tasks and schedules in pawn and pass them. Im trying to make this atm as an example from CHeadCrab:
CHeadCrab
And I've got this translated to this in pawn:
Pawn
This works sort of, problem is that only the first task gets run. Is there a way I can make this work? |
Re: [Orpheu] Structs
Schedule_t struct needs contiguous array of Task structures. What you are doing is, you are making a "cell" array of "OrpheuStructure" handles and trying to pass it to Schedule_t struct. tlHCRangeAttack1 is a mere array of OrpheuStructure Handles (in fact, they are pointers to the allocated structs in memory pool) which reference to random memory segments (non contiguous).
Orpheu deals with structures good enough but lacks control for arrays of structures. So to pack these non contiguous stucts, i added a native OrpheuPackStructures to latest version of Orpheu. Use that to get pointer to packed structure array and pass it to Schedule struct, like, PHP Code:
TIP: HACKY, Now if you want to test whether all the structs passed are aligned correctly, use the handle returned with incremented offset of sizeof(tlHCRangeAttack1[1]) means sizeof(TaskStruct) = 8, like, PHP Code:
|
Re: [Orpheu] Structs
Tested and works perfectly. This should probably be folded into the official orpheu, as it's useful for those who wants to, in this instance, change monster's default behavior.
|
Re: [Orpheu] Structs
Any chance of having this added to Orpheu Arkshine? If you have time ~.
|
All times are GMT -4. The time now is 11:09. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.