Question(s) on rangedAttack
Question(s) on rangedAttack
From the modding resource:
rangedAttack: the ranged attack to perform when “ranged_attack” animation event is triggered. Must be one of the following: “lightning_bolt”, “lightning_bolt_greater”, “ice_shards”, “fireball”, “fireball_greater”, “poison_bolt”, “frost_arrow”.
Why are we limited to these? How would I go about using frostbolt instead?
rangedAttack: the ranged attack to perform when “ranged_attack” animation event is triggered. Must be one of the following: “lightning_bolt”, “lightning_bolt_greater”, “ice_shards”, “fireball”, “fireball_greater”, “poison_bolt”, “frost_arrow”.
Why are we limited to these? How would I go about using frostbolt instead?
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!
Re: Question(s) on rangedAttack
Probably limited to those because those are the only ones monsters used in the main game, I think.
Re: Question(s) on rangedAttack
I figured as much. But we must be able to expand on it. An Icy Uggardian using ice shards will use it even if out of range. :\
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!
Re: Question(s) on rangedAttack
Errrrr, I guess you'd have to cancel the spell the monster was gonna cast by using the onRangedAttack hook, then spawn your frostbolt from the monster's x, y, facing?
Re: Question(s) on rangedAttack
I already posted this on one of my posts.
onRangedAttack = function(self)
if self.facing == 0 then
spawn("armagedon", self.level, self.x, self.y-1, self.facing)
end
if self.facing == 1 then
spawn("armagedon", self.level, self.x+1, self.y, self.facing)
end
if self.facing == 2 then
spawn("armagedon", self.level, self.x, self.y+1, self.facing)
end
if self.facing == 3 then
spawn("armagedon", self.level, self.x-1, self.y, self.facing)
end
Just replace armagedon with any your spells. Custom spells or regular. Then the monster will shoot two spells. The one it would normally and the new one.
LG
onRangedAttack = function(self)
if self.facing == 0 then
spawn("armagedon", self.level, self.x, self.y-1, self.facing)
end
if self.facing == 1 then
spawn("armagedon", self.level, self.x+1, self.y, self.facing)
end
if self.facing == 2 then
spawn("armagedon", self.level, self.x, self.y+1, self.facing)
end
if self.facing == 3 then
spawn("armagedon", self.level, self.x-1, self.y, self.facing)
end
Just replace armagedon with any your spells. Custom spells or regular. Then the monster will shoot two spells. The one it would normally and the new one.
LG
Dungeon Master and DOOM will live forever.
Re: Question(s) on rangedAttack
Great solution.
Just to improve it a little bit:
local dx, dy = getForward(self.facing)
spawn("whatever", self.level, self.x + dx, self.y + dy, self.facing)
return false
Should do the trick in less lines, plus, thanks to the return, cancel the original spell.
Just to improve it a little bit:
local dx, dy = getForward(self.facing)
spawn("whatever", self.level, self.x + dx, self.y + dy, self.facing)
return false
Should do the trick in less lines, plus, thanks to the return, cancel the original spell.
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com
The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563
My preciousss: http://www.moonsharp.org
The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563
My preciousss: http://www.moonsharp.org
Re: Question(s) on rangedAttack
If in some other case you still needed a few separate lines, you can use elseif instead of fully separate if...end (so long as it makes sense to do so and it's not a case where it might be logical to do BOTH things)
Finished Dungeons - complete mods to play
Re: Question(s) on rangedAttack
I don't understand how to implement these scripts.
I tried throwing Garth's in the monster's script, but it causes the file not to open.
Not a clue as to where to stick Xanathar's either.
Edit: got Garth's to load the file. (was missing an end.)
It however creates an error message in the console.
How can I get Xanathar's to work?
I tried throwing Garth's in the monster's script, but it causes the file not to open.
Not a clue as to where to stick Xanathar's either.
Edit: got Garth's to load the file. (was missing an end.)
It however creates an error message in the console.
How can I get Xanathar's to work?
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!
Re: Question(s) on rangedAttack
Xanathar script would look like this:
Haven't tried it but it looks good.
Code: Select all
onRangedAttack = function(self)
local dx, dy = getForward(self.facing)
spawn("frostbolt", self.level, self.x + dx, self.y + dy, self.facing)
return false
end,
Re: Question(s) on rangedAttack
welp. the function(self) part was what I was missing lol.
Thanks Batty. Testing now.
PERFECT!
Thanks everyone. Frozen Uggardian should be ready to pack shortly. What should we name it?
Lets do it logically and disect the word before voting.
Ug Gardian
Gardian phonetically sounds like 'guardian' and I feel that's what it means.
That means Ug means something fire related?
So lets vote on one syllable 'words' to name the cold uggardian.
I vote 'er' Ergardian
Thanks Batty. Testing now.
PERFECT!
Thanks everyone. Frozen Uggardian should be ready to pack shortly. What should we name it?
Lets do it logically and disect the word before voting.
Ug Gardian
Gardian phonetically sounds like 'guardian' and I feel that's what it means.
That means Ug means something fire related?
So lets vote on one syllable 'words' to name the cold uggardian.
I vote 'er' Ergardian
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!