[Help] HUD variables

Making or wanting help making your own asset? Check in here
Post Reply
ah64d_apache_longbow
Posts: 30
Joined: 2011-07-16 21:18

[Help] HUD variables

Post by ah64d_apache_longbow »

Yo yo!

Started editing some PR HUDs and now I have a question. We (HUD editors) all know this part of HUD code.

Code: Select all

hudBuilder.setNodeShowVariable
So when we want to make one node to do something specific E.G. we made a plain text and we want to add function so it prints on screen every time you aim at enemy for example, we copy the code from stock files.

I want to know it a little bit deeper. Where are those Variables located?

I figured there are two types of how to add variable, either add it normally, or add it so it is EQUAL to some other:

Code: Select all

hudBuilder.setNodeLogicShowVariable 	EQUAL GuiIndex 29
or

Code: Select all

hudBuilder.setNodeShowVariable 			HavocTVTargetLabel0Show
So my question is, where are those variables inside of game files available for editing? For example:

This is a part of HUD code that allows text on screen to blink every few seconds...

Code: Select all

hudBuilder.setNodeShowVariable 			TVBlink
How I'd make so it blinks every 10 seconds? So, I'd like to know, where are all of these variables located and ready for editing? Is it Python maybe?

I want to do this, because I'm trying to recreate real-life system for missile launch detection for PR, so every time someone fires a missile in you while your are in aircraft, you get red text printed in right part of screen saying: SAM WARNING

Ty, apache!
sylent/shooter
Posts: 1963
Joined: 2009-04-10 18:48

Re: [Help] HUD variables

Post by sylent/shooter »

hmmm if I'm not mistaken, were you part of the BF1942 modding forums a long while back? Or was that another apache_longbow.... ? Anyways I have no clue about editing this. However, I'm sure someone will help you out. If you can get it to work it'd be really cool to have this in the jets. However IIRC some of the vehicles share HUDS so be careful about that..

Killing the enemy sylently
Hjid
Posts: 75
Joined: 2009-04-28 18:35

Re: [Help] HUD variables

Post by Hjid »

The hud is client side and python is server side. You can interact from server to the client hud through python in a few ways, the main one using the mineevent. But since this event is already used in PR, you can't really interact between python and hud without huge workarounds.

If you are familiar with bf2 con scripting, this might be of interest:

Pastebin.com
Pastebin.com

I made a small script back in august that would print a "delayEnd" into the server messages 3 seconds after you had zoomed in with a sniper rifle. You can however do much more than just printing stuff in the server messages, like moving back and forth different nodes.

This is only using bf2 itself to make delays on the hud. The most accurate (and easiest) way to make delays would be to use an external program to handle the delay.

Or maybe there is a simpler way to make the blink interval longer.
[img]http://www.realitymod.com/forum/uploads/signatures/sigpic33103_1.gif[/img]
ah64d_apache_longbow
Posts: 30
Joined: 2011-07-16 21:18

Re: [Help] HUD variables

Post by ah64d_apache_longbow »

Thanks for the responses, altough I'm still trying to figure out where are the basic/stock BF2 variables located.

What I mean by that? For example, where would be the variable HitDirectionShow from

Code: Select all

hudBuilder.setNodeShowVariable 		HitDirectionShow
be located? This is part of code that prints images from different angles when you are hit. So, what exactly does it call, from which script so it actually happens? Just an example.

Imagine how many new things could BF2 modders and PR Devs get out of this. You could actually make pretty much what you want with the HUD to show you if you could edit that variable.

Thanks, apache!
Hjid
Posts: 75
Joined: 2009-04-28 18:35

Re: [Help] HUD variables

Post by Hjid »

Well I think those variables come from inside bf2, which we don't really have control over. I think you can set the variables using "huditems.setBool variablename 1" as a concmd, but it will still get overrided by the game.

About the possibilities with editing the variable, I think we already have them. You can do:

Code: Select all

hudBuilder.setActiveObject IngameHud someSplitNode
hudBuilder.setNodeShowVariable SomeShowVariable
Which kinda serves the same purpose.
You can also use hudBuilder.setNodePos to move the nodes around aswell.
[img]http://www.realitymod.com/forum/uploads/signatures/sigpic33103_1.gif[/img]
ah64d_apache_longbow
Posts: 30
Joined: 2011-07-16 21:18

Re: [Help] HUD variables

Post by ah64d_apache_longbow »

Thanks!

I kinda figured I wanted too much :)

Now, one more thing - do you maybe know a good site or something where there are all those possible variables listed. If not, never mind then. Thank you for your help!

When I figure out more about this "yet not deeply investigated" part of BF2 modding, I will sure contribute to PR.

apache!
Hjid
Posts: 75
Joined: 2009-04-28 18:35

Re: [Help] HUD variables

Post by Hjid »

I think you can find some info here:

http://www.home.no/kev4000/BF2.txt

It's a string dump of the exe by a fh2 dev. If you search for ShowIngameHud or something like that you will find a bulk of hud related variables.
[img]http://www.realitymod.com/forum/uploads/signatures/sigpic33103_1.gif[/img]
Post Reply

Return to “PR:BF2 Community Modding”