Reference to virtual function

Moderator: GZDoom Developers

Post Reply
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Reference to virtual function

Post by Apeirogon »

Lack of opportunity get result of virtual function from master.target.first wife of the third sisters husband.cancollidewith, without overriding this virtual function. And this not every time possible.

I mean, make result of, say damage mobj, of some actor, say player, acessible from any other actor(I know about world thing damage) which monitor state of this function on this actor every tick.
Or, if function void like attach to owner, return "true"/"called"/"one", which means "actor such-and-such called function 'attach to owner' ", which means "actor such-and-such receive something...because he call function which calls every time that some item become part of actor inventory". Like

Code: Select all

class 911 : inventory
override void do effect()
{
if(owner called "damage mobj(function arguments)") {console.printf("MOM CALL 911, ARMY, GALACTIC FLEET AND CHUCK NORRIS!!!ONEONE");}
}
Basicaly, it CAN be done at the current state of things, using dummy actors and inventory items. But this way require calls to 15-20 functions, 5-7 of which calls every tick, which hurt to performance.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Reference to virtual function

Post by Graf Zahl »

I cannot make any sense of this post. This reads like a completely botched Google translate job.
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: Reference to virtual function

Post by Apeirogon »

Probably I overdo with explanations.

Substantially, actor have some virtual function named "test", which is called in specific situations. And I want to know is actor call this specific virtual function "test" or no, without overriding it.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Reference to virtual function

Post by Blue Shadow »

I don't know if it matters much. But, I think he wants a way to detect if a function (a virtual, in this case) has been called, and then act upon it. Like in his example with DamageMobj(): if owner has called the function, i.e. got damaged, do X, otherwise do Y. He wants to achieve this without overriding DamageMobj().
Kotti
Posts: 86
Joined: Tue Dec 27, 2016 4:08 am

Re: Reference to virtual function

Post by Kotti »

In short: Not possible.
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: Reference to virtual function

Post by Apeirogon »

Blue Shadow wrote:I don't know if it matters much. But, I think he wants a way to detect if a function (a virtual, in this case) has been called, and then act upon it. Like in his example with DamageMobj(): if owner has called the function, i.e. got damaged, do X, otherwise do Y. He wants to achieve this without overriding DamageMobj().
Yes, that hat I means.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”