Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Product Chat / HUD Position

Author
Message
Zarok
16
Years of Service
User Offline
Joined: 29th Nov 2009
Location: Gallowmere
Posted: 19th Apr 2012 20:34
Going to keep this simple. Is there no way to reposition an already defined HUD without making a duplicate HUD with a separate name?

(I did search for an answer but nothing that answered my question could be found)

http://darkbasicprogrammingworld.blogspot.com/

Byte < Kilobyte < Megabyte < Gigabyte < Terabyte < Petabyte < Exabyte < Zettabyte < Yottabyte(If only)
Ross tra damus
3D Media Maker
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Looking to Escape London
Posted: 19th Apr 2012 21:44
Zarok
Just open up the script which is running the Hud and change the values you see there.

hudx=50,hudy=90 - This positions a text hud to the bottom of the screen (small Hud)

hudx=50,hudy=50 - This positions a text hud to the centre of the screen (small Hud)

http://i.imgur.com/a07bR.png
Zarok
16
Years of Service
User Offline
Joined: 29th Nov 2009
Location: Gallowmere
Posted: 19th Apr 2012 21:50
No no, I am talking about changing those values when the HUD is already defined. Say, a HUD is at 50x and 50y percentage, I am asking about changing those to other numbers after the HUD has already been displayed in those positions, such as with a key.

http://darkbasicprogrammingworld.blogspot.com/

Byte < Kilobyte < Megabyte < Gigabyte < Terabyte < Petabyte < Exabyte < Zettabyte < Yottabyte(If only)
Ross tra damus
3D Media Maker
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Looking to Escape London
Posted: 19th Apr 2012 21:55
Zarok
Sorry I missunderstood you there, I beleive it can be done via scripting using the 'etimer' commands.

http://i.imgur.com/a07bR.png
Zarok
16
Years of Service
User Offline
Joined: 29th Nov 2009
Location: Gallowmere
Posted: 19th Apr 2012 22:10
I am still not sure you understand what I want to do.

I create the HUD and define its position. Now, I want to be able to, in game, move the same HUD to a new location. That is the same HUD I defined earlier.

http://darkbasicprogrammingworld.blogspot.com/

Byte < Kilobyte < Megabyte < Gigabyte < Terabyte < Petabyte < Exabyte < Zettabyte < Yottabyte(If only)
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 19th Apr 2012 22:22 Edited at: 19th Apr 2012 22:29
plystire knows about how huds work in the code. I remember him saying that once the name of a hud is created in a level it will always remain a part of the level as long as the level exists or is in play. However, this doesn't mean that one might not be able to change the position. However, it will mean scripting the hud positions for that hud at a later time.

I'm assuming that it will need to know the name of the hud in the script line. Although, do we reset the hud by using hudreset, or just change the positions?

:state=0:hudx=50,hudy=50,hudname=test1

Do we reset it?

:state=0:hudreset,hudx=50,hudy=50,hudname=test1

I'm not sure what "hudreset" does?

I'll leave you to test the various possibilities.

Addendum:

I looked at the code for "hudreset." This resets ALL the hud variables for the current workhud: workhudx, workhudy, workhudname, etc. Without looking at what the workhud is (does it mean the hud within the current dynamic entity script? I'm just not sure how it works at this time.

Plystire, if you are, what do you call it when a person is looking but never posting? Maybe you can chime in here.

Zarok
16
Years of Service
User Offline
Joined: 29th Nov 2009
Location: Gallowmere
Posted: 19th Apr 2012 22:40
Simply changing the hudx and hudy percentages later in the code does not change the HUD position unfortunately. I just tested this.

http://darkbasicprogrammingworld.blogspot.com/

Byte < Kilobyte < Megabyte < Gigabyte < Terabyte < Petabyte < Exabyte < Zettabyte < Yottabyte(If only)
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 19th Apr 2012 23:10
I'm not sure exactly what you did. So I will probably do a couple of trial and error tests later tonight (CST).

Zarok
16
Years of Service
User Offline
Joined: 29th Nov 2009
Location: Gallowmere
Posted: 20th Apr 2012 00:29
Okay. In case anyone can offer better suggestions and completely render this problem null - I am trying to make an inventory system. A complex one at that .

The idea was, that for each item in my game I would create a global variable, then when the player has the item the variable would be set to one. When they press a key to open an inventory every item they have would be set as a HUD, including going off screen. They would be in one single line that when the player presses say: the left arrow key, every HUD would be moved left until a "maximum" variable would be reached (created by the addition of every item the player has from the global "on/off" variables set earlier".

The X position of the HUDs would have been set as a variable that incremented after each HUD render, until the maximum variable is reached (By multiplying the earlier "every item addition" by the increment number chosen and setting that as the max variable, then comparing it against the X position variable until equal.)

Then of course the HUDS would be clickable, and would display combine and use options, though that is something that would yet to have been thought out.

That was the most complicated thing I have ever had to explain and I am sure it is full of flaws. =(

But that was my plan. If anyone has any better ideas for a scrolling inventory that updates as items are collected (And not having to have every icon already set but at zero quantity), I am happy to hear.

http://darkbasicprogrammingworld.blogspot.com/

Byte < Kilobyte < Megabyte < Gigabyte < Terabyte < Petabyte < Exabyte < Zettabyte < Yottabyte(If only)
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 20th Apr 2012 01:22
I certainly understand what you are trying to do as I wanted to do it as well. That's why I created RPG Mod and I know a mod is not what everybody wants. RPG Mod has it's own issues but I like how the inventory system works but of course I'm partial. Blackfox might have some thoughts on this. It may not be kosher to put this in script forum but that's the forum Blackfox peruses frequently. You can maybe send him an email and ask him about it. He's been good at creating scripts and such that do not require a mod.

Zarok
16
Years of Service
User Offline
Joined: 29th Nov 2009
Location: Gallowmere
Posted: 20th Apr 2012 01:34
I know, I looked at RPG mod, though I was more interested in the flashlight. (Though it was a little too choppy on low angles which was what I wanted). The inventory commands in that mod would just not suit a survival horror game.

I think the problem with my idea is there are not enough HUD commands in vanilla FPSC. I took a look at the GUI-X9 commands too which has the exact commands I need but they do not accept variables for values which is the cork stopper. =(

http://darkbasicprogrammingworld.blogspot.com/

Byte < Kilobyte < Megabyte < Gigabyte < Terabyte < Petabyte < Exabyte < Zettabyte < Yottabyte(If only)
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 20th Apr 2012 01:41 Edited at: 20th Apr 2012 02:01
Quote: "Going to keep this simple. Is there no way to reposition an already defined HUD without making a duplicate HUD with a separate name?"


No. A script that has a hud defined needs to have a unique hud name. You can have multiple lines defining a hud using the same image file (example: hud1.png) and use different "hudx/hudy" positions, but the "hudname" must be unique and can't be the same as any other in that script.

For example...



Our inventory script we built uses the same hud image that changes position depending on the variable value set when the key is pressed, but we have to give a unique name to the "hudname" value for it to work. So using the code example above, when the player's variable for the item is at value 1, then hud1 is shown in that hud's position. When the variable is at value 2, then hud2 is shown, and so on.


Twitter: @NFoxMedia
Zarok
16
Years of Service
User Offline
Joined: 29th Nov 2009
Location: Gallowmere
Posted: 20th Apr 2012 02:05
Then this might make my life very tricky. I did have the idea of drawing every HUD that is available depending on the items you have five times in five different "Slots" that would unhide the correct HUDs accordingly when keys are pressed to give the illusion of scrolling, but the word efficiency seems to make me shun the idea.

The problem is the amount of items I plan to have in the game and the inability to delete HUDs. And also, if I was to do that could those HUDs even be click-able when shown considering another fifty or so are drawn over it?

I guess I could just use a system that has every item location coded, and depending on the flow of the puzzles place them in certain spots. (Such as when I know the player has to use certain items to be able to even get the other items. But then the only thing that concerns me is the lack of space on smaller resolutions (Unless the HUDs scale accordingly to the resolution?)

That does remind me, does anyone know how to make click-able HUDs in a custom menu? I tried using the pointer HUD and the hudselected command but it did not work.

http://darkbasicprogrammingworld.blogspot.com/

Byte < Kilobyte < Megabyte < Gigabyte < Terabyte < Petabyte < Exabyte < Zettabyte < Yottabyte(If only)

Login to post a reply

Server time is: 2026-07-04 21:57:58
Your offset time is: 2026-07-04 21:57:58