Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
You could disable the other components that you no longer wish to be active, and the delay can be done with a timer, or the delayedCall function.
Re: Ask a simple question, get a simple answer
I see, oh the onAnimationEvent does not seem to work for this btw, does it only recognize grimrock 2 animations? or am not understanding how it works?
Re: Ask a simple question, get a simple answer
LoG2 animations are different than those from LoG1, but you can convert them through the Blender LoG export script.
For what you are doing, it could be done from the onClick, in the Clickable component.
The onAnimationEvent hook works in tandem with separately defined animation events. The purpose of these are to call the hook during the play of a specific animation file, and at a specific frame number; or percentage of the duration.
When the event is called, the event receives the [event] name of the calling animationEvent.
It is also possible to play a sound effect as the event, like so:
For what you are doing, it could be done from the onClick, in the Clickable component.
The onAnimationEvent hook works in tandem with separately defined animation events. The purpose of these are to call the hook during the play of a specific animation file, and at a specific frame number; or percentage of the duration.
When the event is called, the event receives the [event] name of the calling animationEvent.
The above event allows one to know when frame 20 is reached in the skeleton_warrior_walk. At frame 20, the onAnimationEvent is called, and the string "footstep" is passed to it. The event string can be an arbitrarily chosen string; it is passed to the hook when it is called.defineAnimationEvent(desc)
Defines a new animation event. desc is a table with the following fields:
animation:the name of animation file to attach animation event to. The filename must end with “.fbx”
event:the animation event string, e.g. “footstep” or “attack”.
frame:(optional) a frame number in the animation to attach the event to (one frame equals 1/30th of a second).
normalizedTime:(optional) normalized time of the event in range 0-1 to be used instead of frame (0 = start of animation, 1 = end of animation).
Example:Code: Select all
defineAnimationEvent{ animation = "assets/animations/monsters/skeleton_warrior/skeleton_warrior_walk.fbx", event = "footstep", frame = 20, }
It is also possible to play a sound effect as the event, like so:
Code: Select all
--In the animationEvent -- event = "playSound:impact_blade", --
Re: Ask a simple question, get a simple answer
Ahh ok, now I see. Thanks man
Re: Ask a simple question, get a simple answer
I was thinking about the option of "skinning" or "recovering" resources.
Mainly skeleton corpses.
A custom "skinning_knife" that detects if a dm_floordeco_skeleton is in front of the party.
Maybe basically something like the shovel mechanic, in case you have a skeleton corpse in front of you
you can remove and polish the skull and recover some bones from it.
if dm_floordeco_skeleton is true
then ...
...
floordeco_corpse:destroy()
spawn("dirt_patch")
spawn("skull")
spawn("skeletal_bone")
What are my options here?
Mainly skeleton corpses.
A custom "skinning_knife" that detects if a dm_floordeco_skeleton is in front of the party.
Maybe basically something like the shovel mechanic, in case you have a skeleton corpse in front of you
you can remove and polish the skull and recover some bones from it.
if dm_floordeco_skeleton is true
then ...
...
floordeco_corpse:destroy()
spawn("dirt_patch")
spawn("skull")
spawn("skeletal_bone")
What are my options here?
Re: Ask a simple question, get a simple answer
Normally objects on a square get pushed to the side you're walking on to the square.
Objects dropped by skeletons don't move to the side of a square when walking on those squares however, probably blocked by the freshly spawned dm_floordeco_skeleton object. They're just lying there in the middle of the square. It's still perfectly possible to pick them up but mostly the only way to pick them up is during movement only. You can't pick them up anymore when you're standing over them or next to them.
Can I change something to this object so that it doesn't block items from being pushed on the square?
Objects dropped by skeletons don't move to the side of a square when walking on those squares however, probably blocked by the freshly spawned dm_floordeco_skeleton object. They're just lying there in the middle of the square. It's still perfectly possible to pick them up but mostly the only way to pick them up is during movement only. You can't pick them up anymore when you're standing over them or next to them.
Can I change something to this object so that it doesn't block items from being pushed on the square?
Code: Select all
defineObject{
name = "dm_floordeco_skeleton",
baseObject = "dm_redcarpet_tile",
components = {
{
class = "Model",
model = "mod_assets/dmcsb_pack/models/env/dm_floor_skeleton.fbx",
staticShadow = true,
},
{
class = "ItemConstrainBox",
offset = vec(0,0.2,0),
size = vec(0.7,0.4,2.2),
},
},
editorIcon = 136,
}
- Zo Kath Ra
- Posts: 937
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
Silly question, is there a way to change the tint on a materials diffuse in the definition? example: I want to add a little red to the "mine_pressure_plate" material in my own material definition with out adding a new texture, is that possible?
Re: Ask a simple question, get a simple answer
No, though again, you can try to fake it by using emissive color.
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.