I want to use LineTrace() from the linetracer class in the DrawStatusBar class() or a class inherited from DrawStatusBar to be exact and I still have no idea how I'm supposed to do that.
I tried creating a static function but I get an error telling me "non static function called in a static context" (something like that), when I remove the static keyword it tells me that the function LineTrace() is unknown
(Zscript) using a non static function outside the class
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49071
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: (Zscript) using a non static function outside the class
In short: You can't! Any non-static function requires an instance of its containing class to work.
Re: (Zscript) using a non static function outside the class
anyway arround it then? The information for the parameters it requires can only be found in the DrawStatusBar class (CPlayer.mo. and something like that)
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49071
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: (Zscript) using a non static function outside the class
No way around it. Think about the calling class as an additional parameter. And if you leave out some required parameter from a normal function (e.g. call a print function without text) it cannot function. The same applies here.