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
THOM
Posts: 1274
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

The daemon head itself is just a wall-decoration.
To let it spit - let's say - fireballs, you have to use an object in the editor called "Spawner" - with "setEntity" set to "fireball". The spawner itself must be triggered/started by something else. It could be a timer-object, a pressure-plate (visible) or a floortrigger (invisible). All of them have to be connected with the spawner (in their submenu in the editor).
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
Badgert
Posts: 258
Joined: Sun Jan 29, 2017 6:14 pm

Re: Ask a simple question, get a simple answer

Post by Badgert »

Many thanks! Now everything is clear.
Badgert
Posts: 258
Joined: Sun Jan 29, 2017 6:14 pm

Re: Ask a simple question, get a simple answer

Post by Badgert »

Tell me please - why the bossfight begins with an incomplete strip of health boss?
And how can this be remedied?
User avatar
THOM
Posts: 1274
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

That happens if you include monsters in your bossfight with a monsterlevel higher than 1...
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

It means that the boss fight's original max HP total became accurate, either because of adding new monsters or increasing the maximum health of existing monsters. One possibility is that you increased a monster's level after adding it to the boss fight, yes. To fix this, just call BossFightComponent:recomputeTotal() after adding the new monsters/leveling up the monsters.
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.
Badgert
Posts: 258
Joined: Sun Jan 29, 2017 6:14 pm

Re: Ask a simple question, get a simple answer

Post by Badgert »

minmay wrote:To fix this, just call BossFightComponent:recomputeTotal() after adding the new monsters/leveling up the monsters.
I'm an absolute newbie in moding and do not understand where to insert a string "BossFightComponent:recomputeTotal()".
If it's not difficult, give a simple example or screenshot...
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Badgert wrote:
minmay wrote:To fix this, just call BossFightComponent:recomputeTotal() after adding the new monsters/leveling up the monsters.
I'm an absolute newbie in moding and do not understand where to insert a string "BossFightComponent:recomputeTotal()".
If it's not difficult, give a simple example or screenshot...
What this means is to call the recomputeTotal() function of the bossfight component in your bossfight object. [These can exist with arbitrary names, so a literal description is given.]

So if the bossfight object ID is "huge_rat_encounter_01", and the bossfight component has the default name of 'bossfight', then it means to call from in a script: huge_rat_encounter_01.bossfight:recomputeTotal()

**That said... This doesn't seem to work for me; or not as expected. In a test map, I added a level 3 rat_boss, activated the encounter and called recomputeTotal() and it didn't correct the life-bar. I added other ratlings on a timer, and each one added their HP to the bar, but it still remained less than half filled... Even with many calls to recomputeTotal(). :?
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Isaac wrote:**That said... This doesn't seem to work for me; or not as expected. In a test map, I added a level 3 rat_boss, activated the encounter and called recomputeTotal() and it didn't correct the life-bar. I added other ratlings on a timer, and each one added their HP to the bar, but it still remained less than half filled... Even with many calls to recomputeTotal(). :?
The boss fight bar uses the ratio of all the monsters' health to their maximum health. If you add a level 3 ratling_boss in the editor with the default health, and make no other changes, it starts with 4,200 out of 12,600 health. So it starts at 33% health, and therefore the boss fight bar will be 33% full when the total is computed correctly, because the ratling boss is already injured.
Fixing this is just a matter of calling ratling_boss_1.monster:setMaxHealth(ratling_boss_1.monster:getHealth()) after you level it up.
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.
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

And there it is; everything makes sense again.
Thanks for the explanation. 8-)
Gradunk
Posts: 54
Joined: Tue Oct 22, 2013 2:26 am
Location: Calgary, Canada

Re: Ask a simple question, get a simple answer

Post by Gradunk »

How do you create new power attacks to add to weapons you're creating? i've tried copy pasting code from the backbiter for example but it come up with a error method like leech is strictly designed for it and the boneblade. i want to make a melee power attack hit all monsters in a square like a group of 4 zombies for example or one that executes people sizesd creatures named "decapitate"

Code: Select all

defineObject{
	name = "damned_sword",
	baseObject = "base_item",
	components = {
		{
		class = "Model",
		model = "mod_assets/models/damned_sword.fbx",
		},
		{
		class = "Item",
		uiName = "The Teehee Blade",
		gfxAtlas = "mod_assets/textures/mod_items.tga",
		gfxIndex = 7,
		weight = 8,
		impactSound = "impact_blade",
		traits = { "two_handed", "light_weapon", "sword", "reach"},
		description = "NOT FOR YOU"
		},
		{
		class = "MeleeAttack",
		attackPower = 32,
		accuracy = 10,
		swipe = "horizontal",
		attackSound = "swipe_heavy",
		requirements = {"light_weapons", 3},
		cooldown = 4,
		baseDamageStat = "dexterity",
		damageType = "physical",
		},

		{
			class = "MeleeAttack",
			name = "cleave2",
			uiName = "Cleave",
			attackPower = 50,
			accuracy = 0,
			cooldown = 8,
			energyCost = 40,
			swipe = "horizontal",
			attackSound = "swipe_heavy",
			requirements = { "light_weapons", 5 },
			--WTF GOES HERE
			
-------------------------OR

                        class = "MeleeAttack",
			name = "decapitate",
			uiName = "Decapitate",
			attackPower = 40,
			accuracy = -10,
			cooldown = 6,
			energyCost = 75,
			swipe = "horizontal",
			attackSound = "swipe_heavy",
			requirements = { "light_weapons", 5 },
                        onHitMonster = function(self, monster, side, dmg, champion)
                            if monster = "all the monsters i want" (i hope there's an easier way lol)
                                monster:die()
                            end,
			--WTF GOES HERE
		},
	},
	tags = { "weapon" },
}
I smell you, i do! You GRADUNK! No be hiding on TORGAL!
Post Reply