Custom Debug Log

Dr.Cranium

New member
Is there any simple way for me to output the contents of a char variable from a takedamagescript either on screen or to a file?

I have tried using the drawstring command but, as warned by the OpenBOR's Legacy Manual, my text just blinks briefly on screen , making it simply impossible to read.

I thought about moving it to an update script but I guess that it would bring me a whole new lot of problems by doing so, right? What's the most straightforward solution for this scenario?

All I need to know is the exact name for my player's current model void PWep = getentityproperty(self, "model"); so I can identify the weapon that is currently being carried.

Thanks in advance!
 
You can use text objects or drawstring in an update to put text on the screen. If you want to output something to the log, use log({string}). Since OpenBOR script is weak typed, you can feed it just about anything. It also accepts typical C string codes like "\n" and "\t".

DC
 
All I need to know is the exact name for my player's current model void PWep = getentityproperty(self, "model"); so I can identify the weapon that is currently being carried.

I have this simple script I usually declare for debugging, just declare it in entity's header text and edit the content:
C:
script    @script
void main()
{
    void self = getlocalvar("self");
    void PWep = getentityproperty(self, "model");

    drawstring(50,100,2, PWep);
}
@end_script

HTH
 
If you want to output something to the log, use log({string})

Thank you so much mr. DC!

It's so damn simple, I almost feel guilty for cluttering the forums with such a newbie's question.

Is there any documentation available for this kind of basic commands?

I have this simple script

As always, your scripts are real life-savers, mr. Bloodbane!

Muchas gracias amigos! 💀🙏
 
Last edited:
Back
Top Bottom