Product Chat / How to fully replace GAMEPLAYERCONTROL.lua in order to change some things in it ? anyone ?

Author
Message
UNIRD12B
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 28th Feb 2018 19:22 Edited at: 28th Feb 2018 19:59
Hi guys ,
I see now the only way I can find to completely kill the
RED_FOG_OF_DEATH
and the
HEARTBEAT_OF_DEATH_SOUND
is to go in and make the changes right within
GAMEPLAYERCONTROL.lua
but as soon as Game Guru updates it goes back to the same old.
There is no way I know , so far , to replace that .lua file in Playerstart
since there is no place in properties to choose maybe a changed one called
GAMEPLAYERCONTROL-b.lua
sooooooooooooo

for example..this works perfectly...by just commenting out these lines



let me know if you have ideas ?

thx

UNIRD12B
Let\'s actually make something happen with this one !
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 28th Feb 2018 20:03 Edited at: 28th Feb 2018 20:04
Just make a copy of it's contents and paste them into a dummy script which you attach to an always active entity.

When the script is loaded it will replace the default functions with yours. Remember to add an '_init' and '_main' to the script.
Been there, done that, got all the T-Shirts!
PM
UNIRD12B
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 28th Feb 2018 20:25
Thx AmenMoses ,
but wont they still be overridden ,
by the fact that the GAMEPLAYERCONTROL.lua
is still running its original code and updating while play is on ?

Thx

UNIRD12B
Let\'s actually make something happen with this one !
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 28th Feb 2018 20:52
Also keep in mind that i think each time you update Game Guru, you may loss your changes to the global player script. So you'll need to make sure you have a black up.
Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
UNIRD12B
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 28th Feb 2018 20:56
Thx Teabone ,
Yes , i saw that , which is why im trying to find a long term
method that will leave those commands nilled.

Thx to all.

UNIRD12B
Let\'s actually make something happen with this one !
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 28th Feb 2018 21:07
What might help with this is if Game Guru had the ability to choose a LUA script for the player from the start maker similar to entities. However I can see this causing possible issues for new comers to GG who might mess around with that.

Twitter - Teabone3 | Youtube - Teabone3 | Twitch - Teabone3 | TGC Assets - Store Link | Patreon - Teabone3

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 28th Feb 2018 21:17 Edited at: 28th Feb 2018 21:18
No, if you load a script any functions it contains will replace the ones with the same name that exist, assuming of course it is in the global namespace but I'm not going to try and explain that here.

If you have 200 soldiers using ai_soldier.lua there will still only be one copy of the script loaded in GG, if you then loaded a new script which had an ai_soldier_main function defined in it that would replace the existing ai_soldier_main function from that point onwards. (and all the soldiers would start using the new one!)
Been there, done that, got all the T-Shirts!
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 28th Feb 2018 21:18 Edited at: 28th Feb 2018 22:29
Just attach this to a barrel or something ...
The only person ever to get all his work done by "Friday" was Robinson Crusoe..

Attachments

Login to view attachments
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 28th Feb 2018 21:21
That is a solution but hardly very efficient, now you have a new script that GG will run every frame!
Been there, done that, got all the T-Shirts!
PM
UNIRD12B
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 28th Feb 2018 21:28
THx ,
THAT is the base script I alraedy used to create my own script to
kill the red fog and the heartbeat.
but it still causes sound glitches once in a while.

Ill keep trying and as always
thanks to you all for chipping in.

UNIRD12B
Let\'s actually make something happen with this one !
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 28th Feb 2018 22:21 Edited at: 28th Feb 2018 22:23
Quote: "That is a solution but hardly very efficient, now you have a new script that GG will run every frame!"

Better than smashing the wall though when the GAMEPLAYERCONTROL.lua resets
We just want an On \ Off tick box or a " players_noredscreen_heartbeat = 1 " in the setup.ini perhaps..

The " players_noredscreen.lua " is advantages though if you want to have it back on in Level 2 perhaps ?
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 28th Feb 2018 22:55 Edited at: 28th Feb 2018 23:21
Ahh, Lee defined it as a local so you can't simply override with the method I described, let me take a look at how he calls it from the engine and get back to you.

File attached, just attach to an always active entity.

I've added a Prompt to the script to show it is indeed running the replacement rather than Lee's version. Just delete that line when you have checked it works for you, then simply edit away to your hearts content.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
UNIRD12B
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 2nd Mar 2018 21:55
ok THX AmenMoses ,
got it !!!.
for anyone that wants it now here is a copy of the playercontrol.lua that will totally
KIll the RED DEATH screen and the heartbeat one also.To make it work ,
i just attach it to a triggerzone and let the PlayerStart fall on it at the beginning of the level to
activate it and then. VOILA ! no more RED PAIN SCREEN or heartbeat sound.
Just save it with the proper name and as a .lua file..NOT .txt

let me know how it works as it did for me correctly.

Thx again for the insights AmenMoses

UNIRD12B

Let\'s actually make something happen with this one !

Attachments

Login to view attachments
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 3rd Jul 2018 01:54
Quote: "i just attach it to a triggerzone and let the PlayerStart fall on it at the beginning of the level to
activate it "

No need to do that … Just attach it to a dynamic model … works brilliantly
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
UNIRD12B
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd May 2014
Location: Canada
Posted: 3rd Jul 2018 03:15
Thx , Synchro ,
I'm just happy I was able to get it to work at all !!!

UNIRD12B
Let\'s actually make something happen with this one !

Login to post a reply

Server time is: 2024-11-24 06:44:09
Your offset time is: 2024-11-24 06:44:09