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 Scripts / Hud script help

Author
Message
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 27th Jan 2009 01:00
i just made this health hud script that is still a work in progress but from what i have done it should at least show the hud when the health =#. But in stead i apply the script to an enemy and when i spawn i get a non transparent eye hud over the screen. Heres the script




]

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 27th Jan 2009 01:30
Put this at the top of your script:

desc = This is a script


I recall from a while ago that scripts needed to have the "desc" set at some point. I thought Lee removed that requirement, but hey, it couldn't hurt o try.


The one and only,


Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 27th Jan 2009 01:31 Edited at: 27th Jan 2009 01:49
alright ill go try and ill edit this post to tell you what happens


EDIT: it works but an old hud that i remade and saved over is now showing. Which is wierd

]

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 27th Jan 2009 21:52
ok i fixed it but now i want to know if their is anyway to melt this script down because its 120-130 lines and i need to add another about 50 lines and i believe the max amount is 150

]

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 27th Jan 2009 22:29
Looks like you're trying to do some sort of numeric system for the player's health...


If that's what you're doing, I have a much easier way.


The one and only,


Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 27th Jan 2009 22:47
egh not the players health but something like that. So whats your suggestion?

]

Dar13
16
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 28th Jan 2009 02:13
hockeykid: do you use the official version or a modded version?

I know not with what weapons WWIII will be fought but WWIV will be fought with sticks and stones-Albert Einstein
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 28th Jan 2009 02:21
the official version

]

Dar13
16
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 28th Jan 2009 02:35
you could try Ply's suggestion or just link to another script that continues on from that script using variables.

I know not with what weapons WWIII will be fought but WWIV will be fought with sticks and stones-Albert Einstein
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 28th Jan 2009 02:45
ply never told me what i should do to make it smaller and linking it to a script wouldn't work for what i'm doing

]

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 28th Jan 2009 09:38 Edited at: 28th Jan 2009 09:51
Ahhhh, I see where this is going now. You're trying to make a counter for your allies, am i right?


Well, the idea I had wouldn't work for that, unfortunately.

Here's another idea...

Have the counter check for a range between the 10's.
So like check for the health being between 90 and 99 to display the "90" hud, check for the health between 80 and 89 to display the "80" hud, etc.

Here's the tricky part, for each of those ranges, set a local variable to that range's number... so if in the 90's set the var to 9, if in the 80's set the var to 8, etc. And then REMOVE that much health, minus 1, from the entity... so if in the 90's remove 89 health from the entity, if in the 80's remove 79 health, etc.

This will leave the entity with 1-10 health left.

Now check for the health value directly from 1 to 10, displaying the ones digit hud appropriately... minus 1
So if the health is 10 the display the 9 hud, if the health is 8 display the 7 hud, etc. etc.

Now after displaying the appropriate hud, check the variable you set earlier and give the entity their health back.


Maybe that'll consolidate a lot of the repitition going on in your script.


Actually, here's a quick script for you to look at:



Think something like that would work for you?

This script won't work as-is. You'll need to either use states, activation values, or another localvar to make sure that after the health has been removed, it doesn't get picked up in the check for the "10s" range. And also, if a range wasn't found (meaning the health was below 10) then to use a regular 1-9 check for displaying the 1's digit.


The one and only,


Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 28th Jan 2009 22:10
Quote: "Ahhhh, I see where this is going now. You're trying to make a counter for your allies, am i right?
"


exactly but that was suppose to be a surprise

and unfortunately i don't think your scripts gonna work because each hud is a single number

]

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 29th Jan 2009 01:03
The script is designed to work like that. Each hud should only have a single number in it.

And it was a bit of a giveaway about your plans since I can see "hudimagefine=ally\allyhealth.dds" in our script.


The one and only,


Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 29th Jan 2009 03:26
oops anyway i got most of it worked out except after his health changes he disputes the rest of the script

]

Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 30th Jan 2009 02:58
Quote: "This will leave the entity with 1-10 health left.

Now check for the health value directly from 1 to 10, displaying the ones digit hud appropriately... minus 1
So if the health is 10 the display the 9 hud, if the health is 8 display the 7 hud, etc. etc.

Now after displaying the appropriate hud, check the variable you set earlier and give the entity their health back."


Just hope you don't get shot when the health is low....lol

I raise the health to a higher number, then bring it back to what it was.
That way you don't risk dying during the health count.

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 30th Jan 2009 03:02
Conjured thanks for trying but i already figured it out ( try out my ally script its implemented into their)

]

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 30th Jan 2009 03:03
You don't have to worry about the entity dying, CE. The script is run in it's entirety before anything else happens.


@hockeykid:

Did you manage to implement this, btw?


The one and only,


Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 30th Jan 2009 03:05
yes, i did(not your way though) i updated my post on my ally script a little bit ago check it out.

]

Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 30th Jan 2009 03:08
Quote: "try out my ally script its implemented into their"

Okay, but don't say I stole your ideas when I make an allies script of my own.
I never made one before because I had no control over entity health, but we do now in v113 so I am going to start one soon.
I want controls for four allies so you can toggle between them for controlling all four independently.
I was thinking the glow decal under the one being controlled would be nice.

I'll go check out your allies script now.

Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 30th Jan 2009 03:12
isnt that just like your puppet script? and couldn't you just run that off a main script and have it run a certain script when button pressed?

]

Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 30th Jan 2009 03:15
Alot like the puppet script, only yes, it will be more automated.

So yes, you send a command to one of the allies and as he is carrying out that command you have toggled and commanded another.

That way all four can be worked independently simutaneously.

I'm thinking of activated states for each individual since they will all have the same name.
So, each script will only accept a new command when the entity is in that activated state.
So toggling the activation will toggle control.

Login to post a reply

Server time is: 2024-11-24 18:59:29
Your offset time is: 2024-11-24 18:59:29