Page 195 of 396

Re: Ask a simple question, get a simple answer

Posted: Thu Mar 02, 2017 10:38 am
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).

Re: Ask a simple question, get a simple answer

Posted: Thu Mar 02, 2017 11:37 am
by Badgert
Many thanks! Now everything is clear.

Re: Ask a simple question, get a simple answer

Posted: Tue Mar 07, 2017 10:05 am
by Badgert
Tell me please - why the bossfight begins with an incomplete strip of health boss?
And how can this be remedied?

Re: Ask a simple question, get a simple answer

Posted: Tue Mar 07, 2017 11:34 am
by THOM
That happens if you include monsters in your bossfight with a monsterlevel higher than 1...

Re: Ask a simple question, get a simple answer

Posted: Tue Mar 07, 2017 8:55 pm
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.

Re: Ask a simple question, get a simple answer

Posted: Tue Mar 07, 2017 11:23 pm
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...

Re: Ask a simple question, get a simple answer

Posted: Wed Mar 08, 2017 5:44 am
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(). :?

Re: Ask a simple question, get a simple answer

Posted: Wed Mar 08, 2017 8:23 pm
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.

Re: Ask a simple question, get a simple answer

Posted: Wed Mar 08, 2017 10:00 pm
by Isaac
And there it is; everything makes sense again.
Thanks for the explanation. 8-)

Re: Ask a simple question, get a simple answer

Posted: Sun Mar 12, 2017 4:51 pm
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" },
}