Fully functioning 3D hudmessage script

Looking for Resources for your mod/project? Want to share some of your creations so others can use them? Post them here!
Post Reply
User avatar
ZZYZX
Posts a lot
Posts: 742
Joined: Thu Jun 07, 2012 5:56 pm
Location: Ukraine
Clan: A3
Clan Tag: [A3]

Fully functioning 3D hudmessage script

#1

Post by ZZYZX » Wed Jun 22, 2016 6:09 pm

HI, finally made this.

The script separately: http://pastebin.com/9hqEzjR2
Example map: http://www.mediafire.com/download/u48iq ... 3/MEOW.wad

Use it by calling DrawText3D with the following arguments:
string — the text string to be drawn.
id — identifier of the hudmessage.
color — CR_ constant.
x, y, z — coordinates (in world space) of the hudmessage.
px, py, pz — coordinates of the camera.
fang — angle of the camera.
YAng — pitch of the camera.

People are free to use the script in whatever ways possible, I don't care.

Notes:
  • This is actually 3D, and as such only works for OpenGL renderer, for software version see HudMessageOnActor in the wiki.
  • Even though it mostly works under 2.0, there's no HUDMSG_NOWRAP in it and the text string will be wrapped once it's too close to the camera. 3.0 is advised.
  • Movebob/stillbob aren't implemented. An example on how to implement movebob is here (function CalculateBob, note that it's unfinished too).
  • FOV isn't implemented, only 90.
Last edited by ZZYZX on Wed Jun 22, 2016 8:36 pm, edited 3 times in total.

Catastrophe
Retired Staff / Community Team Member
Posts: 2558
Joined: Sat Jun 02, 2012 2:44 am

Re: Fully functioning 3D hudmessage script

#2

Post by Catastrophe » Wed Jun 22, 2016 7:11 pm

Very cool. Though I imagine there's no way to prevent the message from appearing through walls?

User avatar
ZZYZX
Posts a lot
Posts: 742
Joined: Thu Jun 07, 2012 5:56 pm
Location: Ukraine
Clan: A3
Clan Tag: [A3]

Re: Fully functioning 3D hudmessage script

#3

Post by ZZYZX » Wed Jun 22, 2016 7:16 pm

There is, if you do LOS checks with combination of a dummy thing+SetActorState. Not true Z-clipping if you mean that though.


User avatar
ZZYZX
Posts a lot
Posts: 742
Joined: Thu Jun 07, 2012 5:56 pm
Location: Ukraine
Clan: A3
Clan Tag: [A3]

Re: Fully functioning 3D hudmessage script

#5

Post by ZZYZX » Wed Jun 22, 2016 9:04 pm

Should've advertised it more. For whatever reason most people I asked don't even know about that library, notably TMC who asked me to do this :P
Korshun's implementation seems to be a bit better though, not sure (the video is short and lowres, and there was a weird bug in my version where the message would be off by 0.5-2 degrees sometimes).
My version is also posted at ZDoom :P

User avatar
StrikerMan780
Forum Regular
Posts: 279
Joined: Tue May 29, 2012 9:16 pm
Clan: Shadow Mavericks
Clan Tag: [SM]

Re: Fully functioning 3D hudmessage script

#6

Post by StrikerMan780 » Wed Jun 22, 2016 10:23 pm

I don't see how this would be OpenGL-Only looking at the script. It just scales the hud size depending on distance. SetHudSize works fine in Software.

User avatar
ZZYZX
Posts a lot
Posts: 742
Joined: Thu Jun 07, 2012 5:56 pm
Location: Ukraine
Clan: A3
Clan Tag: [A3]

Re: Fully functioning 3D hudmessage script

#7

Post by ZZYZX » Wed Jun 22, 2016 10:35 pm

Have you tried running it in software and looking up/down? The message will be moved in real 3D, while the map will be shown in 2.5D using the same formula as HudMessageOnActor.
This is at least until I make a valid library out of this, that'd support Z-sorting, visibility clipping, statusbar clipping (current behavior is weird) and other useful things.

Post Reply