Page 307 of 396
Re: Ask a simple question, get a simple answer
Posted: Sat May 04, 2019 7:12 am
by Isaac
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
Posted: Sat May 04, 2019 10:42 pm
by vanblam
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
Posted: Sat May 04, 2019 11:35 pm
by Isaac
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.
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,
}
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.
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
Posted: Sun May 05, 2019 3:40 am
by vanblam
Ahh ok, now I see. Thanks man
Re: Ask a simple question, get a simple answer
Posted: Sun May 05, 2019 1:52 pm
by Pompidom
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?
Re: Ask a simple question, get a simple answer
Posted: Mon May 06, 2019 1:48 pm
by Pompidom
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?
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,
}
Re: Ask a simple question, get a simple answer
Posted: Mon May 06, 2019 5:39 pm
by Zo Kath Ra
Pompidom wrote: ↑Mon May 06, 2019 1:48 pm
Can I change something to this object so that it doesn't block items from being pushed on the square?
ItemConstrainBox
viewtopic.php?f=22&t=9336
Re: Ask a simple question, get a simple answer
Posted: Sun May 12, 2019 1:20 am
by vanblam
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
Posted: Sun May 12, 2019 1:24 am
by minmay
No, though again, you can try to fake it by using emissive color.
Re: Ask a simple question, get a simple answer
Posted: Sun May 12, 2019 1:32 am
by vanblam
minmay wrote: ↑Sun May 12, 2019 1:24 am
No, though again, you can try to fake it by using emissive color.
I was thinking about that, but it wont receive lighting correctly right?