• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Making lightning type configurable

Status
Not open for further replies.
Level 9
Joined
Apr 19, 2011
Messages
447
Hi.

I have a spell well lightning effects are involved, and I want to make the lightning type fully configurable. However, I don't how to do it.

I'm actually using this:

  • Custom script: set udg_TempLight = AddLightningEx("FORK", true, GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), 0, GetUnitX(GetTriggerUnit()) + 500, GetUnitY(GetTriggerUnit()), 100)
Okay, I want "FORK" to be configurable, but I can't find the way to do it.
I've tried these two ways, and none of them works, both give me syntax errors:

  • Set LV_LT = "FORK"
  • Custom script: set udg_TempLight = AddLightningEx(udg_LV_LT, true, GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), 0, GetUnitX(GetTriggerUnit()) + 500, GetUnitY(GetTriggerUnit()), 100)
  • Set LV_LT = FORK
  • Custom script: set udg_TempLight = AddLightningEx("udg_LV_LT", true, GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), 0, GetUnitX(GetTriggerUnit()) + 500, GetUnitY(GetTriggerUnit()), 100)
LV_LT is a string variable.
How would be the correct way to do this? :eekani:

Regards
 
Hi.

I have a spell well lightning effects are involved, and I want to make the lightning type fully configurable. However, I don't how to do it.

I'm actually using this:

  • Custom script: set udg_TempLight = AddLightningEx("FORK", true, GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), 0, GetUnitX(GetTriggerUnit()) + 500, GetUnitY(GetTriggerUnit()), 100)
Okay, I want "FORK" to be configurable, but I can't find the way to do it.
I've tried these two ways, and none of them works, both give me syntax errors:

  • Set LV_LT = "FORK"
  • Custom script: set udg_TempLight = AddLightningEx(udg_LV_LT, true, GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), 0, GetUnitX(GetTriggerUnit()) + 500, GetUnitY(GetTriggerUnit()), 100)
  • Set LV_LT = FORK
  • Custom script: set udg_TempLight = AddLightningEx("udg_LV_LT", true, GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), 0, GetUnitX(GetTriggerUnit()) + 500, GetUnitY(GetTriggerUnit()), 100)
LV_LT is a string variable.
How would be the correct way to do this? :eekani:

Regards

  • Set LV_LT = FORK
  • Custom script: set udg_TempLight = AddLightningEx(udg_LV_LT, true, GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), 0, GetUnitX(GetTriggerUnit()) + 500, GetUnitY(GetTriggerUnit()), 100)
variable on custom scripts doesn't have to be " " or else it would give compile error.. and when you're setting a string variable, it doesn't need to be " " as well... and what variable is udg_TempLight ?
 
Sorry for the long time without answering. Well, your solution worked for setting the lightning type! This problem is solved.

and what variable is udg_TempLight ?

Obviously a lightning variable. :)



Well, now there's another problem with something very similar to this, so I decided to post it here instead of creating a new thread. Look at this:

  • Custom script: set udg_TempUnit = CreateUnit(Player(1), 'h000', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), 270.00)
OK, now I want to make "h000" configurable, but I'm once more having trouble.
I tried to use this:

  • Set udg_LV_D = h000
  • Custom script: set udg_TempUnit = CreateUnit(Player(1), udg_LV_D, GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), 270.00)
Also, I tried putting ' around the udg_LV_D in the script, and around h000 in the variable setting, but all the posibilities give me syntax errors.
Why!? I don't get it!

Can someone help?

Regards
 
  • Custom script: set udg_LV_D = 'h000'
  • Custom script: set udg_TempUnit = CreateUnit(Player(1), udg_LV_D, GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), 270.00)
the above trigger is an example of them.

Note : udg_LV_D should be an integer variable and set with custom script.
udg_TempUnit should be unit variable. :)

btw, i just realized that i'm talking to the creator of 'Monster Slayer', really nice ! i hope it's soon to be playable xD
 
  • Custom script: set udg_LV_D = 'h000'
  • Custom script: set udg_TempUnit = CreateUnit(Player(1), udg_LV_D, GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), 270.00)
the above trigger is an example of them.

Note : udg_LV_D should be an integer variable and set with custom script.
udg_TempUnit should be unit variable. :)

OK, my bad. I was using a string variable... :goblin_cry:
Problem solved. ;)

btw, i just realized that i'm talking to the creator of 'Monster Slayer', really nice ! i hope it's soon to be playable xD

Thanks! It's very nice for me to see this kind of comments!
Don't worry, I hope you won't have to wait too much for the first beta. ;)

There is another way (less Custom script - more understandable), you can do this;
  • Actions
    • Set Unit = (Triggering unit)
    • Set UnitType = (Unit-type of Unit)
    • Custom script: set udg_Integer = udg_UnitType
The "udg_Integer" is the one you configured the 'h000' before.

Well, I can't really use this, because in my trigger there's not a unit I can refer to. The ID I need is of a unit of the Object Editor.
Anyway, thank you for you answer.


Well then, issue solved.

Regards
 
Status
Not open for further replies.
Back
Top