System GUI Parabola Creator

Flare

Stops copies me!
Reaction score
662
I discovered a method of making parabolas through GUI (if someone hasn't already thought of it). Currently, the system allows for instant parabola creation and a periodic parabola creation over 3 seconds. I will upload a demo map soon with an example of how this can be used (an accurate grenade arc).

Importing instructions
Code:
Importing instructions:
 -Copy the unit abiliies, Parabola (Instant) and Parabola (Timed)
 -Make sure that your editor automatically creates unknown variables (go to File -> Preferences).
 -Copy and paste the triggers Immediate, Timed cast and Timed effect.
 -Copy the dummy unit Hidden Dummy (other dummy unit is optional, just used as an indicator in the demo map).
 -Copy the Height, Width, Left and Right triggers if you wish for the parabola to be configured by text commands.
 -Add the abilities to a unit.

WARNING: THIS DEMO MAP DOES NOT/WILL NOT HAVE THE FUNCTIONALITY TO CREATE AN ARC SUCH AS THAT OF A BALL THROWN INTO THE AIR. THAT WILL BE ADDED IN ANOTHER DEMO MAP.
The flying height parabola will not be controlled by text commands, but by distance between caster and target point. The longer the distance, the lower the flying height. The shorter the distance, the greater the flying height

GUI/JASS: GUI
Leaks: None
MUI: Fully MUI up to 100 instances
Configuring the parabola: Quite simple, done via chat commands which are displayed on game start.

If you intend on using this system, please credit me for making this.

Screenshots
parabolapic1od8.png


parabolapic2dz3.png
Relevant Code:
Code:
Immediate
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Parabola (Instant) 
    Actions
        Set Caster = (Triggering unit)
        Set CasterLoc = (Position of Caster)
        Set CasterFacing = (Facing of Caster)
        Set ParabolaAngle = (CasterFacing + Direction)
        -------- HeightPerEvent is always TotalHeight/(difference between the integer loop's max and min values divided by 2) i.e. 21-1=20/2=10 --------
        Set HeightPerEvent = (TotalHeight / 10.00)
        -------- HeightDecrease is always HeightPerEvent/(<Max loop value - Min loop value>/2) --------
        Set HeightDecrease = (HeightPerEvent / 10.00)
        -------- WidthPerEvent is always TotalWidth/(Max loop value - Min loop value) --------
        Set WidthPerEvent = (TotalWidth / 20.00)
        Unit - Create 1 Hidden Dummy for (Owner of Caster) at CasterLoc facing Default building facing degrees
        Set Dummy = (Last created unit)
        -------- The integer A from 1 to 21 allows us to get a single maximum point on the curve. --------
        For each (Integer A) from 1 to 21, do (Actions)
            Loop - Actions
                Set WidthPt1 = (Position of Dummy)
                Set WidthPt2 = (WidthPt1 offset by WidthPerEvent towards CasterFacing degrees)
                Unit - Move Dummy instantly to WidthPt2
                Set HeightPt1 = (Position of Dummy)
                Set HeightPt2 = (HeightPt1 offset by HeightPerEvent towards ParabolaAngle degrees)
                Unit - Move Dummy instantly to HeightPt2
                Unit - Create 1 Parabola Effect for (Owner of Caster) at HeightPt2 facing Default building facing degrees
                Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
                Set HeightPerEvent = (HeightPerEvent - HeightDecrease)
                Custom script:   call RemoveLocation (udg_WidthPt1)
                Custom script:   call RemoveLocation (udg_WidthPt2)
                Custom script:   call RemoveLocation (udg_HeightPt1)
                Custom script:   call RemoveLocation (udg_HeightPt2)
        Unit - Remove Dummy from the game
        Custom script:   call RemoveLocation (udg_CasterLoc)


WIDTH AND HEIGHT CONTROLS
Code:
height
    Events
        Player - Player 1 (Red) types a chat message containing h as A substring
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Real((Substring((Entered chat string), 2, 5)))) Greater than 1000.00
            Then - Actions
                Game - Display to (All players) the text: Max height is 1000,...
                Set TotalHeight = (1000.00 x 2.00)
            Else - Actions
                Set TotalHeight = ((Real((Substring((Entered chat string), 2, 5)))) x 2.00)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Real((Substring((Entered chat string), 2, 5)))) Less than 100.00
            Then - Actions
                Game - Display to (All players) the text: Minimum height is 1...
                Set TotalHeight = (100.00 x 2.00)
            Else - Actions
                Set TotalHeight = ((Real((Substring((Entered chat string), 2, 5)))) x 2.00)


Code:
Width
    Events
        Player - Player 1 (Red) types a chat message containing w as A substring
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Real((Substring((Entered chat string), 2, 5)))) Greater than 1000.00
            Then - Actions
                Game - Display to (All players) the text: Max width is 1000, ...
                Set TotalWidth = 1000.00
            Else - Actions
                Set TotalWidth = ((Real((Substring((Entered chat string), 2, 5)))) x 1.00)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Real((Substring((Entered chat string), 2, 5)))) Less than 100.00
            Then - Actions
                Game - Display to (All players) the text: Minimum width is 10...
                Set TotalWidth = 100.00
            Else - Actions
                Set TotalWidth = ((Real((Substring((Entered chat string), 2, 5)))) x 1.00)

DIRECTION CONTROLS!
Code:
Left
    Events
        Player - Player 1 (Red) types a chat message containing l as An exact match
    Conditions
    Actions
        Set Direction = 90.00
        Game - Display to (All players) the text: Direction: Left


Code:
Right
    Events
        Player - Player 1 (Red) types a chat message containing r as An exact match
    Conditions
    Actions
        Set Direction = -90.00
        Game - Display to (All players) the text: Direction: Right


UPDATE! I have finished the timed parabola. It is fully formed after 3 seconds, and is fully MUI up to 100 instances.


Screenshot of the timed parabola in action
timedparabolamuizn2.png
Relevant code
Code:
Timed cast
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Parabola (Timed) 
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                CustomValue Less than 100
            Then - Actions
                Set CustomValue = (CustomValue + 1)
            Else - Actions
                Set CustomValue = 1
        Set Caster[CustomValue] = (Triggering unit)
        Set CasterFacing[CustomValue] = (Facing of Caster[CustomValue])
        Set CasterLoc[CustomValue] = (Position of Caster[CustomValue])
        Set ParabolaAngle[CustomValue] = (CasterFacing[CustomValue] + Direction[CustomValue])
        -------- HeightPerEvent is always TotalHeight/(number of times the periodic event will occur/2) i.e. 75/2 --------
        Set HeightPerEvent[CustomValue] = (TotalHeight[CustomValue] / 37.50)
        -------- HeightDecrease is always HeightPerEvent/Number of times the periodic event occurs divided by 2 --------
        Set HeightDecrease[CustomValue] = (HeightPerEvent[CustomValue] / 37.50)
        -------- WidthPerEvent is always TotalWidth/Number of times periodic event occurs in time it takes to form parabola divided by 2 --------
        -------- i.e. 0.04 periodic event into 3 seconds is 75 occurences divided by 2 is 37.5 --------
        Set WidthPerEvent[CustomValue] = (TotalWidth[CustomValue] / 37.50)
        Unit - Create 1 Hidden Dummy for (Owner of Caster[CustomValue]) at CasterLoc[CustomValue] facing Default building facing degrees
        Unit - Set the custom value of (Last created unit) to CustomValue
        Set Dummy[CustomValue] = (Last created unit)
        Unit Group - Add Dummy[CustomValue] to DummyGroup
        Set Time[CustomValue] = 3.00
        Custom script:   call  RemoveLocation (udg_CasterLoc[GetUnitUserData(GetEnumUnit())])


Code:
Timed effect
    Events
        Time - Every 0.04 seconds of game time
    Conditions
        (Number of units in DummyGroup) Greater than 0
    Actions
        Unit Group - Pick every unit in DummyGroup and do (Actions)
            Loop - Actions
                Set WidthPt1[(Custom value of (Picked unit))] = (Position of (Picked unit))
                Set Time[(Custom value of (Picked unit))] = (Time[(Custom value of (Picked unit))] - 0.04)
                Set WidthPt2[(Custom value of (Picked unit))] = (WidthPt1[(Custom value of (Picked unit))] offset by WidthPerEvent[(Custom value of (Picked unit))] towards CasterFacing[(Custom value of (Picked unit))] degrees)
                Unit - Move (Picked unit) instantly to WidthPt2[(Custom value of (Picked unit))]
                Set HeightPt1[(Custom value of (Picked unit))] = (Position of (Picked unit))
                Set HeightPt2[(Custom value of (Picked unit))] = (HeightPt1[(Custom value of (Picked unit))] offset by HeightPerEvent[(Custom value of (Picked unit))] towards ParabolaAngle[(Custom value of (Picked unit))] degrees)
                Unit - Move (Picked unit) instantly to HeightPt2[(Custom value of (Picked unit))]
                Unit - Create 1 Parabola Effect for (Owner of Caster[(Custom value of (Picked unit))]) at HeightPt2[(Custom value of (Picked unit))] facing Default building facing degrees
                Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
                Set HeightPerEvent[(Custom value of (Picked unit))] = (HeightPerEvent[(Custom value of (Picked unit))] - HeightDecrease[(Custom value of (Picked unit))])
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Time[(Custom value of (Picked unit))] Less than or equal to 0.00
                    Then - Actions
                        Set Time[(Custom value of (Picked unit))] = 3.00
                        Unit - Remove (Picked unit) from the game
                    Else - Actions
                Custom script:   call RemoveLocation (udg_WidthPt1[GetUnitUserData(GetEnumUnit())])
                Custom script:   call RemoveLocation (udg_WidthPt2[GetUnitUserData(GetEnumUnit())])
                Custom script:   call RemoveLocation (udg_HeightPt1[GetUnitUserData(GetEnumUnit())])
                Custom script:   call RemoveLocation (udg_HeightPt2[GetUnitUserData(GetEnumUnit())])

Update: Fixed an issue with the Width command trigger, it was changing the width for the previous parabola formed instead of the next one
 

Attachments

  • Parabolic system update.w3x
    25.8 KB · Views: 265

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
In the "Timed effect" trigger, you can set the "Custom value of (Picked unit)" part into a variable to minimize the amount of function calls.


I am a little skeptical about this system, though. I mean, it's quite hard to modify it because this is in GUI.

All GUI system have that problem. Modifying, that is.
 

Flare

Stops copies me!
Reaction score
662
I am progressively adding all the details required to modify everything such as height of the parabola, width of the parabola, number of effects that are spawned which will make it much simpler, but it will take time.

Well, I've made out the triggers now so changing them would be a pain when it would just have the same effect and end up making alot of additional work for me.

ty for the feedback though
 

Cohadar

master of fugue
Reaction score
209
Look Flare, you seem to be smart enough to learn jass,
so my advice is that you start learning this instant.

None has ever returned to GUI after learning jass,
aren't you interested why?
 

Flare

Stops copies me!
Reaction score
662
I do want to learn JASS, but I don't have the time. I have exams coming up in February and I have to do well in them if I want to keep doing my school subjects at a higher level. It's my last year at school before college, so I'd rather not end up doing something I don't want to in college because of learning JASS unless you think it's possible to get a basic knowledge of JASS within a reasonably short amount of time. You got an idea of the time and stuff if I was able to learn JASS for roughly... 4 or 5 hours a week (and that would probably be an absolute maximum :S)?

Edit: Also, what utilities would be very useful to me for learning JASS? I currently have the NewGen pack, but I don't know much about it. If you have any links, that would be a great help since Daelin's GUI to JASS tutorial contains a link for a JASS editor but the link goes to wc3sear.ch so I get an error in trying to load the page.
 

Cohadar

master of fugue
Reaction score
209
NewGen is just fine for now, you don't need anything else.
And if you are smart enough to go to college then you are smart enough to learn jass. It really is not that hard, I mean it absolutely so lame that it has like 20 keywords...

Advice1: Stay away from struct inheritance, interfaces and similar stuff.
It is what Vexorian added to JASS and it is what makes it too complicated for programming beginners.
Try to learn the basics first.

Advice2: Do not think you can learn jass by converting your old GUI triggers.
It is actually the worst way to learn jass and the reason most people give up on it. (I personally blame blizzard and their idiotic GUI code generator)

A small tutorial: (wc3c works again)
http://www.wc3campaigns.net/showpost.php?p=975455&postcount=4

Also make sure to check out tutorial section here at TH.
 

Flare

Stops copies me!
Reaction score
662
Currently I'm just converting GUI events since I haven't an idea of what the functions are in JASS. Once I can remember the basic events and conditions that I use (starts effect of an ability, periodic events, ability/integer comparisons), I should have very little need to convert stuff from GUI to JASS.

Currently, I find NewGen to be a huge help because of the index of all the functions and what you need for them to work ^^. So far, I've figured out how to kill a unit, revive it, display game text and that was about 2 or 2:30pm GMT (its now 4:50pm GMT :p). And I have no intention of using structs and handles and all those other things yet because a) I don't know what they even do and b) I want to be able to make something half-way significant in the first place before I even attempt to use it.


I just hope I am smart enough for college... ^^ I'd like to continue with making spells but since I'm hearing stuff about GUI being so limited compared to JASS, it seems logical to start learning JASS.

Btw, did you ever actually comment on my system?

edit: oh ye, what exactly is vJASS, do i have to download it or does it come with the NewGen pack and is it advisable to learn vJASS while i'm trying to figure out 'normal' JASS
 

Cohadar

master of fugue
Reaction score
209
vJASS is NewGen version of jass (aka normal jass + struct and other stuff...)

I did not comment on your system.... well because it is GUI == useless to me.
 
D

Dr4gonL0rd

Guest
Well, in one of the screenshots, an oval shape is created, which really isn't a parabola. A parabola has no specific start or end point; it goes on for infinity.
 

Arcane

You can change this now in User CP.
Reaction score
87
There's a second screenshot now. And, the first one might be two parabolas.
 

Flare

Stops copies me!
Reaction score
662
There's a second screenshot now. And, the first one might be two parabolas.

Precisely. I could've extended the lifetime of the flame dummies so the hero could move to a more suitable position where I could alter the direction but it wasn't really necessary. The screenshot shows that the system (if it is truly a system as such :S) allows for complete control of distance, height and direction (even though direction would be totally unnecessary in the event of a parabolic flight path since the direction would be based on the angle between points in most cases).

Timed parabola picture is a much more accurate impression of what it actually does (now just imagine that picture in such a way that the perpendicular distance between any flame effect and the imaginary line created between first and last flame effect would be the flying height [essentially imagining that the parabola is like some sort of curved structure standing upright, its difficult to explain ^^])
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top