[???] Reference to virtual function

Moderator: Developers

Reference to virtual function

Postby Apeirogon » Sun Mar 11, 2018 1:40 pm

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 allExpand view
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.
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Reference to virtual function

Postby Graf Zahl » Sun Mar 11, 2018 1:46 pm

I cannot make any sense of this post. This reads like a completely botched Google translate job.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Reference to virtual function

Postby Apeirogon » Sun Mar 11, 2018 1:55 pm

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.
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Reference to virtual function

Postby Blue Shadow » Mon Mar 12, 2018 9:17 am

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().
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010

Re: Reference to virtual function

Postby Kotti » Mon Mar 12, 2018 9:59 am

In short: Not possible.
Kotti
 
Joined: 27 Dec 2016

Re: Reference to virtual function

Postby Apeirogon » Mon Mar 12, 2018 11:20 am

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.
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 4 guests