A_GiveInventory radius extension

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: A_GiveInventory radius extension

Re: A_GiveInventory radius extension

by Major Cooke » Tue Jun 07, 2011 8:38 am

@FDARI: That's exactly what I'd like to avoid... ACS. If we can get this going for DECORATE in a much simpler way than going about assigning +NOBLOCKMAP to monsters who have already been targeted and affected, or somehow similar to what CommanderZ says, then it'd make life a lot easier on everyone.

Re: A_GiveInventory radius extension

by CommanderZ » Mon May 30, 2011 3:57 am

This would be great addition! But I think it would be better to have an option to make A_Explode apply puff on its victims. This would be more powerful, more meaningful and it could easily emulate the functionality you propose.
It would seem more "right" to me to have an ACS search function that creates a temporary array of nearby actors.
This can be done already, but it is pain in the a**. You have to assign sequential TID to all the actors you want to iterate over and then iterate over that range of TIDs with for loop.

Having more streamlined way to do this would be great though.

Re: A_GiveInventory radius extension

by FDARI » Mon May 30, 2011 3:30 am

A_GiveInventory feels a little too specific for a use of radius-based actor acquisition, but I recognise the underlying need. It would seem more "right" to me to have an ACS search function that creates a temporary array of nearby actors.

int FindNearbyActors(int range, int flags);
Flags: NOMONSTERS, NOPROJECTILES, NOMISCELLANEOUS
Return: Pointer to a list of monsters, valid until the end of the tick.
Note: The flags might not be necessary. They only make sense if it is more efficient to filter here than in modder ACS.

int GetActorListLength(int actorList);
Return: Number of actors in a temporary (or permanent, should those ever come to be) collection

int SetActivatorFromList(int actorList, int index);
Return: TRUE for success, FALSE for failure (index out of bounds, or otherwise unsuccessful)

With that, you could iterate all your actors in ACS, and perform other checks for more detailed filtering (health, friendliness, orientation, current inventory...).

... Of course; you could achieve similar results using A_GiveInventory with custom inventory objects.

A_GiveInventory radius extension

by Major Cooke » Thu May 19, 2011 5:55 pm

Following the expansion suggestion of this, I figured I might as well ask for another alternative; giving inventory items to any or all actors within a specific range, similar to A_Explode's radius.

However, there would also be a few flag suggestions to incorporate as well. The flags would have to be specified in order for certain entities to be applicable for radial inventory reception, (weird saying, much?) but these have NO effect on the calling actor's current codepointer actors. They will receive it regardless of these flags being specified or not.

_MONSTERS - Makes monsters eligible to receive the inventory item.
_PROJECTILES - Ditto, but aimed at projectiles.
_MISC - Things that aren't one of the two above can receive items.

Top