Ask a simple question, get a simple answer

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!
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Haha, no big deal, I realize now that I sounded pretty mean there. That indentation was really bad though :P
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
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Ask a simple question, get a simple answer

Post by akroma222 »

minmay wrote:Haha, no big deal, I realize now that I sounded pretty mean there. That indentation was really bad though :P
All good big chief, the indents were indeed an Abomination!
Id messed around with it when I was first trying to wrap my head around how those shadow functions are set up and Id forgot to correct them
(Can you tell I was initially Confused?? :lol: :lol: )
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Yeah, that one was a quick example and not very readable...I think I'll make a separate thread about this.
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
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Ask a simple question, get a simple answer

Post by akroma222 »

So far Ive collected up:
--The Explanation - Overwriting standard functions in the global environment (info dump)
--The Map Marker example (that follows the explanation^)
--The custom Award XP example (linked^^)
--The MonsterAttack pierce examples (posted above)

(...you should see mockery I made of the indentations for the other examples! :lol: )
I kinda get it now - but yeah a new Thread for Shadowfunctions would be v useful for folks
I will put together something for the ^^aforementioned monster attack Counter stuff I had in mind soon
Im pretty sure I canwork from the Monster attack Pierce example to do this :)
Smok
Posts: 2
Joined: Fri Apr 14, 2017 11:27 am

Re: Ask a simple question, get a simple answer

Post by Smok »

How to setup default partry?
User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: Ask a simple question, get a simple answer

Post by zimberzimber »

Smok wrote:How to setup default partry?
You'll have to create a function that changes each champions values to those you'd like to have, and launch that function after the party is created in game. (i.e put a floor trigger under the parties starting position that calls that function from a script entity)
Here is a list of champion related functions
My asset pack [v1.10]
Features a bit of everything! :D
Smok
Posts: 2
Joined: Fri Apr 14, 2017 11:27 am

Re: Ask a simple question, get a simple answer

Post by Smok »

zimberzimber wrote: You'll have to create a function that changes each champions values to those you'd like to have, and launch that function after the party is created in game. (i.e put a floor trigger under the parties starting position that calls that function from a script entity)
Here is a list of champion related functions
But how can i chceck if player choosed to create party or to go default.

I have nother question. Can i exclude races/classes/skills/spells/recipes etc. i don't want from my addon? Lets say I want to change setting a little.
User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: Ask a simple question, get a simple answer

Post by zimberzimber »

But how can i chceck if player choosed to create party or to go default.
Your only option is to compare all values (names, starting traits, skills, race, etc...) for every champion with those the default party has.
I have nother question. Can i exclude races/classes/skills/spells/recipes etc. i don't want from my addon? Lets say I want to change setting a little.
If you want to modify an already present trait/class/anything else thats already defined, you can just define it again with the new values you want.
Want the Berserk to grant +10 strength per level? Copy its definition (found in the vanilla asset pack), and change values at will. Make sure the name (Not the uiName) stays the same.

You you want to remove a definition, you'll have to make some adjustments to whats being initialized. If you take a look at your init.lua, you'll notice the first (probably) line is 'import "assets/scripts/standard_assets.lua". That is a script file that initializes all the base game definitions.
You can't modify it, but you can remove the "assets/scripts/standard_assets.lua" line in your init.lua, and copy everything you need from standard_assets.lua, into your init.lua (or another file that gets initialized before any other file) (standard_assets.lua can be found in the vanilla asset pack as well)
My asset pack [v1.10]
Features a bit of everything! :D
User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: Ask a simple question, get a simple answer

Post by zimberzimber »

How do I use 'Console.suppressWarnings'?
Tried multiple ways, all ended up with an error.
My asset pack [v1.10]
Features a bit of everything! :D
User avatar
Zo Kath Ra
Posts: 940
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Ask a simple question, get a simple answer

Post by Zo Kath Ra »

zimberzimber wrote:How do I use 'Console.suppressWarnings'?
Tried multiple ways, all ended up with an error.
The correct function name is:
Console.setSuppressWarnings

Found with

Code: Select all

for key,value in pairs(Console) do print(key,value) end
Console.setSuppressWarnings(true) <-- warnings off
Console.setSuppressWarnings(false) <-- warnings on
Post Reply