Scripts / How can i change the maximum health/strength in game?

Author
Message
HappyAlpaka
8
Years of Service
User Offline
Joined: 21st Jan 2016
Location:
Posted: 22nd Jan 2016 00:07
Hi there,

at first sorry for my bad english :/

my problem is: I have a leveling system like "if you have 100 EXP than you get LVL 1"
When i "level up" i want my character to gain some extra maximum healthpoints/strength

i mean ingame you have two health points shown "100/100".
what i wanna do is, increase the second one.
if i use "SetPlayerHealth" or something than it increases the current health (f.e. 125/100) but i wanna increase the second one (f.e. 100/125)

Is it possible to do that ingame with a script?

Best greetings from germany!

HappyALpaka
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 22nd Jan 2016 15:16
I think you will need to create a variable that you can add to the players health so as not to mess with that part.

Adding states based on some other factor to raise and lower that second health number.
Then you could make you HUD to read both of those value as separate data.
In theory.

I would take a look thru smallg script thread, as the is a lot of great examples and scripts already that may aid you further in this.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

HappyAlpaka
8
Years of Service
User Offline
Joined: 21st Jan 2016
Location:
Posted: 22nd Jan 2016 17:44
thank you Pirate Myke!
i'm very new in scripting, but at least i got it now to add some lives when i "level up"
PM
Moshroom
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location: Finland
Posted: 22nd Jan 2016 18:52 Edited at: 22nd Jan 2016 18:52
There is no LUA command to affect the second number in the default HUD.

If you want to have a changeable max HP, you can create a variable that stores the initial HP in the start of a map and then grows in level up. For example:

In addition you will need:
- custom way to show the max HP (custom HUD, battle message prompt, menu, etc)
- custom collectables/health items that react to the max HP
- custom area in the player start position to reset the HP back to the MaxHP when the player dies and respawns

I created a set of RPG scripts a while ago and decided not to make MaxHP grow (to eliminate the need for extra adjustments and so that the scripts would be 100 % compatible with the default HUD).
perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 22nd Jan 2016 19:26
Quote: "what i wanna do is, increase the second one. "


This value is the players starting health, as set in the players marker properties settings
(the green start marker)

Its not adjustable in lua, (that I have found yet)

Cheers
Desktop: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 CPUs), ~3.6GHz, Windows 8.1 64-bit, 16 GB Ram, NVIDIA GeForce GTX 750 Ti, Display Memory: 4018 MB. Resolution 1360x768, Passmark 3528.
Laptop: Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 16 GB Ram, Radeon (TM) HD 6490M, 2336 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000. (WEI 5.8)
HappyAlpaka
8
Years of Service
User Offline
Joined: 21st Jan 2016
Location:
Posted: 22nd Jan 2016 22:05
Thank you moshroom! I think i will try it at least.
PM

Login to post a reply

Server time is: 2024-12-22 12:03:34
Your offset time is: 2024-12-22 12:03:34