Ask a simple question, get a simple answer

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
Isaac
Posts: 3190
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

zimberzimber wrote:Looks useful, except I have absolutely no idea on how to use tables. :oops:
Help please?
What exactly is your intended use of the test?
User avatar
Zo Kath Ra
Posts: 940
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Ask a simple question, get a simple answer

Post by Zo Kath Ra »

zimberzimber wrote:Looks useful, except I have absolutely no idea on how to use tables. :oops:
Help please?
Here you go :)
Tables: https://www.lua.org/pil/2.5.html
Table Constructors: https://www.lua.org/pil/3.6.html
User avatar
Eleven Warrior
Posts: 752
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Ask a simple question, get a simple answer

Post by Eleven Warrior »

Hi all.

Has anyone got these objects with the Scrips, Models and Textures: ball_chain and trap_trigger_pendulum?

They were on the forum ages ago and I did have them but, had hard drive problems.
User avatar
Zo Kath Ra
Posts: 940
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Ask a simple question, get a simple answer

Post by Zo Kath Ra »

Eleven Warrior wrote:Hi all.

Has anyone got these objects with the Scrips, Models and Textures: ball_chain and trap_trigger_pendulum?

They were on the forum ages ago and I did have them but, had hard drive problems.
viewtopic.php?f=22&t=7913
billb52

Re: Ask a simple question, get a simple answer

Post by billb52 »

Hi All
Has anyone got a LOG 2 working 'leech_worm' scripts, model, and textures? I had found one way back but does not seem to work
Any help appreciated thx in advance.
User avatar
THOM
Posts: 1280
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

Here is my definition.
You have to define a new attack sound (like i did) or enter one of the existing sounds.

And of course you have to have the model and the texture-files.

You know how to script a new monster into your mod?

EDIT: Sorry, I see, you don't have the needed files. If you PM me an email-adress, I can send them to you.

Code: Select all

	defineSound{
		name = "worm_attack_DM",
		filename = "mod_assets/monsters/worm/DM_worm.wav",
		loop = false,
		volume = 1,
		minDistance = 1,
		maxDistance = 4,
	}


defineObject{
	name = "worm",
       	baseObject = "base_monster",
	tags = {"monster" },
       	components = {
          {
             class = "Model",
             model = "mod_assets/monsters/worm/leech_worm.fbx",
             storeSourceData = true,
          },
          {
             class = "Animation",
             name = "animation",
             currentLevelOnly = true,
	     animations = {
		idle = "assets/animations/monsters/snail/snail_idle.fbx",
		moveForward = "assets/animations/monsters/snail/snail_walk.fbx",
		turnLeft = "assets/animations/monsters/snail/snail_turn_left.fbx",
		turnRight = "assets/animations/monsters/snail/snail_turn_right.fbx",
		attack = "assets/animations/monsters/snail/snail_attack.fbx",
		getHitFrontLeft = "assets/animations/monsters/snail/snail_get_hit_front_left.fbx",
		getHitFrontRight = "assets/animations/monsters/snail/snail_get_hit_front_right.fbx",
		getHitBack = "assets/animations/monsters/snail/snail_get_hit_back.fbx",
		getHitLeft = "assets/animations/monsters/snail/snail_get_hit_left.fbx",
		getHitRight = "assets/animations/monsters/snail/snail_get_hit_right.fbx",
		fall = "assets/animations/monsters/snail/snail_get_hit_front_left.fbx",
	     },
          },
          {
             class = "Monster",
	     meshName = "leech_worm_mesh",
             health = 90,
             evasion = 0,
	     protection = 10,
             exp = 120, 
             traits = { "animal" },
             hitEffect = "hit_goo",
             capsuleHeight = 0.2,
             capsuleRadius = 0.7,
             hitSound = "snail_hit",
             dieSound = "snail_die",
	     resistances = { ["poison"] = "absorb", ["fire"] = "vulnerable" },
	     immunities = { "sleep", "stunned", "blinded", "burning", "poison" },
          },
          {
             class = "MeleeBrain",
             name = "brain",
             sight = 2.5,
          },
          {
             class = "MonsterMove",
             name = "move",
             sound = "snail_walk",
             resetBasicAttack = false,
             turnDir = 0,
             cooldown = 6,
          },
          {
             class = "MonsterTurn",
             name = "turn",
             sound = "snail_walk",
             cooldown = 2,
          },
          {
             class = "MonsterAttack",
             name = "basicAttack",
--             sound = "snail_attack",
	     sound = "worm_attack_DM",  --works only, if new sound is defined
             cooldown = 3,
             attackPower = 6,
             animationSpeed = 1,
             animation = "attack",
	     causeCondition = "poison",
	     conditionChance = 17,
          },
       }
    }


defineMaterial{
	name = "leech_worm_mat",
	diffuseMap = "mod_assets/monsters/worm/leech_worm_diffuse.tga",
	specularMap = "mod_assets/monsters/worm/leech_worm_spec.tga",
	normalMap = "mod_assets/monsters/worm/leech_worm_normal.tga",
	doubleSided = false,
	lighting = true,
	alphaTest = false,
	blendMode = "Opaque",
	textureAddressMode = "Wrap",
	glossiness = 200, --25
	depthBias = 0,
}



THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
kelly1111
Posts: 349
Joined: Sun Jan 20, 2013 6:28 pm

Re: Ask a simple question, get a simple answer

Post by kelly1111 »

If I import your leech worm it works, but gives the error "cant find a head node" and all if it's attacks miss the party

how do I fix this?
User avatar
THOM
Posts: 1280
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

concerning question on:
viewtopic.php?f=22&t=7997&p=90818#p90818

concerning question two:
I have no idea. :?

Maybe it has something to do that I also use the LoG1 Snail with all it's definitions. Probably the animation definitions are requiered here...
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
Isaac
Posts: 3190
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

One also needs the animation events defined for each attack ~or they don't happen, and the monster never hits or does damage.

Animation events are monster specific ~technically per fbx file.
You define the fbx for the event, the event, and the animation frame that the event takes place at...
(Where it happens during the animation.)

example from the snail:

Code: Select all

defineAnimationEvent{
	animation = "assets/animations/monsters/snail/snail_attack.fbx",
	event = "attack",
	frame = 13,
}
billb52

Re: Ask a simple question, get a simple answer

Post by billb52 »

Hi THOM
I got the leech worm working OK, but had to alter attack sound to 'snail_attack' as I did not have DM_worm wav file.
So once again thx for your help.
Post Reply