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 / What is wrong with my objectives on screen script?

Author
Message
Silent Thunder
18
Years of Service
User Offline
Joined: 6th Feb 2006
Location: The Ship
Posted: 29th Oct 2006 00:23 Edited at: 29th Oct 2006 00:24
Here is the very first script that i made, so im obviously a noob, for some reason this doesn't work, i was hoping someone could tell me.

Ok, so here's the problem.
I want to make it so that when i press a button, a hud image pops up on the screen.

I made this script, attached it to a dynamic entity and set always active to on.

It displayed the image on my hud all the time, i want it just to display it when i press a button.

does anyone have any ideas as to what i did wrong?

here is my script's code:


Any help would be appreciated!

s4real
VIP Member
18
Years of Service
User Offline
Joined: 22nd Jul 2006
Location:
Posted: 29th Oct 2006 01:17 Edited at: 29th Oct 2006 01:18
Almost right but change the from state=10 to this :

:state=10,scancodekeypressed=41:hudshow=objectives.tga,state=1
:state=1:entitytimerstart,state=2
:state=2,entitytimergreater=6000:state=3
:state=3:hudunshow=objectives.tga,state=0
;End of Script


and it should work fine.

Im a wizz at texturing toilets
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 29th Oct 2006 01:20
Quote: ":state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore/huds/objectives.tga,hudmake=display,state=10
:state=10,scancodekeypressed=41:hudshow=objectives.tga,state=1
"


You left out "hudhide=1" on the "state=0" line so the hud was visible all the time. Also, it's good to use "hudname=objectives" and then "hudshow=objectives" or whatever name you assigned. So the line would be:

:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore/huds/objectives.tga,hudname=objectives,hudhide=1,hudmake=display,state=10
:state=10,scancodekeypressed=41:hudshow=objectives

You then have "state=1" which does nothing and the next line, "state=3" never happens either.

Best.

The forum provides a means to hide our true identity. Too bad we always screw up and let it be seen.

Silent Thunder
18
Years of Service
User Offline
Joined: 6th Feb 2006
Location: The Ship
Posted: 29th Oct 2006 02:14 Edited at: 29th Oct 2006 02:15
First of all, thanks for your guys' help.

ok, now when i start up the game, it doesn't show the objectives screen.

when i press the button it displays it, so that worked.

now the only problem is, when i let go of the key, it just stays there (even after 6 seconds).

how do i get it so that when i release the key, it dissapears?

my current code is this (by the way, i just changed it from the tilde to the Tab button)


any ideas?

xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 29th Oct 2006 14:40 Edited at: 29th Oct 2006 14:46
:state=10,scancodekeypressed=15:hudshow=objectives
:state=1:entitytimerstart,state=2
:state=2,entitytimergreater=6000:state=3
:state=3:hudunshow=objectives.tga,state=0




"state=1" never happens. Place "state=1" at the end of your "state=10" line so:

:state=10,scancodekeypressed=15:hudshow=objectives,state=1

If your timer code is correct (which I have not tested) and the timer works properly, the rest looks like it should hide the hud again after 6 secs. Then it returns to "state=0" and starts all over again, waiting for a keypress.

Also, change the "state=3" line:
:state=3:hudunshow=objectives.tga,state=0

to:
:state=3:hudunshow=objectives,state=0

You should be using the hudname (objectives), not the hud file name (objectives.tga).

Best.

For more information on script progression, visit http://www.fpsfree.com/f10p22s06c/scripts/fpi_script.htm

The forum provides a means to hide our true identity. Too bad we always screw up and let it be seen.

Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 30th Oct 2006 07:37 Edited at: 30th Oct 2006 07:41
Here's how I would do it without using a timer.
It displays when you hold the TAB key and disappears when you let off of it.




Don't forget to visit Conjured Entertainment
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 30th Oct 2006 14:55
Very slick and simple Conjured.

I can use this for other things.

Thanks.

The forum provides a means to hide our true identity. Too bad we always screw up and let it be seen.

Silent Thunder
18
Years of Service
User Offline
Joined: 6th Feb 2006
Location: The Ship
Posted: 31st Oct 2006 00:46
thanks s4real, xplosys, and conjured, this will come in handy, thanks for helping to fix it.

Brians 8ball
18
Years of Service
User Offline
Joined: 19th Oct 2006
Location:
Posted: 20th Nov 2006 17:27
hey, im no good with scripting (yet) i do a little with old games just to get a hang on it.

but can you post that finished objectives script? it would be preaty cool to have
Reality Forgotten
FPSC Reloaded TGC Backer
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Wichita Falls TX
Posted: 25th Nov 2006 11:58
nice!

FredP
Retired Moderator
18
Years of Service
User Offline
Joined: 27th Feb 2006
Location: Indiana
Posted: 25th Nov 2006 15:28
If you check out the program Signs it will let you make a screen like that where you press a key and hold it down and the hud appears and when you let go of the key it disappears.
There are also variations of it.
Like when you let go of the key the hud will be destroyed.
There is also the ability to add a audio or video clip to the sign.
It is a very handy program and I would check it out.
And anybody who knows the least little bit about scripting can substitue other scripts as the main AI script as well.

Silent Thunder
18
Years of Service
User Offline
Joined: 6th Feb 2006
Location: The Ship
Posted: 25th Nov 2006 17:39
oh yea, sorry, ill post the script here.

there you go, have fun!

Attachments

Login to view attachments
Inverted
18
Years of Service
User Offline
Joined: 19th Nov 2006
Location: Oregon
Posted: 26th Nov 2006 22:22
Awesome script conjured.
Where do I put it to make it useable

Opposites are different, not wrong
Silent Thunder
18
Years of Service
User Offline
Joined: 6th Feb 2006
Location: The Ship
Posted: 26th Nov 2006 23:57
Quote: "I made this script, attached it to a dynamic entity and set always active to on."


just put it in your scriptbank\user folder i guess.

Inverted
18
Years of Service
User Offline
Joined: 19th Nov 2006
Location: Oregon
Posted: 3rd Dec 2006 01:01
Hey guys,
Im just wondering,
How would i make it so that the objectives stay on the screen until you press the key again.

So when you press the "F" it stays on the screen, and then when you press it again they dissapear.

Iv been messing with conjureds script but cant get it to work, this is what i have:



Right now it just stays up on the screen forever after I press F once.


Thanks in advance,
-Inverted

Opposites are different, not wrong
Nickydude
Retired Moderator
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Look outside...
Posted: 3rd Dec 2006 01:13 Edited at: 3rd Dec 2006 01:14
Shouldn't the last state=3 be state=4? I'm not to sure about scripts so I could be wrong


Inverted
18
Years of Service
User Offline
Joined: 19th Nov 2006
Location: Oregon
Posted: 3rd Dec 2006 01:25
That makes sense, but when i do that nothing even shows up now

Opposites are different, not wrong
Inverted
18
Years of Service
User Offline
Joined: 19th Nov 2006
Location: Oregon
Posted: 3rd Dec 2006 02:47
Can somone help?

Opposites are different, not wrong
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 3rd Dec 2006 03:52
The problem is that when you press a key it can signal the scancodes more than once.
So, after we check for a key, we should then check for the release of it (scancodekeypressed=0) before we check for that same key entry again.
Try this ...



Hope this makes sense.

Don't forget to visit Conjured Entertainment
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 3rd Dec 2006 04:20
Thanks again Conjured. Your wisdom is exceeding.

Best.

The forum provides a means to hide our true identity. Too bad we always screw up and let it be seen.

G4fan
18
Years of Service
User Offline
Joined: 21st Oct 2006
Location: in my car, driving on and on. . .
Posted: 6th Dec 2006 02:20
Conjured Entertainment, your script is not workling for me. I think i'm the one doing something wrong. I want to attach this script to a map (in the ww2 entity section). This, in my first level is a primary objective. I acually don't want this to be displayed as an objective screen-script. I've created a map on Photoshop of the area.

In the entity's prefrences:

1= Must I have the entity dynamic or static?
2= Is "Always active" still in affect in the on position?
3= Must I type in something in the "If Used" section?

Thank you. You are a great programmer.

My first game: "Wars of Crime"-5% completed
Silent Thunder
18
Years of Service
User Offline
Joined: 6th Feb 2006
Location: The Ship
Posted: 6th Dec 2006 03:12 Edited at: 6th Dec 2006 06:22
Quote: "I made this script, attached it to a dynamic entity and set always active to on."


read.

Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 6th Dec 2006 06:04
Quote: "
1= Must I have the entity dynamic or static?
2= Is "Always active" still in affect in the on position?
3= Must I type in something in the "If Used" section?
"


1) Any entity running a script should be set to DYNAMIC (static mode = no)
2) Yes
3) No, not for this script.

Here are step by step instructions using a generic entity like a blood-splat overlay.

1) Save that script as an FPI file in your scriptbank.
2) Place a blood-splat or other invulnerable entity in your map.
3) Set the blood-splat's STATIC MODE to NO
4) Set the blood-splat's ALWAYS ACTIVE to YES
5) Set the blood-splat's AI MAIN to the script

I hope i didn't forget anything, so let me know if it still doesn't work.
Oh, and make sure you have altered the path in state=0 to read for your objective image...
hudimagefine=gamecore/huds/war.dds

Also the path is really in the languagbank/english/gamecore not the other one, so put the image there.
You don't need to include the languagbank/english in the path in the script though.

Hope this helps

Don't forget to visit Conjured Entertainment
Foxhound7
18
Years of Service
User Offline
Joined: 19th May 2006
Location:
Posted: 13th Jan 2007 22:38
how could this script be modified so it displayed the ammo for the current weapon the player has out?

Your signature has been erased by a mod
vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 14th Jan 2007 00:18
why do you have to apply the script to a dynamic entity? why not just implant it into the setuplevel.fpi script? it should make the whole process easier

so what's the job?

Login to post a reply

Server time is: 2024-11-23 09:03:29
Your offset time is: 2024-11-23 09:03:29