SBARINFO?

Need help with your project? Ask here.
User avatar
Janitor
Persecution Complex
Posts: 123
Joined: Sun Jul 08, 2007 17:16
Location: Not in Kansas anymore

SBARINFO?

Post by Janitor »

ok, I have a question:
I am in the process of making a weapons mod, and I have a slight problem. My guns reload, but the altfire of each weapon uses a different type of ammo and each weapon features a third mode of fire ("mighty foot") I want my HUD to display. So every weapon has 2 different types of ammo, and i dont know how to make it display both. is there a way to make a custom HUD display this?
User avatar
wildweasel
DRD Team Admin (Inactive)
Posts: 2132
Joined: Wed Jun 29, 2005 22:00
Location: the Admincave!
Contact:

Post by wildweasel »

You can display primary and secondary ammo using SBARINFO quite easily, actually - say you want an ammo indicator for the first mode of fire.

Code: Select all

drawnumber 3, BIGAMMOFONT, blue, ammo1, 320, 0, 1;
But since you say you want a display for the alternate ammo as well, try this too:

Code: Select all

drawnumber 3, BIGAMMOFONT, blue, ammo2, 320, 25, 1;
The key there is using the ammo2 keyword. As for the mighty foot display, have you tried using drawimage, or better yet, DrawString (for displaying using a defined font)?
User avatar
Janitor
Persecution Complex
Posts: 123
Joined: Sun Jul 08, 2007 17:16
Location: Not in Kansas anymore

Post by Janitor »

let me be a little more specific:
for example, weapon 1 has 2 ammo types and, of course, mighty foot
So i have the Inventory Items:

Code: Select all

Colt1911Magazine
Colt1911Ammo

DumDumMagazine
DumDumAmmo

PowerKick
(where the "Magazine" is the number of bullets in the Gun and "Ammo" is the amount of bullets remaining)
so i want the HUD to show something like this:

Code: Select all

Primary:   12/120
Secondary: 4/50
Note, also, my guns don't use the altfire function to fire, altfire invokes a "switch ammo" animation, where the gun is lowered a little and the type of ammo is "swapped" (this code is extremely long :shock: )
essentially, i would like my hud to do the following:

It should show the amount of ammo left and the amount in the magazine, and when the alternate fire is invoked, it should switch what ammo is currently being displayed. Likewise, the secondary ammo should show how much ammo is left overall as well as the amount in the magazine. it reloads bullets, not clips. I'm thinking i may have to script this with ACS instead of SBARINFO. any thoughts?
User avatar
MR_ROCKET
Posts: 35
Joined: Sat Sep 17, 2005 18:04
Contact:

Post by MR_ROCKET »

Hey this post has more to do with HIRESTEX but pertains to a HUD entity so I figured what the heck..:D

I'b been fixing up a hi-res version of the original HUD face and I have it all working in a pk3 format with nothing more than a grahpics directory with all the hi-res replacments (same names as originals) in it and a HIRESTEX.txt at the root.

Anyways, as said everything's working right in the hi-res aspect, replacing the original and scaling. But I'v ran into a small problem, I can't figure out how to set it's off-sets.lol
I'v looked around here and at the wiki but found nothing about HIRESTEX off-sets, unless there's something I'm over looking.
This is what I currently have for each different frame in HIRESTEX.txt

Code: Select all

define STFST00 24 31
But I need to offset them about 6 units to the right and about 5 units down.
As is it looks like this:
Image

I would try something like this:

Code: Select all

define STFST00 24 31
{
  offset -6 -1.5;
}
But I doubt it would work heh.
Anyone know how to manage the offsets in HIRESTEX without anything else?, there is no TEXTURE1, PNAMES, or ACS here. Just HIRESTEXT.txt

I would go as far as adding all the original frames into wad format and modding the TEXTURE1 and then pack it like that but If there is a single line I need to add to the HIRESTEX that would give me some offsets that would be wonderful. :D
Thanks!
Last edited by MR_ROCKET on Wed May 14, 2008 5:04, edited 2 times in total.
User avatar
MauricioRocks
Posts: 30
Joined: Sun Feb 10, 2008 18:16
Location: São Paulo

Post by MauricioRocks »

well, I have an doubt about SBARINFO!

I have a custom hud made of acs scripts.. it changes the color based on the player health and ammo (eg: if the player have more than 25 of life, the hud is displayed in green, if the health is less than 25, the hud will be yellow, and below 10, the color change to red) can this be done using SBARINFO?

I need this 'cuz that hud doesn't work on multiplayer games =\
User avatar
MR_ROCKET
Posts: 35
Joined: Sat Sep 17, 2005 18:04
Contact:

Post by MR_ROCKET »

Yeah I heard about that, though in this case I'm not having a problem with scaling or a Pname sibling. I just need some off-sets! :D
But I did notice Grafs reply on the Zdoom forum so maybe this is what I'm running into also.
User avatar
MauricioRocks
Posts: 30
Joined: Sun Feb 10, 2008 18:16
Location: São Paulo

Post by MauricioRocks »

Can I dry a specific image based on the amount of certain inventory item? let's talk about heatlh.. Can I draw different images based on the health amount? and about ammo?
User avatar
MR_ROCKET
Posts: 35
Joined: Sat Sep 17, 2005 18:04
Contact:

Post by MR_ROCKET »

Ah your talking about using SBARINFO to load an image and ACS which I'm sure should let you change the image at a given amount.
I don't see why not, it's just that HIRESTEX isn't working like it should right now I guess.

In a pwad H_START and H_END is the alternative, as long as the image doesn't need scaled..However the image Name will need to already exist, if it doesn't, you'l have to make it as a placeholder, and then add the hi-color version.

Would probably be better off waiting for HIRESTEX to get fixed first though.
User avatar
MauricioRocks
Posts: 30
Joined: Sun Feb 10, 2008 18:16
Location: São Paulo

Post by MauricioRocks »

MR_ROCKET wrote:Ah your talking about using SBARINFO to load an image and ACS which I'm sure should let you change the image at a given amount.
No! my hud actualy change the color based on inventory items, but the ammo is not displayed correctly on multiplayer games (only the fist player can see the right amount of ammo)... so, I'm asking if this can be done with SBARINFO, so I will rescript the whole hud using thi lump...
User avatar
MR_ROCKET
Posts: 35
Joined: Sat Sep 17, 2005 18:04
Contact:

Post by MR_ROCKET »

Ah well you might have to use a thingID tag pertaining to the player0-3 in ACS constantly checking the player# ammo and health amount and updating if need be.
I'm not sure about doing it with SBARINFO though, possibly a combination of both.
I don't want to be misleading, I'm no script guru, this is just my guess.

Seems like part of the time there are issues with multiplayer stuff most of it having to do with an anti-cheat where the server is only allowed to let the clients get what they want.
I wouldn't really know without going in and trying out the same thing that you are currently though, you know what I mean. I can only retain so much scripting stuff to begin with heh.
Post Reply

Return to “Editing Help”