Search found 324 matches

by MrChoke
Tue Oct 27, 2015 7:51 pm
Forum: Mod Creation
Topic: [Solved] Why does "loop = true" not keep animations running?
Replies: 6
Views: 2364

[Solved] Why does "loop = true" not keep animations running?

Maybe I do not understand what loop = true means for animations. It doesn't do anything when defined in the object or set with animation:setLoop(true). I am doing a custom healing crystal. One without the "Crystal" component. But I am using everything else from it, including the "spin" animation. Ho...
by MrChoke
Tue Oct 27, 2015 1:15 pm
Forum: Mod Creation
Topic: Does anyone know a way to detect reloading of a saved game?
Replies: 4
Views: 1472

Re: Does anyone know a way to detect reloading of a saved ga

Easiest way in Grimrock 2: minimalSaveState objects are respawned every time the game is reloaded, so they, along with their components, will return to their initial state every time the game is reloaded, which means their onInit hooks will be run again. So you'd just place one object like this one...
by MrChoke
Tue Oct 27, 2015 1:13 pm
Forum: Mod Creation
Topic: setMaterialOverrides does not work on rendered object
Replies: 3
Views: 1272

Re: setMaterialOverrides does not work on rendered object

Dynamic setMaterialOverrides() works fine for me. Are you sure the table you're passing is naming the right materials, accounting for previous overrides? For example, if you've previously done setMaterialOverrides({material1="material2"}) then setMaterialOverrides({material1="material3"}) won't do ...
by MrChoke
Tue Oct 27, 2015 4:15 am
Forum: Mod Creation
Topic: Question on animation textures
Replies: 12
Views: 3764

Re: Question on animation textures

UPDATE: I can get model material changes to stay after a game reload. I do this by doing removeComponet() on trhe model and then re-creating it. It re-renders and holds the new model I set after a save. HOWEVER, the animations no longer work after I recreate the model. And I don't think I can dynami...
by MrChoke
Tue Oct 27, 2015 3:29 am
Forum: Mod Creation
Topic: setMaterialOverrides does not work on rendered object
Replies: 3
Views: 1272

setMaterialOverrides does not work on rendered object

I have been calling setMaterialOverrides() in my code for quite some time with no issues. But I guess it is not until now that I want to call it on an object that has already been rendered. Now I call it and it doesn't work. Is there some way I can force the game re-render an object? I tried disable...
by MrChoke
Tue Oct 27, 2015 3:09 am
Forum: Mod Creation
Topic: Does anyone know a way to detect reloading of a saved game?
Replies: 4
Views: 1472

Re: Does anyone know a way to detect reloading of a saved ga

Zo Kath Ra wrote:Every component has an onInit(self) function.
AFAIK it only gets called once, when you load a new game.
Yes, its only called once, when you start a new game, not reload one. So it does not solve my problem.
by MrChoke
Tue Oct 27, 2015 12:20 am
Forum: Mod Creation
Topic: Does anyone know a way to detect reloading of a saved game?
Replies: 4
Views: 1472

Does anyone know a way to detect reloading of a saved game?

I am wondering if anyone knows how to check for this via scripts. I have heard that minmay may know. Hopefully he can respond in his usual fast way!

I need to know this now so that I can call setMaterial() again on any objects that need it after reload.
by MrChoke
Mon Oct 26, 2015 10:37 pm
Forum: Mod Creation
Topic: Question on animation textures
Replies: 12
Views: 3764

Re: Question on animation textures

It is; but that applies to all of them. Unfortunately, [oddly] the crystal object does not return a material from :getMaterial() unless you first assign it one with setMaterial(). I had thought to check the current material, and set it back if it ever changed, but it doesn't change ~it's just ignor...
by MrChoke
Mon Oct 26, 2015 4:21 am
Forum: Mod Creation
Topic: Question on animation textures
Replies: 12
Views: 3764

Re: Question on animation textures

I want to have a different colored healing crystal. I set the above materialOverride on the crystal's model and it does nothing. This is obviously because the healing crystal has an animation too. this is obviously wrong, animations have nothing to do with it whatsoever and contain no texture or ma...
by MrChoke
Mon Oct 26, 2015 3:53 am
Forum: Mod Creation
Topic: Question on animation textures
Replies: 12
Views: 3764

Question on animation textures

Hello. After months of not touching modding for Grimrock, I am back at it. I have a question about animations. Do they have a texture that I can override somehow? I am talking something like what we can do for models. Example: materialOverrides = { healing_crystal = "healing_crystal_black" } The abo...