Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
Can you please tell me why it's not working
GameMode.setMaxStatistic(“secrets_found”, 100)
GameMode.setMaxStatistic(“treasures_found”, 0)
are they hardcoded?
GameMode.setMaxStatistic(“secrets_found”, 100)
GameMode.setMaxStatistic(“treasures_found”, 0)
are they hardcoded?
My Generations of Kings mod
Link to Nexus mods
Link to Nexus mods
- Zo Kath Ra
- Posts: 940
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Ask a simple question, get a simple answer
Works for me.
If you upload a test dungeon to Nexusmods, we can try to reproduce the error.
Merry Christmas!
Re: Ask a simple question, get a simple answer
That's the same code I posted, just more verbal. As such the same error happensSlava wrote: ↑Wed Dec 25, 2024 8:47 amTry thisCode: Select all
local gem = "blue_gem" for e in self.go.map:entitiesAt(self.go.x, self.go.y + dy) do if e and e.surface then local o = spawn(gem).item e.go.surface:addItem(o) break end end
This works:
Code: Select all
local altar = findEntity(altarId)
if altar then
altar.surface:addItem(spawn("blue_gem").item) -- addItem accepts the item
end
Code: Select all
for e in self.go.map:entitiesAt(self.go.x, self.go.y) do
if e.surface then
e.surface:addItem(spawn("blue_gem").item) -- addItem says parameter 1 is not an item
break
end
end
Re: Ask a simple question, get a simple answer
Thank you! I've already figured it out, the problem was something else.Zo Kath Ra wrote: ↑Thu Dec 26, 2024 2:19 pm If you upload a test dungeon to Nexusmods, we can try to reproduce the error.
Now I have another question.
When I set champion:setHealth(0)
(Don't ask why. I just need to kill champion instantly. )
After resurrection champion does not require food.
I found a solution to the problem - champion:damage(champion:getHealth(), “pure”),
but I'm wondering why this happens?
My Generations of Kings mod
Link to Nexus mods
Link to Nexus mods
Re: Ask a simple question, get a simple answer
The description for ‘defineRecipe’ is
‘Defines a new recipe or replases an existing recipe’.
However, the recipe is not replaced, but only extended. The old combination continues to work.
Why is this the case?
‘Defines a new recipe or replases an existing recipe’.
However, the recipe is not replaced, but only extended. The old combination continues to work.
Why is this the case?
Re: Ask a simple question, get a simple answer
this is a simple enough question, but nevertheless requires a detailed answer, given that you are, I assume, a novice. Welcome!
You can find the line import “assets/scripts/standard_assets.lua” in the files of your mod, namely in init.lua.
If you downloaded the asset pack grimrock 2 then in the file standard_assets.lua you can see the line import “assets/scripts/recipes.lua”. This is what makes the recipes work in parallel. You can remove the line “assets/scripts/standard_assets.lua” from your init.lua, copy the standard_assets.lua file with the line “assets/scripts/recipes.lua” previously removed from it to your modification folder (you need to rewrite the line to import “mod_assets/scripts/standard_assets.lua”). This will disable vanilla recipes. Now you can define your own! You welcome!
Translated with DeepL.com (free version)
My Generations of Kings mod
Link to Nexus mods
Link to Nexus mods
Re: Ask a simple question, get a simple answer
Thank you very much, Slava, for answering my question so quickly.
However, I didn't necessarily want a solution, but an explanation of why in this particular case the definition is extended and not replaced. Then maybe I could find a solution to my question myself. I already know the solution you suggest.
But I'd rather avoid doing it that way, because I tried it once before on another problem some time ago, and it did solve the one problem, but I then experienced many new complications.
But thanks again for your help, I appreciate your solution orientation.
btw. I also use DeepL (Write/Translate)
However, I didn't necessarily want a solution, but an explanation of why in this particular case the definition is extended and not replaced. Then maybe I could find a solution to my question myself. I already know the solution you suggest.
But I'd rather avoid doing it that way, because I tried it once before on another problem some time ago, and it did solve the one problem, but I then experienced many new complications.
But thanks again for your help, I appreciate your solution orientation.
btw. I also use DeepL (Write/Translate)
Re: Ask a simple question, get a simple answer
defineRecipe() will replace any existing recipe with the same ingredients. It won't replace an existing recipe if it has different ingredients from that recipe, even if the recipe creates the same item.
This is so that you can have multiple recipes that create the same item. For example, in Grimrock 1, there are two different recipes for potion_cure_poison; if defineRecipe() replaced existing recipes for the same item, this wouldn't be possible.
This is so that you can have multiple recipes that create the same item. For example, in Grimrock 1, there are two different recipes for potion_cure_poison; if defineRecipe() replaced existing recipes for the same item, this wouldn't be possible.
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.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
Okay, now I understand.
I have now given the old ingredient combinations new definitions and then assigned them to level 6.
So they are no longer active.
Thanks.
I have now given the old ingredient combinations new definitions and then assigned them to level 6.
So they are no longer active.
Thanks.