1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[JASS] Expected ' Error Help Please

Discussion in 'Triggers & Scripts' started by Darkwing, Aug 28, 2011.

  1. Darkwing

    Darkwing

    Joined:
    May 15, 2008
    Messages:
    150
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Why thank you all for clearing that thingie about triggers. ^^

    Q1 - So what's better using stuff like
    Code (vJASS):
    call TriggerRegisterTimerEventPeriodic( Some_Trigger, 2 )

    or using local Timers or Timers generaly?

    Q2 - Also Bribe mentioned that cycling through all spells is faster than having dozens of timers run in the same time, does this apply to the TimerPeriodicEvent also?
    Cuz I cannot realy cycle through all of spells it would be one trigger where some kind of identfication would need to be applied for recognizing which spell is being done and that's num of spells x ITE functions for each but that's a pain in the ass. :grin:

    Q3 - Also can unit groups be saved somehow into hashtable I've been trying to do that in GUI versions of spells for example Wave damage spells so I can save the damaged units stocked into group but it didn't worked?

    Q4 - Uhm Spinnaker your code wasn't working for x > 12 so I've changed that into < and than it worked but I'm not seeing reason why is that? Also when moving a unit shouldn't you be using angle in which you want to move the unit when multiplying with sin cos to ge x,y coordinates instead of using 90 degree angle?? That wai the wave always goes to the right hehehehe ^^ :p. BTW thanks for the code it's really helpful.

    Q5 - Also with this you can get id of every handle like when setting a unit into variable and than getting it's id?
    Code (vJASS):
    set id = GetHandleId(SomeUnit)


    Q6 - and what's with this you can like set what's the last created unit?!
    Code (vJASS):
    set bj_lastCreatedUnit = CreateUnit(GetTriggerPlayer(), 'h000', GetUnitX(u), GetUnitY(u), bj_UNIT_FACING)
     
    Last edited: Aug 30, 2011
  2. Pharaoh_

    Pharaoh_

    Joined:
    Nov 6, 2008
    Messages:
    8,127
    Resources:
    11
    Icons:
    3
    Skins:
    1
    Spells:
    6
    Tutorials:
    1
    Resources:
    11
    Q1: Depends on the use, really.
    Q2: Adding units to a unit group and enumerating them in the periodic event usually does the trick.
    Q3: You need a custom script, e.g.:
    • Custom script: call SaveGroupHandle (udg_Hash, Where, Label, Value)

    Q4: "90" is not the angle; it's the offset. The script moves the unit to the east, since 0 degrees is east, 90 is north, 180 is west and 270 is south.
    Q5: Not sure if that's what you ask, but yes, you can get the handle id of a variable'd unit.
    Q6: It's a Blizzard global variable, instead of increasing and decreasing the handle counter all the time, you can use this globally generated one.
     
  3. Darkwing

    Darkwing

    Joined:
    May 15, 2008
    Messages:
    150
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Why thank you Pharaoh you rulez, I get that thingies I just needed confirmation ^^

    Sry for not using right terminology with offset and angles I used to call all of that angles, the real angle is between the caster and casting point. :p

    I know i need to use xustom script :p

    Yup I asked cuz normaly in GUI you can't set the id of a unit unless it's that blizzard refferenced type (triggering unit, picked unit last created, again sry for terminology if I got it wrong)

    About Timers and TimedEvent, I mean in GUI I use a general pattern of activation trigger and a effect trigger which has timer event, with storage of variables into hashtables. I turn off the effect trigger if unit group (for check) is empty e.g. there are no active spell effects. My question is is it better to use timer and pause them or use timer events when having multiple spells and a knockback/jump sys.
    I am over exaggerating cuz I have no lag with the systems/spells and they work perfect, I'm just trying to improve them by trying to have in mind both minimum and maximum chance when they are used i mean when it's just casted one spell, and when there are 100 instances running. But that won't happen it's a Hero Arena and most of spell effects last under 0.8 sec guess that's ok.

    Thank you ^^
     
  4. Pharaoh_

    Pharaoh_

    Joined:
    Nov 6, 2008
    Messages:
    8,127
    Resources:
    11
    Icons:
    3
    Skins:
    1
    Spells:
    6
    Tutorials:
    1
    Resources:
    11
    For GUI, I prefer a timed event, than creating and destroying a timer (array'd variable).

    I know there's no such thing in GUI to get the handle of a variable; just make an integer variable and use the custom script to GetHandleId() ;]

    Jass can generally save you some lag, but it cannot eliminate it. There's always a limit that even the best script can't ignore.
     
  5. Darkwing

    Darkwing

    Joined:
    May 15, 2008
    Messages:
    150
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Thank you very very much Pharaoh :goblin_good_job:!!!

    One more question:

    Q1 - I'm makin some dynamic movement system for jumps and etc, and I need to put sfx for different terrain type and i cannot seem to get either of these 3 functions to work, i get "Expected a name" error in line for these 2

    Code (vJASS):
    set TempBoolean = IsPointWaterLoc(TempPoint)

    set TempBoolean = IsPointWater(GetLocationX(TempPoint), GetLocationY(TempPoint))


    and for this one Im using ITE funcion with message debug so it displays Terrain is land/water, just it show land weather I'm on land or in water. :eekani:

    Code (vJASS):
    set TempBoolean = (IsTerrainPathable(GetLocationX(TempPoint) ,GetLocationY(TempPoint) ,PATHING_TYPE_AMPHIBIOUSPATHING))


    what's the prob I don't get it?

    EDIT:
    I've screwed a little with pathing check, replacing the cond of boolean to check if false (original it was true), but now it shows water debug msg only while I'm on the cliffs which translate from land to water(wheather it's shallow or deep), when i stand at any point of the pool it show land msg again. I was using the GetLocationZ so all values under 0 are considered water but I wanna add some pool on cliffs so i need to get this checking to work.

    EDIT 2: Well I've got it to work for deep water using the dual pathability check from the IsPointWater func, but is there any way to make this work for shallow water??