RE: Console - Almost Human

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
Eleven Warrior
Posts: 752
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

RE: Console - Almost Human

Post by Eleven Warrior »

I am not sure about this but, is there a way to stop the player in a game spawning items from the console. If not can the Dev's put this into the main code. That way the player cannot spawn a massive weapon and beat your mod(s).

Just asking that's all :)
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: RE: Console - Almost Human

Post by minmay »

You can't control what the user does on their own computer. Disabling the debug console wouldn't do anything to stop cheating; they could just edit the dungeon file, use TAS programs, cheat engine, etc.
If you don't want players to cheat in your mods, perhaps you should make your mods fun to play instead, so that they don't have a reason to cheat.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: RE: Console - Almost Human

Post by Isaac »

minmay wrote:You can't control what the user does on their own computer. Disabling the debug console wouldn't do anything to stop cheating; they could just edit the dungeon file, use TAS programs, cheat engine, etc.
If you don't want players to cheat in your mods, perhaps you should make your mods fun to play instead, so that they don't have a reason to cheat.
Hypothetically... (and setting aside that nothing will stop the truly determined)... What about obfuscating (by renaming) all of the item definitions [custom and standard] to non-descriptive alphanumerics, and including only compiled lua scripts?

*Of course... This won't stop someone from writing full scripts into the console to poll the cell contents, to read the object names, but that's not most players.
SpoilerShow
...And so how about optionally, adding code to every item, that runs at spawn... that calls GameMode.completeGame() with a cheater's outro if the item fails a custom authenticity check. :twisted:

** Another option is for those uber weapons on the out of reach shelf... to not really be there (as an object), until they are within reach of the party; the display object being a dummy prop or just a model component ~preventing it from being moved into reach via the console.
User avatar
Eleven Warrior
Posts: 752
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: RE: Console - Almost Human

Post by Eleven Warrior »

Thank you Issac awesome reply. I will try your method. 85 percent of the items I have, have different id's etc...

If I don't include say the item dagger in the items.lua will the player still be able to spawn a dagger from the console? I assume it's hard coded. Thxs for your time :)
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: RE: Console - Almost Human

Post by Isaac »

Eleven Warrior wrote:Thank you Issac awesome reply. I will try your method. 85 percent of the items I have, have different id's etc...

If I don't include say the item dagger in the items.lua will the player still be able to spawn a dagger from the console? I assume it's hard coded. Thxs for your time :)
If there is no item definition defined as 'dagger', then one cannot use spawn('dagger') to get a dagger. To get a dagger, they would have to use the item name with the spawn function; and the item name of a dagger could be item671128. This means removing [substituting] the import standard_assets.lua found in your init.lua, and substituting a modified copy that references your own modified item definition scripts.

Btw... this could play hell with 3rd party scripts, and your own that make assumptions about what items are defined (and spawned by them), unless all item names are updated in the affected scripts.
Post Reply