But I wish that we can't do it. How shall we do it ? Maybe with script, but I don't know where to start. First maybe, what is the function that the mouse click on the crystal? I may disable it temporarily if I find the function.
Healing Crystal : anti-click system
Healing Crystal : anti-click system
I have a problem with healing crystal. You can heal through a secret-wall, a door or wall grating.
But I wish that we can't do it. How shall we do it ? Maybe with script, but I don't know where to start. First maybe, what is the function that the mouse click on the crystal? I may disable it temporarily if I find the function.
But I wish that we can't do it. How shall we do it ? Maybe with script, but I don't know where to start. First maybe, what is the function that the mouse click on the crystal? I may disable it temporarily if I find the function.
Last edited by Damonya on Wed Mar 13, 2013 3:30 pm, edited 1 time in total.
Orwak - MOD - Beta version 1.0
Re: Healing Crystal : not pass through walls-doors
I haven't tried to mess with this before. Maybe you could spawn a large area fake alcove in front of it?
Finished Dungeons - complete mods to play
Re: Healing Crystal : not pass through walls-doors
Perhaps the easiest way is to spawn a fake healing crystal without healing, only the texture.
Of course it is temporary. Example with 2 hidden_pressure, and 1 counter :
But I would like a little help to make a fake crystal in objets.lua
because with it:
It works fine, but I don't have animation and light on the crystal.
Of course it is temporary. Example with 2 hidden_pressure, and 1 counter :
SpoilerShow
Code: Select all
function permuthealcryst()
if counter:getValue()==0 then
healing_fake_permut:destroy()
spawn("healing_crystal", L, X, Y, 1,"healing_crystal_permut")
counter:setValue(1)
end
endCode: Select all
function permuthealfake()
if counter:getValue()==1 then
healing_crystal_permut:destroy()
spawn("fake_crystal", L, X, Y, 1,"healing_fake_permut")
counter:setValue(0)
end
endBut I would like a little help to make a fake crystal in objets.lua
because with it:
SpoilerShow
Code: Select all
cloneObject{
name = "healing_crystal_fake",
baseObject = "metal_junk_block",
model = "assets/models/env/healing_crystal.fbx",
animation = "assets/animations/env/healing_crystal_spin.fbx",
particleSystem = "crystal",
editorIcon = 60,
}
Last edited by Damonya on Wed Mar 13, 2013 2:59 pm, edited 1 time in total.
Orwak - MOD - Beta version 1.0
Re: Healing Crystal : not pass through walls-doors
Ok after much testing, the Gobelin is the ideal candidate. So an another solution is to place a gobelin in front the healing crystal. The problem I can't create a gobelin keeps its characteristic mesh (don't onclick), but with invisible texture in GMT.
I will do it.
EDIT : Yes ! I redefined the gobelin with the texture dream_fog and it runs impeccably.
In GMT, take the gobelin.model and Tools -> Material Find / Replace. Select "gobelin" from the existing material name dropdown and then type 'anti_click' into the New Material Name box. Close the dialogue and click "Tools -> Reload Material Library". Do the same with "chain_metal_dark" to "invisible". Save your new file to anti_click.model to your mod_assets/models folder.
objects.lua :
material.lua :
You have now a transparent anti_click object. 
Now the problem is if you attack, the gobelin tears and you can click again. But I've seen posts to prevent attack, so it shouldn't pose more problem. In the init.lua via script with the onAttack = function( self , weapon )
It runs.
PS : I changed the title of the topic
I will do it.
EDIT : Yes ! I redefined the gobelin with the texture dream_fog and it runs impeccably.
In GMT, take the gobelin.model and Tools -> Material Find / Replace. Select "gobelin" from the existing material name dropdown and then type 'anti_click' into the New Material Name box. Close the dialogue and click "Tools -> Reload Material Library". Do the same with "chain_metal_dark" to "invisible". Save your new file to anti_click.model to your mod_assets/models folder.
objects.lua :
SpoilerShow
Code: Select all
defineObject{
name = "anti_click",
class = "WallTapestry",
model = "mod_assets/models/anti_click.fbx",
brokenModel = "assets/models/env/gobelin_torn.fbx",
placement = "wall",
editorIcon = 92,
}SpoilerShow
Code: Select all
defineMaterial{
name = "anti_click",
diffuseMap = "assets/textures/dream/dream_fog_02_dif.tga",
doubleSided = false,
lighting = true,
alphaTest = true,
blendMode = "Translucent",
textureAddressMode = "Wrap",
glossiness = 20,
depthBias = 0,
}
defineMaterial{
name = "invisible",
diffuseMap = "assets/textures/dream/dream_fog_02_dif.tga",
doubleSided = false,
lighting = true,
alphaTest = false,
blendMode = "Translucent",
textureAddressMode = "Wrap",
glossiness = 60,
depthBias = 0,
}Now the problem is if you attack, the gobelin tears and you can click again. But I've seen posts to prevent attack, so it shouldn't pose more problem. In the init.lua via script with the onAttack = function( self , weapon )
It runs.
PS : I changed the title of the topic
Orwak - MOD - Beta version 1.0
Re: Healing Crystal : anti-click system
It is better with :
and to prevent attack, the Marble Mouth's script is perfect : viewtopic.php?f=14&t=4886&p=54140&hilit=ghost#p54140
The only problem is with spells. For example, a fire spell, tears the invisible gobelin and you can click again. But I couldn't do better I think. The gobelin's broken model must be hard coded into the game engine.
However, this feature gives me an idea of puzzle
SpoilerShow
Code: Select all
defineObject{
name = "anti_click",
class = "WallTapestry",
model = "mod_assets/models/anti_click.fbx",
brokenModel = "mod_assets/models/anti_click.fbx",
placement = "wall",
editorIcon = 92,
}The only problem is with spells. For example, a fire spell, tears the invisible gobelin and you can click again. But I couldn't do better I think. The gobelin's broken model must be hard coded into the game engine.
However, this feature gives me an idea of puzzle
Orwak - MOD - Beta version 1.0
- JohnWordsworth
- Posts: 1397
- Joined: Fri Sep 14, 2012 4:19 pm
- Location: Devon, United Kingdom
- Contact:
Re: Healing Crystal : anti-click system
I don't know if you can tell if a Gobelin is broken or not, but could you repeatedly destroy and recreate the Gobelin once per second if and only if you are standing on the space in front of the crystal?
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
Re: Healing Crystal : anti-click system
Yes I thought that putting the same model.fbx in the brokenModel of the gobelin's object.lua, it would spawn the same unused mesh gobelin when you damaged it. But no. I don't know why. The texture of the brokenModel is invisible but I don't have the unused mesh gobelin.
Orwak - MOD - Beta version 1.0
Re: Healing Crystal : anti-click system
You could always move the crystal one tile further... 
(Sorry, but that's how I solved it in my maps)
(Sorry, but that's how I solved it in my maps)
