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 / Store Medkit Script and Quick Time Event

Author
Message
BedsideReaper
13
Years of Service
User Offline
Joined: 4th Feb 2011
Location: Lakewood, WA
Posted: 1st Apr 2013 04:57
Hey guys. BedsideReaper here. Today I'm asking for some help making a script and I'm also going to show you another script that I've made for one of my upcoming games.

First, we'll start off with the one already done. For my game Stronghold, I was trying to devise some ways to pace the gameplay better and do something a little unconventional as of yet (to my knowledge, at least). This came to be a sort of quick time event where the player repeatedly presses the action button to force open vent doors in a way inspired by the amazing title Batman: Arkham Asylum. In the youtube video linked below, I show the script in action. I'm not sure I want to release the script at this moment as I would like to release a whole pack of them once the game is released. But I may change my mind, so keep an eye out!

Next up, I was wondering if anybody could please help me work out this particular script that has been giving me a whole heap of trouble. I'm aiming for a simple way to allow the player to collect a total of three medkits (in this case, pill bottles) and use them to heal themselves at will. I've been trying to do this without using variables (looking back, it seems this maaay be impossible). Here's what I have so far:



The above is the result of me just trying to get the basic conventions of the script to work. I have failed horribly. In the video, you can see that I CAN pick up the bottles, but the HUD icon showing the player that he has a medkit in his inventory simply fades immediately, and I also cannot heal myself after hitting the designated key. I've been working on this for the past two days, and I've been chopping and adding so long that even Ezekiel thinks that my mind is gone. So, I'm utterly confused, but really excited to show you my first true custom script and I hope you guys like it and can help me. Thanks for reading guys!

BedsideReaper

P.S. In the spirit of Easter, I've also added footage of a special "Baby Chicken Script" to the video. Hope you enjoy.


http://youtu.be/JXWTe7kPwqk


"I think I'm getting the 'Black Lung,' pop."

"Derrick, you've been down there for one day."
Corno_1
13
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 1st Apr 2013 18:30
It should be simple. Use instead of destroy(which destroy the entity and so the script too) playertake.


Very good work. I would do it with variables, but maybe you have a reason not to do.

Also you can clean it up a little bit:


What makes me wonder, why you name your game after a strategy game?http://www.stronghold3.com/

Quote: "quick time event"

I do something similar in my game. I will not release my script, because it has more than 100 line, because it also tells a story within game...
Watch for my game alternate Corno


Corno_1


BedsideReaper
13
Years of Service
User Offline
Joined: 4th Feb 2011
Location: Lakewood, WA
Posted: 1st Apr 2013 22:11
Thank you, my good sir! The hud stays and I properly collect the pills, but I'm still not able to press the designated key and heal myself. Looking at the lines, it looks like it should definitely work. Maybe it's cuz I'm using 1.20 beta 7.

Can anybody confirm that it's not working for them on another version of FPSC? Thanks!

"I think I'm getting the 'Black Lung,' pop."

"Derrick, you've been down there for one day."
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 2nd Apr 2013 19:54 Edited at: 2nd Apr 2013 19:56
@ BedsideReaper
Try this, It's what I've been using and it works just fine 1.20.15
I have had some problems with action "hudfadeout" when using multiple huds,so i just use the "hudunshow". Take a look at mine,it's similar with only a few changes.Give each bottle its own script..given 3 bottles
bottle #1

bottle #2

bottle #3

Note the position also the the hud's x&y as to not overlap.
Also the etimer is just for a delayed effect.

Almost forgot, you must set the entity to "alwaysactive=yes"
or it wont work.
BedsideReaper
13
Years of Service
User Offline
Joined: 4th Feb 2011
Location: Lakewood, WA
Posted: 20th Apr 2013 14:58 Edited at: 20th Apr 2013 14:59
Hey guys. I'm just gonna comment here rather than making another post and cluttering eveything up. I'm still working on the above script and I still can't get it to work for some reason. But I'm having really bad troubles with this new script I'm devising. It's running me ragged.

Okay, this may be a reeeeaaaally long script, but I promise, if we can get through it, free quick time events for all!

The scene goes as this:
The player enters a dark, musty area where a furnace burns brightly in the corner. After taking out the nearby thugs, the player states to himself: "This guy dropped the key in the furnace. Okay, let's get this over with." Then a small mini game comes up that shows you a meter of the furnace's varying heat levels, with the middle portion indicating the correct time to hit enter, in which the player will receive a key. If the player hits the action button at the wrong time, he is hurt.

Below, I have made a script which I've picked up from another starting point, and chopped and bobbed away. With the current script that I've provided, the final hud animation is stuck on screen, and whenever I hit enter, the player is hurt regardless, the audio does not play and for some reason, my segments seem to get misplaced.



Now, if you took the time to basically read that whole monster, than thank you, veeeery much. Any help would be highly appreciated. I'm pulling my own hairs out trying to figure out where the errors are starting. It's definitely not finished writing the "skeleton" of the script, but what I have so far should show a sample of the hud animation and it's purpose. But thanks guys ahead of time for any help!

BedsideReaper

"I think I'm getting the 'Black Lung,' pop."

"Derrick, you've been down there for one day."
Burger
11
Years of Service
User Offline
Joined: 22nd Jun 2012
Location: New Zealand
Posted: 21st Apr 2013 02:19
Well, I looked through the script. I haven't fully analysed it or anything, but I cant see conditions for success, only failure and 'plrsubhealth=1'. If there's nothing to detect the player hitting the key at the right time, you'll always lose health, right?

Also, it may be easier to use plrfreeze or plrdisable, that will save all of those plrdistwithin's.

- An Instinctive Fear IndieDB page, download demo today!
BedsideReaper
13
Years of Service
User Offline
Joined: 4th Feb 2011
Location: Lakewood, WA
Posted: 21st Apr 2013 03:33
Thanks for commenting.

The conditions for success will be at huds furnace16 to 18, I was just trying to get the animation to work, but it's not working for me. Later tonight, I'm gonna take a sledgehammer to this script and try finding out why the animation doesn't work.

"I think I'm getting the 'Black Lung,' pop."

"Derrick, you've been down there for one day."

Login to post a reply

Server time is: 2024-05-03 06:00:36
Your offset time is: 2024-05-03 06:00:36