Scripts / bizar problem: health.lua sometimes decreases health

Author
Message
wonderdaan
6
Years of Service
User Offline
Joined: 2nd Aug 2018
Location:
Posted: 11th Aug 2018 08:39
Hi all,

I've got this very illogical problem with health.lua, I hope you geniuses can solve this for a newby.

When I attach the health.lua to an object, it sometimes decreases health in stead of increasing (or maintaining when 100).
1. How is that even possible? (I want to learn about lua technics)
2. How can I prevent this? (I'd like to be able to choose my own health objects)

What I've already found out:
-I'm 100% sure no second faulty health.lua accidentally ended up somewhere in the scriptbank. (I changed the name to test it and the default health objects temporarily didn't work because they couldn't find the health.lua)
-So far it depends on which object I choose, so when it works one time with said object, it will keep working with it.
-I've compared compared all the property settings from working and non-working objects, but copying them doesn't change it.
-I bought a 'press -e to collect health' script which has the same problem

Anyone have any clue to why this script behaves 'randomly'?
Thanks in advance for your time & effort!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 11th Aug 2018 09:43 Edited at: 11th Aug 2018 09:46
It certainly won't be acting 'randomly'.

In the fpe file for the 'health' item should be lines like this:

;identity details
isweapon = 0
isammo = 0
ishealth = 1

;specific data
quantity = 10

The 10 is the amount of health to add. ( if it were ammo it would the number of shots )
Been there, done that, got all the T-Shirts!
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 11th Aug 2018 10:48
Is it connected to this report/fix?

https://forum.game-guru.com/thread/219357?page=1

Cheers.
wonderdaan
6
Years of Service
User Offline
Joined: 2nd Aug 2018
Location:
Posted: 12th Aug 2018 08:18
Hi guys, thanks for your quick replies!
Your answers put me on the right track and in my more specific search I found this detailed fix https://steamcommunity.com/app/266310/discussions/0/610574394226911981/.

What did the trick for me was copying the sections "identity", "ai" and "specific data" & putting it into the script of whichever object I want to make a health item. (or replace the sections when they are already there but differ) .

I have a bit more insight in the scripts & I get to choose my own health objects now. Whoopee

Thanks again for thinking along!
PM

Login to post a reply

Server time is: 2024-12-22 19:57:10
Your offset time is: 2024-12-22 19:57:10