• 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] Custom Script : Local problem!

Status
Not open for further replies.
Level 12
Joined
Aug 18, 2006
Messages
1,193
i know how to make variables local, but there seem to be a problem

there seems to be a duration on the localing

here is my trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to Snow Storm
  • Actions
    • Custom script: local weathereffect udg_SnowStorm
    • Environment - Change terrain type at (Center of My Region) to Lordaeron Winter - Snow using variation -1 in an area of size 10 and shape Circle
    • Set SnowStorm = (Last created weather effect)
    • Wait 20 Seconds
    • Remove SnowStorm
ya, i know its leaky, but after these 20 seconds, the Snow Storm doesnt go away! how do i fix this
 
Last edited:

Lej

Lej

Level 3
Joined
Jun 5, 2004
Messages
36
  • Environment - Change terrain type at (Center of My Region) to Lordaeron Winter - Snow using variation -1 in an area of size 10 and shape Circle
Uses SetTerrainTypeBJ() which doesn't set bj_lastCreatedWeatherEffect which means you set SnowStorm to null.

To be able to revert the terrain back to the previous I guess you would have to check what type of terrain there is at each tile and store them. Then after the wait use the store data to change it back.
 

Lej

Lej

Level 3
Joined
Jun 5, 2004
Messages
36
@ Lej
it works without the local, why?

Can you post the trigger, without local, that works. Because I tried with:
  • SnowStorm
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Environment - Change terrain type at (Center of (Playable map area)) to Lordaeron Winter - Snow using variation -1 in an area of size 10 and shape Circle
      • Set SnowStorm = (Last created weather effect)
      • Wait 1.00 seconds
      • Environment - Remove SnowStorm
before looking up what the functions do.
 
Level 12
Joined
Aug 18, 2006
Messages
1,193
oh, now i realise i made some changes before i tried to make the skill MUI, and now i also realise what you mean, sry everybody

+ rep to you Lej

but i got another local problem, that doesnt have to do with a weather effect..... i might post it soon

EDIT : Here is our new problem

this trigger doesnt work
  • Set SnowStormCaster = (Casting unit)
  • Set Position = Position of (Casting unit)
  • Set Region = Region <gen>
  • Region - Center Region on Position
  • Environment - Change terrain type at (Center of Region) to Lordaeron Winter - Snow using variation -1 in an area of size 10 and shape Circle
  • Wait 5 seconds(game-time)
  • Environment - Change terrain type at (Center of Region) to Lordaeron Winter - Snow using variation -1 in an area of size 10 and shape Circle
while this one doesnt

  • Custom script: local rect udg_Region
  • Set SnowStormCaster = (Casting unit)
  • Set Position = Position of (Casting unit)
  • Set Region = Region <gen>
  • Region - Center Region on Position
  • Environment - Change terrain type at (Center of Region) to Lordaeron Winter - Snow using variation -1 in an area of size 10 and shape Circle
  • Custom script: call RemoveLocation (udg_Position)
  • Wait 5 seconds(game-time)
  • Environment - Change terrain type at (Center of Region) to Lordaeron Winter - Snow using variation -1 in an area of size 10 and shape Circle
  • Custom script: call RemoveRect (udg_Region)
what is the problem here?

oh, almost forgot, the problem is, that the Terrain change doesnt occur, and i have manage to solve that problem too, now, my new problem is, that it isnt MUI, even though it got locals :S
 
Last edited:
Level 8
Joined
Jul 23, 2005
Messages
329
You're leaking anyway, because (Center of Region) in
  • Environment - Change terrain type at (Center of Region) to Lordaeron Winter - Snow using variation -1 in an area of size 10 and shape Circle
Leaks a point.
 
Last edited:
Status
Not open for further replies.
Top