• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

GUI to vJass

Status
Not open for further replies.
Level 8
Joined
Jul 18, 2010
Messages
332
Can anybody or has anybody made a vJass tutorial in a GUI perspective or is this impossible? I've been really wanting to replace some of my periodic triggers(most of this triggers are aoe spell and projectile spells) that produces many dummy units and special effects into vJass to make it run smoother and faster. This periodic triggers doesn't necessarily run throughout the game but they are turned on and then turned off after a couple of seconds. I have almost a hundred of these triggers and most of the units used this. Really need help on this one so I can reduce the lag on my map. I've been reading some tutorials but I can't really understand them because the GUI that I've learned is stuck in my head.
 
Level 8
Joined
Jul 18, 2010
Messages
332
Mr Bean987, thank you very much that's exactly the answer that I've been needing. You see, most of the spells in my map are projectile spells and I just want to know how to convert them to the vJass so it would be more efficient. But if possible I also wanna know how to do rush and knockback spells and other spells that involves periodic events(I'm targeting the periodic events to reduce lag in my map). Here's one of them.
  • projectile skill
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Claw Shrimp Orb
    • Actions
      • Set projectileunit = (Triggering unit)
      • Set projectilepoint = (Position of (Triggering unit))
      • Set projectiletarget = (Target point of ability being cast)
      • Set projectiletime = 5.00
      • Set projectileangle = (Angle from projectilepoint to projectiletarget)
      • Animation - Play projectileunit's attack animation
      • Unit - Create 1 claw shrimp orb for (Owner of (Triggering unit)) at projectilepoint facing (Facing of (Triggering unit)) degrees
      • Unit Group - Add (Last created unit) to projectilegroup
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
      • Hashtable - Save projectiletime as 1 of (Key (Last created unit)) in projectilehashtable
      • Hashtable - Save projectileangle as 2 of (Key (Last created unit)) in projectilehashtable
      • Hashtable - Save Handle Ofprojectileunit as 3 of (Key (Last created unit)) in projectilehashtable
      • Trigger - Turn on projectile spell Copy <gen>
      • Custom script: call RemoveLocation (udg_projectilepoint)
      • Custom script: call RemoveLocation (udg_projectiletarget)
  • projectile skill Copy
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in projectilegroup and do (Actions)
        • Loop - Actions
          • Set projectiletime = (Load 1 of (Key (Picked unit)) from projectilehashtable)
          • Set projectileangle = (Load 2 of (Key (Picked unit)) from projectilehashtable)
          • Set projectileunit = (Load 3 of (Key (Picked unit)) in projectilehashtable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 1 of (Key (Picked unit)) from projectilehashtable) Greater than 0.00
            • Then - Actions
              • Set projectiletargetpoint = (Position of (Picked unit))
              • Set projectiletargetpoint_Copy = (projectiletargetpoint offset by 30.00 towards projectileangle degrees)
              • Unit - Move (Picked unit) instantly to projectiletargetpoint_Copy, facing (Facing of (Picked unit)) degrees
              • Set projectiletargetgroup = (Units within 150.00 of projectiletargetpoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an ally of (Owner of (Picked unit))) Equal to False) and (((Race of (Ma
              • Unit Group - Pick every unit in projectiletargetgroup and do (Actions)
                • Loop - Actions
                  • Unit - Cause projectileunit to damage (Picked unit), dealing 400.00 damage of attack type Chaos and damage type Normal
                  • Special Effect - Create a special effect attached to the origin of (Picked unit) using Encourage.mdx
                  • Special Effect - Destroy (Last created special effect)
                  • Special Effect - Create a special effect attached to the origin of (Picked unit) using IceNova2_squished.mdx
                  • Special Effect - Destroy (Last created special effect)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in projectiletargetgroup) Greater than or equal to 1
                • Then - Actions
                  • Unit - Remove (Picked unit) from the game
                • Else - Actions
              • Custom script: call DestroyGroup(udg_projectiletargetgroup)
              • Custom script: call RemoveLocation (udg_projectiletargetpoint)
              • Custom script: call RemoveLocation (udg_projectiletargetpoint_Copy)
              • Hashtable - Save (projectiletime - 0.03) as 1 of (Key (Picked unit)) in projectilehashtable
            • Else - Actions
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in projectilehashtable
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 1 of (Key (Picked unit)) from projectilehashtable) Equal to 0.00
            • Then - Actions
              • Animation - Reset (Picked unit)'s animation
              • Unit Group - Remove (Picked unit) from projectilegroup
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in projectilegroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Do nothing
 
There is a few things you can already do to reduce lag, and you don't even need vjass to do it. Remove the Donothing. Replace the gui move unit instantly with custom script setunitx&y. try a 0.04 timer with increased speed var's. to match 0.03 speed. Most importantly, one system for everything is best. as in only one system for movement, only one for collision, only one for physics, and whatever.
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
After waiting for about 5 minutes for the map to save I came across the "memory exhausted" error. Does anyone else get this?

EDIT: After updating to JNGP v5e the message now says "Parser stack overflow". First time I've ever seen a stack overflow in Warcraft :O
 
Last edited:
Level 16
Joined
Aug 7, 2009
Messages
1,403
If you're willing to use vJASS to create projectiles, you could simply get a projectile system - not only would it make creating missiles a lot easier, but it would also generate less code in the long run. To make it even better for a vJASS rookie, you can study the code too, so you could even learn from the system.
 
Level 16
Joined
Aug 7, 2009
Messages
1,403
Well, I'm using Kenny's "Projectile". It's a little bit outdated (not the fastest one out there - though its interface and user-friendliness is awesome), and it's really complex, but if you can fully understand it, you're good to go.

xemissile might also be a good pick as it's part of xe, and it's a quite common library among spellmakers.
 
Status
Not open for further replies.
Top