• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Lightning (effects and doodads)

Status
Not open for further replies.
Level 2
Joined
Oct 10, 2007
Messages
12
Hey, I played a Lord of the Rings map called Helm's Deep that had lightning cinematics, and I thought it was cool.

I wanted to try the same sort of thing in my map, except when I place doodads, the lightning just sits there (it goes continuously).

Do I need to make triggers to create and destroy lightning spikes, and to add sound? Or is there a better way to do it?
 
Level 2
Joined
Oct 10, 2007
Messages
12
Maybe, but I doubt I could do that if I can't even figure this out.

And I think I'll stick with the doodad for now, I looked at some other FX and didn't particularly like them for my map.

  • Lightning FX
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • Special Effect - Create a special effect at (Random point in (Playable map area)) using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
      • Wait 0.50 seconds
      • Sound - Play LightningBolt1 <gen> at 100.00% volume, located at (Random point in (Playable map area)) with Z offset 0.00
      • Special Effect - Destroy (Last created special effect)
I have two problems with this code at the moment.

1. The lightning and sound FX happen in different locations.
2. The lightning goes off at set time intervals. Is there a way to do random time intervals, with specified minimum / maximum intervals?
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
and learn jass quicker as you can if you are gonna use special effets
I have a good lightning code but cant post it right now because its not in my pc
Hey I thought again I posted it in another thread w8 I'll get quote
This creates a lightning effect like in spells of Zeus

IMPORTANT: You will use
  • Custom Script: call thunder((GetRandomLocInRect(GetPlayableMapRect()))
instead of
  • Custom Script: call thunder(GetSpellTargetLoc())
it isnt a model actually its a lightning effect like when you cast chain lightning but it comes from up so its something you can create with JASS or you may make a dummy unit with lightning attack ability but Jass suggested

JASS:
function thunder takes location pos returns nothing
local effect spec
local lightning light
local real x = GetLocationX(pos)
local real y = GetLocationY(pos)
set light = AddLightningEx("CLPB",true,x,y,1000,x,y,0)
set spec = AddSpecialEffect("Abilities\\Weapons\\Bolt\\BoltImpact.mdl",x,y)
call DestroyEffect(spec)
call TriggerSleepAction(0.1)
call DestroyLightning(light)
set light = null
set spec = null
endfunction
this is my thunder code simple to use and no leaks
you put this to map header
(<map name>.mdx in trigger editor)

and execute with
  • Custom Script: call thunder(GetSpellTargetLoc())
when you execute this with a spell it will create a thunder effect at the point you casted the spell
anyway change GetSpellTargetLoc() for changing location
try GetUnitLoc(GetSpellTargetUnit()) if GetSpellTargetLoc() doesnt work

Edit:
Ups forgot to tell +rep please :grin:
 
Status
Not open for further replies.
Top