Jass scripts

  • Thread starter Thread starter Bananskral
  • Start date Start date
B

Bananskral

Guest
All right, heres the deal. I copied a JASS Script looking like this

Revive Hero
Events
Unit - A unit Dies
Conditions
((Triggering unit) is A Hero) Equal to True
Actions
Custom script: local timerdialog WINDOW
Custom script: local integer HEROWAIT
Custom script: local timer OURTIMER
Custom script: local unit OURHERO
Custom script: set OURHERO = GetDyingUnit()
Custom script: set HEROWAIT = ( GetHeroLevel(OURHERO) * 5 )
Custom script: set OURTIMER = CreateTimer()
Custom script: call StartTimerBJ( OURTIMER, false, ( I2R(HEROWAIT) ))
Custom script: call CreateTimerDialogBJ( OURTIMER, GetPlayerName(GetOwningPlayer(OURHERO)) )
Custom script: set WINDOW = GetLastCreatedTimerDialogBJ()
Custom script: call TimerDialogDisplayForPlayerBJ( true, WINDOW, GetOwningPlayer(OURHERO) )
Custom script: call PolledWait( HEROWAIT )
Custom script: call ReviveHeroLoc(OURHERO, GetRectCenter(GetPlayableMapRect()), true )
Custom script: call PanCameraToTimedLocForPlayer( GetOwningPlayer(OURHERO), GetUnitLoc(OURHERO), 0.60 )
Custom script: call DestroyTimerDialog(WINDOW)

I want to make the heroes revive at each their start location and not in the center of the map. I changed this line:
Custom script: call ReviveHeroLoc(OURHERO, GetRectCenter(GetPlayableMapRect()), true )

To:
Custom script: call ReviveHeroLoc(OURHERO, GetRectCenter(GetPlayerStartLocRect()), true )

It just doesnt work. Please post me it, so i can use it as it is. I really need it.
 
you have to specify start location you want. Use this:
Code:
GetPlayerStartLocationLoc takes player whichPlayer returns location
So yours might look like
Code:
call ReviveHeroLoc(OURHERO, GetPlayerStartLocationLoc(GetOwningPlayer(OURHERO)), true )

And to DDRtists. Using a JASS revive trigger makes it easier to make multi instanceable. And anyways, once you get fast at JASS, it's faster to use than gui by leaps and bounds.
 
Bananskral said:
Custom script: call ReviveHeroLoc(OURHERO, GetRectCenter(GetPlayerStartLocRect()), true ).

Congrats, I think that was one of the best guesses on what it could be I ever seen.

Change it to this and you will get it right:

Code:
Custom script: call ReviveHeroLoc(OURHERO, GetPlayerStartLocation(GetOwningPlayer(OURHERO)), true)

The reson on using jass on this is that you can have a longer revive timer than you can with a somewhat equal GUI trigger. In a GUI trigger this will eather be not multi instance or bugged with times over ~80.

Edit:
Prophet why do you have to edit ^^. Use wichever you want both works even if they are slighty different. (My uses the native directly and prophets uses the blizzard.j function, wich means that blizzard is :nuts: )
 
another jass problem

thank you, it worked, at least it didnt report failure. now its the secondlast line.

call PanCameraToTimedLocForPlayer( GetOwningPlayer(OURHERO), GetUnitLoc(OURHERO), 0.60 )

You can also see it in the start of the thread.
it says: Invalid argument type (integer)

wtf is wrong? i ´copied it from a trigger on the free thread part, and it just sucks. stinky...... :confused: please help
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    got it
  • The Helper The Helper:
    Happy Thursday!
  • The Helper The Helper:
    Check out the new Featured Content feature we apparently got with the forum software upgrade! https://www.thehelper.net/featured/
  • The Helper The Helper:
    Also on the bottom right side bar we now have a Trending Content Box!
    +1
  • The Helper The Helper:
    Not on the Headline News page just on the Forums page can we get that Featured and Trending on the home page?
  • Ghan Ghan:
    Since the home page is technically a forum, it now shows on all forum views. Still in the sidebar.
    +1
  • The Helper The Helper:
    Happy Friday! Hope everyone has a fantastic day and an even better weekend!
  • The Helper The Helper:
    Happy Sunday!
  • The Helper The Helper:
    I lovc that I can post webp and X links now! :)
  • The Helper The Helper:
    Happy Thursday!
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    we were down for a minute - think a log file or something got too big
    +1
  • Ghan Ghan:
    The alerts say it was down for a while unfortunately.
  • Ghan Ghan:
    Didn't know what was going on while I was at work.
  • Ghan Ghan:
    Disk filled up with logs. Fixed now.
    +1
  • The Helper The Helper:
    not a problem at all thanks for getting us back up
  • The Helper The Helper:
    I think the bots are finding a way to get through the anubis
  • The Helper The Helper:
    Happy Wednesday Everyone! Hope everyone has a Fantastic Day!
    +1
  • The Helper The Helper:
    Yeah, stats are showing big bot influx like 12k page views.
  • Wizard Wizard:
    :wave:
    +1
  • Ghan Ghan:
    TH changed his avatar again. 6 more weeks of summer.
    +3
  • Wizard Wizard:
    lol
    +1
  • The Helper The Helper:
    Guys just a heads up I am going to be shutting the site down soon. I am just waiting on the NUON people to decide whether they want to transfer forum data and keep the discord. My email is [email protected] for anyone that wants to keep in touch and I have a facebook too. I will make an official post later. Love you guys and will miss everyone!
    +1
  • V-SNES V-SNES:
    Sent a pm @The Helper

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top