Reference to virtual function

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: Reference to virtual function

Re: Reference to virtual function

by Apeirogon » Mon Mar 12, 2018 10: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.

Re: Reference to virtual function

by Kotti » Mon Mar 12, 2018 8:59 am

In short: Not possible.

Re: Reference to virtual function

by Blue Shadow » Mon Mar 12, 2018 8: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().

Re: Reference to virtual function

by Apeirogon » Sun Mar 11, 2018 12: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.

Re: Reference to virtual function

by Graf Zahl » Sun Mar 11, 2018 12:46 pm

I cannot make any sense of this post. This reads like a completely botched Google translate job.

Reference to virtual function

by Apeirogon » Sun Mar 11, 2018 12: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 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.

Top