Page 283 of 396

Re: Ask a simple question, get a simple answer

Posted: Sat Feb 23, 2019 2:25 pm
by THOM
You can change the ambient track by using GameMode.playStream("myTrack")

But there will always be a harsh cut between the two sounds. AFAIK there is no way to avoid that.

And I would like to recommend not to use real music. The player might stay for half an hour or much longer in one level and if you hear the same song again and again it can annoy very soon. There is a reason why AH used soundscapes in LoG.

Re: Ask a simple question, get a simple answer

Posted: Sun Feb 24, 2019 3:25 pm
by superraton
I'm making a custom dungeon and I have a problem. When I put a ceiling light somewhere (a mine_ceiling_pit_light for example) the light works only at 3 block distance from the party. I mean: if I get closer (2 block distance) the light suddenly turns off. Same issue on exported file. Two weeks trying to find a solution on the forum and nothing. What I'm missing?

Thanks you very much in advance.

Re: Ask a simple question, get a simple answer

Posted: Sun Feb 24, 2019 5:51 pm
by Pompidom
The Mine_ceiling_pit_light works as intended on my computer in the full 0 - 7 square range. So check your graphics settings if you have put everything on High.

Re: Ask a simple question, get a simple answer

Posted: Sun Feb 24, 2019 11:26 pm
by minmay
Spot lights are broken that way in Wine and maybe on some graphics cards on Windows as well. There's not really anything you can do about it.

Re: Ask a simple question, get a simple answer

Posted: Wed Feb 27, 2019 12:41 am
by Zo Kath Ra
Safe Fireburst Spell

a) When you cast a Fireburst spell in front of a wall, it spawns on the same tile as the party.
b) When you cast it on front of a barrel_crate_block, it spawns on the crate's tile.

I'd like to make a safe version of this spell.
In cases like (a), where Fireburst would spawn on the party's tile, the spell just fizzles.
In cases like (b), it works normally.

How does Fireburst determine which case to use?
Otherwise, I'll just have to try all possible cases and hope I don't miss any.

Re: Ask a simple question, get a simple answer

Posted: Wed Feb 27, 2019 1:18 am
by Pompidom
Zo Kath Ra wrote: Wed Feb 27, 2019 12:41 am Safe Fireburst Spell

a) When you cast a Fireburst spell in front of a wall, it spawns on the same tile as the party.
b) When you cast it on front of a barrel_crate_block, it spawns on the crate's tile.

I'd like to make a safe version of this spell.
In cases like (a), where Fireburst would spawn on the party's tile, the spell just fizzles.
In cases like (b), it works normally.

How does Fireburst determine which case to use?
Otherwise, I'll just have to try all possible cases and hope I don't miss any.
My guess is that fireburst is simply a projectile and simply behaves like a fireball or Fire Bomb. So my guess is projectile collider.

You can always make a custom "safe" Fireburst spell that always spawns a "fireburst" spell in the square in front of the party. This way it won't "sizzle" but the fireburst will be safe to use at all times I suppose :)

I'd be very interested in this "safe Fireburst" if you find out how to make it :)

Re: Ask a simple question, get a simple answer

Posted: Wed Feb 27, 2019 2:10 am
by Isaac

Code: Select all

defineSpell{ 
	name = "fireburst",
	uiName = "Fireburst",
	gesture = 1,
	manaCost = 25,
	skill = "fire_magic",
	requirements = { "fire_magic", 1 },
	icon = 60,
	spellIcon = 1,
	description = "Conjures a blast of fire that deals fire damage to all foes directly in front of you.",
	onCast = function(champion) 
			local dX, dY = getForward(party.facing)
			local X,Y = dX+party.x, dY+party.y 
			local obCheck = party.map:checkObstacle(party, party.facing)
			if obCheck == "door" or obCheck == "wall" then
				champion:showAttackResult("Fizzle", "SpellFizzle")
				playSound("spell_fizzle")
				return false
			end
			spawn("fireburst",party.level,X,Y,party.facing,party.elevation).tiledamager:setCastByChampion(champion:getOrdinal())
			return true
		end
}

Re: Ask a simple question, get a simple answer

Posted: Wed Feb 27, 2019 2:51 am
by minmay
Zo Kath Ra wrote: Wed Feb 27, 2019 12:41 am Safe Fireburst Spell

a) When you cast a Fireburst spell in front of a wall, it spawns on the same tile as the party.
b) When you cast it on front of a barrel_crate_block, it spawns on the crate's tile.

I'd like to make a safe version of this spell.
In cases like (a), where Fireburst would spawn on the party's tile, the spell just fizzles.
In cases like (b), it works normally.

How does Fireburst determine which case to use?
Otherwise, I'll just have to try all possible cases and hope I don't miss any.
I've reproduced the behaviour of the builtin Fireburst spell here. It should be easy to adapt this to fizzle if it targets the party's square.

Re: Ask a simple question, get a simple answer

Posted: Thu Feb 28, 2019 1:20 am
by Killcannon
Someone earlier was asking how to spawn spells in an area of effect. Here's the code to do so.

Code: Select all

function frostexplosion()

local fmax = 3

   for x = -fmax,fmax do
   for y = -fmax,fmax do
      if ( (x ~= 0) or (y ~= 0) ) then
         spawn("frostbolt_blast", 5, 25 + x, 7 + y, 0)
         spawn("frostbolt_blast", 5, 25 + x - 1, 7 + y - 1, 0) 
         spawn("frostbolt_blast", 5, 25 + x - 2, 7 + y - 2, 0) 
         spawn("frostbolt_blast", 5, 25, 7, 0)
         end
      end
   end
end
The above code will define a 3 x 3 square. You can modify the shape by changing the +- of the x and y values to be any rectangular shape. You can make it larger or smaller by changing the fmax value.

I do have a question with this. Is there a way to have a spell find the location of a monster or the party and spawn at that location? Would it be possible to also add a delay to this? If so how could it be done?

Re: Ask a simple question, get a simple answer

Posted: Thu Feb 28, 2019 2:01 am
by Isaac
The party is always the party, and can be referenced as such in a spell or hook. The monster id needs to be found by a hook either in the monster component, or a projectile component.