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 / plraddhealth not acting as expected

Author
Message
Yugo
11
Years of Service
User Offline
Joined: 20th May 2013
Location:
Posted: 20th May 2013 07:18
Hello,
When I add the plraddhealth action to a script, my health does not change.



However, if I use the same scrip and use the plrsubhealth action, my health declines as expected.



Any insight is most appreciated. I'm new to fpi scripting, though not new to scripting as a concept.

Cheers,
Yugo
Aarchduke
13
Years of Service
User Offline
Joined: 10th Aug 2011
Location: United Kingdom
Posted: 20th May 2013 20:35
I did a quick test with your script, and it works fine for me when I put it in a trigger zone. Are you wanting this to be attached to a dynamic entity?

-Duke.

So we beat on, boats against the current, borne back ceaselessly into the past.
Yugo
11
Years of Service
User Offline
Joined: 20th May 2013
Location:
Posted: 20th May 2013 21:04
I received an email saying someone posted on this thread, but I don't see it. I guess I'm still figuring out the nuances of this forum.

To answer the phantom post, I am attaching this script to a dynamic entity. An NPC to be specific. If this isn't "normal", is there a way to tie it to an NPC. I'm creating an RPG type of interaction where based on a conversation health will either be added or subtracted. The plrsubhealth works fine in this scenario.

By the way, I'm running v1.19.

Thanks!
Aarchduke
13
Years of Service
User Offline
Joined: 10th Aug 2011
Location: United Kingdom
Posted: 20th May 2013 22:42
Sounds interesting!

I tried again with the script attached to an NPC, and both worked fine... I'm sure that you are, but just in case, are you aware that the player's health can't exceed the amount laid out in the player start marker (e.g. 100)? I forgot and thought it didn't work, but when I reduced my health in a hurt zone first, and then went back to the NPC, it increased my health by one - just like in the script.

I made a tiny tweak to the script as well, just changed the state from 200 to 1, which activates every time you go near the NPC, not just once (Although you may not want that?)



Hope I helped, Let me know

-Duke.

So we beat on, boats against the current, borne back ceaselessly into the past.
Yugo
11
Years of Service
User Offline
Joined: 20th May 2013
Location:
Posted: 21st May 2013 00:41
I'm a very new noob so I'm guessing I don't see posts right away. Hence the phantom remark.

No, Duke! I wasn't aware that the starting value of health limited your maximum allowed within the game. I only started working with FPGC this past weekend and have lots to learn.

I'll test it out, but I'm sure this is the problem. I'll just have to figure out a way to make the player's health immediately get assigned the value that I want when starting the game. I saw an action that can change a player's health to whatever one chooses, so hopefully it's not too difficult to script this.

Thanks so much for the quick response, Duke!

Yugo
Aarchduke
13
Years of Service
User Offline
Joined: 10th Aug 2011
Location: United Kingdom
Posted: 21st May 2013 13:07
Glad to help

Let me know if it works out for you!

-Duke.

So we beat on, boats against the current, borne back ceaselessly into the past.
Yugo
11
Years of Service
User Offline
Joined: 20th May 2013
Location:
Posted: 22nd May 2013 01:15
Duke,
Yes, this fixed it. The fact that health is limited by the player's start marker is what prevented me from adding additional health points.

I added the maximum health the player can have in the game, and at the player start I added a trigger zone that assigns plrsethealth=10. This way the player enters the first level with little health and has to earn health by answering some questions correctly while holding a conversation with an NPC. Here's the snippet in case any other noobs encounter the same problem I had:



Thanks for your guidance. I'm sure I'll have more questions as I navigate the nuances and idiosyncrasies of FPGC.

Thanks again,
Yugo
Aarchduke
13
Years of Service
User Offline
Joined: 10th Aug 2011
Location: United Kingdom
Posted: 22nd May 2013 11:13
My Pleasure, glad that I helped sort it out

I'm sure I'll see you again soon out there in the forums, it's a great place

-Duke.

So we beat on, boats against the current, borne back ceaselessly into the past.

Login to post a reply

Server time is: 2024-11-23 14:32:57
Your offset time is: 2024-11-23 14:32:57