Slide

S

SpreaDisease

Guest
Code:
Slide on Ice
    Events
        Time - Every 0.15 seconds of game time
    Conditions
    Actions
        Set tempGroup = (Units in (Playable map area) matching ((Owner of (Matching unit)) Not equal to Player 12 (Brown)))
        Set trigGroup[1] = (Units in (Playable map area) owned by Player 1 (Red))
        Set trigGroup[2] = (Units in (Playable map area) owned by Player 2 (Blue))
        Set trigGroup[3] = (Units in (Playable map area) owned by Player 3 (Teal))
        Set trigGroup[4] = (Units in (Playable map area) owned by Player 4 (Purple))
        Set trigGroup[5] = (Units in (Playable map area) owned by Player 5 (Yellow))
        Set trigGroup[6] = (Units in (Playable map area) owned by Player 6 (Orange))
        Set trigGroup[7] = (Units in (Playable map area) owned by Player 7 (Green))
        Set trigGroup[8] = (Units in (Playable map area) owned by Player 8 (Pink))
        Set trigGroup[9] = (Units in (Playable map area) owned by Player 9 (Gray))
        Unit Group - Pick every unit in tempGroup and do (Actions)
            Loop - Actions
                Set tempPoint = (Position of (Picked unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Terrain type at tempPoint) Equal to Northrend - Ice
                    Then - Actions
                        Unit Group - Pick every unit in trigGroup[(Player number of (Owner of (Picked unit)))] and do (Actions)
                            Loop - Actions
                                Unit - Order (Picked unit) to Move To ((Position of (Picked unit)) offset by 115.00 towards (Facing of (Picked unit)) degrees)
                    Else - Actions
                Custom script:   call RemoveLocation(udg_tempPoint)
        Custom script:   call DestroyGroup(udg_tempGroup)

This is my slide Triggers. but when i slide my unit is moving like im having lagg. do u know wut i can do? plesae help me.
 
You can set the Time Event to .01 (which will give you best-possible results without using a timer [which you're probably already getting] ) or set up a Timer to fire off every .02 (50-fps) or .01 (100-fps) and when the timer expires, do those actions.
 
Luth said:
You can set the Time Event to .01 (which will give you best-possible results without using a timer [which you're probably already getting] ) or set up a Timer to fire off every .02 (50-fps) or .01 (100-fps) and when the timer expires, do those actions.

Are you insane? For a junior... I've seen 2 posts from you... And they both are completely idiotic...

That would cause more lag.

Destroy the 9 OTHER unit groups you have. Every 400 times a minute you have messed up unit groups floating around the place meaninglessly, causing lag...

Don't think because you destroy 1 group, that it will destroy 9 that are considered to be inside it...

And, the trigger stinks... People can stop sliding easily... But this way it won't cause as much lag as the more... Widely prefered way which has less flaws, except for lag of course.

And it moves ALL units owned by the player.. So unless you want all of the players units to move while only 1 of them is on ice, then go ahead... But you should only make the picked unit move...

Not only that, the trigger refires for each unit, causing a multiple action of the single action you wanted... Causing more lag...

So you are doing a lot of pointless overlapping functions that only a noob would do...

Then again... We fall so we can stand up and learn from our mistakes...

Just use some logic and clean it up...

Destroy those 9 other unit groups,...

Actually... Don't even use those 9 extra unit groups in this trigger...

Make it

Code:
Slide on Ice
    Events
        Time - Every 0.15 seconds of game time
    Conditions
    Actions
        Set tempGroup = (Units in (Playable map area) matching ((Owner of (Matching unit)) Not equal to Player 12 (Brown)))
        Unit Group - Pick every unit in tempGroup and do (Actions)
            Loop - Actions
                Set tempPoint = (Position of (Picked unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Terrain type at tempPoint) Equal to Northrend - Ice
                    Then - Actions
                        Unit - Order (Picked unit) to Move To (tempPoint offset by 115.00 towards (Facing of (Picked unit)) degrees)
                    Else - Actions
                Custom script:   call RemoveLocation(udg_tempPoint)
        Custom script:   call DestroyGroup(udg_tempGroup)

Sorry if it's a bit messy looking. I copied and pasted your trigger... And then I took out the unnecessary functions...

I would reccomend using a move unit function... But this causes less lag... And I'm assuming you will have a lot of units in the game sliding for a long time... The above trigger should cause a lot less lag...

And it should be much cleaner...

If it doesn't match what you want, email me at [email protected]

I'll see what I can do... But you'll have to tell me what the map is about... And maybe email it to me... (Though I'd rather you don't) So I can fix it up a bit...

I've dealt with these annoying lag bitches... And I won...

Until I test the machine gun and sub machine gun online that is -.-... (Damn automatic mode... So cool... But can cause lag...)
 
"Hypocrite! First remove the plank from your own eye, and then
you will see clearly to remove the speck from your brother's eye."


You completely missed the point of why it acts like its laggy. The event "Every X seconds" has a minimum wait time, but regardless of that, every .15 seconds is still only 6 Frames Per Second. Now, maybe for you, 6 FPS is a good number, but for the rest of us, that will appear like "laggy" movement. Even if you set this to every 0.01 second of the game, the minimum wait value will come into play, and it'll still look jittery. To get a higher resolution of time management, you need to start a Countdown Timer for either .02 or .01 seconds, and run a slide trigger from there. Then, in the trigger, don't issue orders to move. To get proper sliding, you want to use Move Unit Instantly (which, again, is why you want higher time resolution).

Code:
Slide on Ice
    Events
        Slide Timer expires
    Conditions
    Actions
        Set tempGroup = (Units in (Playable map area) matching ((Owner of (Matching unit)) Not equal to Player 12 (Brown)))
        Unit Group - Pick every unit in tempGroup and do (Actions)
            Loop - Actions
                Set tempPoint = (Position of (Picked unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Terrain type at tempPoint) Equal to Northrend - Ice
                    Then - Actions[b]
                        Set tempPoint2 = tempPoint offset by 11.5 towards (Facing of (Picked unit)) degrees
                        Unit - Move (Picked unit) Instantly to (tempPoint2)
                        Custom script: call RemoveLocation(udg_tempPoint2)[/b]
                    Else - Actions
                Custom script:   call RemoveLocation(udg_tempPoint)
        Custom script:   call DestroyGroup(udg_tempGroup)
 
is liek this? im not realy good with triggers instead i copy them from some one :).


Code:
Slide
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Set tempGroup = (Units in (Playable map area) matching ((Owner of (Matching unit)) Not equal to Player 12 (Brown)))
        Unit Group - Pick every unit in tempGroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Terrain type at tempPoint) Equal to Northrend - Ice
                    Then - Actions
                        Set tempPoint2 = ((Center of (Playable map area)) offset by 11.50 towards (Facing of (Picked unit)) degrees)
                        Unit - Move (Picked unit) instantly to tempPoint2
                        Custom script:   call RemoveLocation(udg_tempPoint2)
                    Else - Actions
                        Custom script:   call RemoveLocation(udg_tempPoint2)
                Custom script:   call DestroyGroup(udg_tempGroup)


please tell me if its good or wrong.
 
Two things.

First, I cant tell if you're destroying your Unit Group INside or OUTside the loop. make sure its on the outside, otherwise you're in trouble.

Second, try your trigger using the event "Every 0.01 seconds of game time", and if that looks fine for you, then you're done. If it still looks jittery (which I suspect it will), then you'll want to create a Timer variable, and on Map Init, start that Timer as a multi-shot (? not one-shot) timer that expires in 0.01 seconds. Then change the trigger event to fire whenever the Timer expiers.
 
ok i fix it, just like how you said. but there the unit is not sliding. do you know why? do i need to make like this?
Code:
Set trigGroup[1] = (Units in (Playable map area) owned by Player 1 (Red))
to make it slide? or what? please help :banghead: :banghead: :banghead: :banghead: :banghead: :banghead: :banghead: :banghead: :banghead:
 
can u host? im on est gate. i can host and you can open the map and fix then you host it. you want? cause im not realy good with triggers.
 
I'm actually on my way out for an hour or two. I'll post back here when I get back, and if its still not working, I'll take the map and fix it up for ya. :)
 
Get it workin?
 
heres my amazing slide trigger that is wat is used in Polar Escape and my Icey Maze and Maze of Sliding Bunnies
Variables - Point_Position - Point

Code:
Slide
Events
    Time - Every 0.03 seconds of game time

Conditions

Actions
    For each (Integer A) from 1 to 10, do (Actions)
        Loop - Actions
            Custom script:   set bj_wantDestroyGroup = true
            Unit Group - Pick every unit in (Units owned by (Player((Integer A)))) and do (Actions)
                Loop - Actions
                    Set Point_Position = (Position of (Picked unit))
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        If - Conditions
                            And - All (Conditions) are true
                                Conditions
                                    ((Picked unit) is alive) Equal to True
                                    ((Owner of (Picked unit)) is an ally of Player 1 (Red)) Equal to True
                                    (Terrain type at Point_Position) Equal to Icecrown Glacier - Dark Ice
                        Then - Actions
                            Custom script:   call RemoveLocation (udg_Point_Position)
                            Set Point_Position = ((Position of (Picked unit)) offset by 13.00 towards (Facing of (Picked unit)) degrees)
                            Unit - Move (Picked unit) instantly to Point_Position
                        Else - Actions
    Custom script:   call RemoveLocation (udg_Point_Position)

Code:
Face Point
Events
    Unit - A unit Is issued an order targeting a point
Conditions
    (Terrain type at (Position of (Triggering unit))) Equal to Icecrown Glacier - Dark Ice
Actions
    Set Point_Position = (Target point of issued order)
    Unit - Make (Triggering unit) face Point_Position over 0.00 seconds
    Custom script:   call RemoveLocation (udg_Point_Position)

And that lets you move where ever you click and is very smooth slide.
 
.05 is good enough. Using move unit instantly keeps the guy going the proper direction, but it's an ice slide function... He doesn't need to use move unit.

The trigger above this should work fine, but make it every .05 seconds to be safer...

And I believe Call DestroyGroup(TempUnitGroup) works better than bj_wantDestroyGroup = True
 
first trigger ALWAYS ON

event
a unit enters (region) -event

condition
(triggering unit)= (your char)

action
turn on (make a new trigger and put the name here)


second trigger INITIALLY ON

event
every .02 seconds game time

action
unit- move (unit) instantly to (position of unit) offset by .9 towards facing of (unit) degrees

last trigger ALWAYS ON

event
unit leaves (region)

condition
triggering unit is equal to (unit)

action
turn off (the second trigger)
 
you are leaking a unit group every .5 seconds

For Integer A from 1 - (How ever many trigGroup Arrays you have)
Loop
Custom Script: call DestroyGroup(udg_trigGroup[GetForLoopIntA])

GetForLoopIntA is probably wrong, its something like that though. The problem was you had a custom script to destroy the variable, but its an array so you need to either do what i did which i think is easier, or just
Custom Script: call DestroyGroup(udg_trigGroup[1])
Custom Script: call DestroyGroup(udg_trigGroup[2])

they are both easy
 
General chit-chat
Help Users
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top