The official site of Clan TMMM
 
HomeHomeSearchUsergroupsFAQRegisterLog in


Latest topics
» Gotta click fast - WC3 Mazing #mildlyinteresting
by hoffmann Wed Jun 21, 2017 10:28 pm

» Hey whats up
by Eat_bacon_daily Mon Oct 10, 2016 6:24 am

» I'm getting married and you guys are invited
by Achilles.42 Wed Sep 07, 2016 11:00 am

» Server Photo Album 1
by Pat1487 Sat Aug 06, 2016 5:28 pm

» Legacy of The Void Beta
by Achilles.42 Sun Oct 18, 2015 3:21 am

» Hey guys!!!
by Eat_bacon_daily Fri Oct 16, 2015 11:20 pm

» What everyone been up to
by The_Chosen_Oreo Sun Jun 14, 2015 11:55 am

SC2 Links
SC2 Challenge/Tourney Info

Official SC2 Forums

SC2 Curse

SC2Mapster

Team Liquid

SC2 Replayed

SC2 Strategy
WC3 Links
Clan_TMMM[Host] Info

WC3 Challenge/Tourny Rules

Epicwar
Poll
What game does everyone play now?
Starcraft 2
26%
 26% [ 8 ]
Warcraft 3
35%
 35% [ 11 ]
League of Legends
19%
 19% [ 6 ]
World of Warcraft
0%
 0% [ 0 ]
Diablo 2
0%
 0% [ 0 ]
No games at all
10%
 10% [ 3 ]
Other game not listed
10%
 10% [ 3 ]
Total Votes : 31
Transparency

Share | 
 

 Trigger not working but should

View previous topic View next topic Go down 
AuthorMessage
Pat1487
Moderator
Moderator
avatar


PostSubject: Trigger not working but should   Fri Apr 23, 2010 11:22 pm

Code:
    Events
        UI - Player Any Player presses W key Down with shift Allow, control Allow, alt Allow
        UI - Player Any Player presses A key Down with shift Allow, control Allow, alt Allow
        UI - Player Any Player presses S key Down with shift Allow, control Allow, alt Allow
        UI - Player Any Player presses D key Down with shift Allow, control Allow, alt Allow
    Local Variables
        direction = false <Boolean[4][4]>
    Conditions
    Actions
            General - If (Conditions) then do multiple (Actions)
            If Then Else
                General - Else if (Conditions) then do (Actions)
                    Else If
                        And
                            Conditions
                                direction[(Triggering player)][2] == false
                                (Key Pressed) == A
                    Then
                        ------- LEFT
                        Unit - Make lightcycle[(Triggering player)] face 180.0 over 0.0 seconds
                        Variable - Set direction[(Triggering player)][4] = true
                        Variable - Set direction[(Triggering player)][3] = false
                        Variable - Set direction[(Triggering player)][2] = false
                        Variable - Set direction[(Triggering player)][1] = false
                General - Else if (Conditions) then do (Actions)
                    Else If
                        And
                            Conditions
                                direction[(Triggering player)][3] == false
                                (Key Pressed) == W
                    Then
                        ------- UP
                        Unit - Make lightcycle[(Triggering player)] face 90.0 over 0.0 seconds
                        Variable - Set direction[(Triggering player)][1] = true
                        Variable - Set direction[(Triggering player)][4] = false
                        Variable - Set direction[(Triggering player)][3] = false
                        Variable - Set direction[(Triggering player)][2] = false
                General - Else if (Conditions) then do (Actions)
                    Else If
                        And
                            Conditions
                                direction[(Triggering player)][4] == false
                                (Key Pressed) == D
                    Then
                        ------- RIGHT
                        Unit - Make lightcycle[(Triggering player)] face 0.0 over 0.0 seconds
                        Variable - Set direction[(Triggering player)][2] = true
                        Variable - Set direction[(Triggering player)][3] = false
                        Variable - Set direction[(Triggering player)][1] = false
                        Variable - Set direction[(Triggering player)][4] = false
                General - Else if (Conditions) then do (Actions)
                    Else If
                        And
                            Conditions
                                direction[(Triggering player)][1] == false
                                (Key Pressed) == S
                    Then
                        ------- DOWN
                        Unit - Make lightcycle[(Triggering player)] face 270.0 over 0.0 seconds
                        Variable - Set direction[(Triggering player)][3] = true
                        Variable - Set direction[(Triggering player)][2] = false
                        Variable - Set direction[(Triggering player)][1] = false
                        Variable - Set direction[(Triggering player)][4] = false

The ----- stuff are comments so i remember what direction is what

I want it so that when you are moving left, you cant move right, and vice-versa
Same with up and down
And thats the part thats not working
The facing based on keys part works
Its like direction[][] is always false no matter what


I managed to work around this by splitting it up into 4 triggers, which i hate doing
It seems like its not evaluating the and properly, i may post about it on the sc2 forums if i can narrow the and problem down since it seems like a bug
But something like that would be a pretty big bug

Heres another trigger that should work but doesnt for some reason

Code:
    Events
        Unit - Any Unit Enters (Region(Any Region))
    Local Variables
    Conditions
    Actions
        Unit - Kill (Triggering unit)

The unit that enters the regions doesnt even die

Both of these triggers should work unless im missing something


Last edited by Pat1487 on Sat Apr 24, 2010 1:38 am; edited 5 times in total
Back to top Go down
nomorholywar
Sergeant
Sergeant



PostSubject: Re: Trigger not working but should   Sat Apr 24, 2010 1:12 am

ah nice you're making TRON
Back to top Go down
Pat1487
Moderator
Moderator
avatar


PostSubject: Re: Trigger not working but should   Sat Apr 24, 2010 1:24 am

Yeah, the beta is still limited to 4 players so it seems like a good idea for this map to be first
Back to top Go down
Serenity09
Moderator
Moderator
avatar


PostSubject: Re: Trigger not working but should   Sat Apr 24, 2010 1:31 am

Region Kill
Events
Unit - Any Unit Enters Level 1 Region Kill
Local Variables
Conditions
(Owner of (Triggering unit)) != 10
Actions
Unit - Create 1 Zergling for player (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing 270.0 degrees (Ignore Placement)
Unit - Kill (Last created unit)
Unit - Move (Triggering unit) instantly to Respawn (No Blend)
Camera - Pan the camera for player (Owner of (Triggering unit)) to (Position of (Triggering unit)) over 0.5 seconds with Existing Velocity% initial velocity, 10% deceleration, and Do Not use smart panning
Unit - Pause (Triggering unit)
General - Wait 0.1 Game Time seconds
Unit - Unpause (Triggering unit)

The mess at the bottom was because another function was being stubborn so I needed to keep the starting unit alive throughout the game
Back to top Go down
Pat1487
Moderator
Moderator
avatar


PostSubject: Re: Trigger not working but should   Sat Apr 24, 2010 1:37 am

Thanks seren

I was in the region functions looking for the region values
Im just stupid like that

That doesnt explain why any region doesnt work like in the trigger i posted
Back to top Go down
Serenity09
Moderator
Moderator
avatar


PostSubject: Re: Trigger not working but should   Sat Apr 24, 2010 2:24 am

Testing if skating is true. basically my somewhat cool idea is to test the units current speed vs its actual. on creep all zerg units move faster and this is the closest you can get to terrain <anything> without adding that property to some other behavior (creep is a behavior). And since the object editor blows a ridiculous amount atm, creep it is

Code:
Skating On/Off As Array
    Events
        Timer - Every 0.1 seconds of Game Time
    Local Variables
        i = 1 <Integer>
    Conditions
    Actions
        General - For each integer i from 1 to 9 with increment 1, do (Actions)
            Actions
        General - If (Conditions) then do (Actions) else do (Actions)
            If
                (Unit Array[i] Movement Speed (Current)) != (Unit Array[i] Movement Speed (Default))
            Then
                Variable - Set Skating True Array[i] = true
            Else
                Variable - Set Skating True Array[i] = false

Next is the general skate trigger

Code:

Skating As Array
    Events
        Timer - Every 0.05 seconds of Game Time
    Local Variables
        i = 1 <Integer>
    Conditions
    Actions
        General - For each integer i from 1 to 9 with increment 1, do (Actions)
            Actions
                General - If (Conditions) then do (Actions) else do (Actions)
                    If
                        Skating True Array[i] == true
                    Then
                        Variable - Set Temp Point = (Position of Unit Array[i])
                        Unit - Move Unit Array[i] instantly to (Temp Point offset by Slide Speed towards (Facing of Unit Array[i]) degrees) (No Blend)
                    Else

And finally the turning trigger
Code:

Control As Array
    Events
        Unit - Any Unit is issued an order to  Move
    Local Variables
    Conditions
        And
            Conditions
                Skating True Array[(Owner of (Triggering unit))] == true
                (Owner of (Triggering unit)) != 10
    Actions
        Unit - Order Unit Array[(Owner of (Triggering unit))] to ( Stop) (Replace Existing Orders)
        Unit - Make Unit Array[(Owner of (Triggering unit))] face (Target point for (Triggering order)) over 0.4 seconds

Code:

Add units to array
    Events
        Game - Map initialization
    Local Variables
        i = 1 <Integer>
    Conditions
    Actions
        General - For each integer i from 1 to 9 with increment 1, do (Actions)
            Actions
                Unit Group - Pick each unit in (Any units in (Entire map) owned by player (Player i from (Allies of player i)) matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
                    Actions
                        Variable - Set Unit Array[(Owner of (Picked unit))] = (Picked unit)


Last edited by Serenity09 on Sat Apr 24, 2010 3:23 am; edited 2 times in total (Reason for editing : changed first index to 1 and increasing the sizes of the arrays by 1 somehow got rid of the errors even though there were only 9 players/units, but the sliding aspect still doesn't work. ideas?)
Back to top Go down
Pat1487
Moderator
Moderator
avatar


PostSubject: Re: Trigger not working but should   Sat Apr 24, 2010 2:33 am

The local i in the on/off trigger should be set to 1
You dont need temp point anymore, sc2 cant leak

And very clever using creep like that
Back to top Go down
SuPa_Link
Recruit
Recruit



PostSubject: Re: Trigger not working but should   Sat Apr 24, 2010 11:48 pm

Starcraft 2 can leak. As of right now their garbage collection is useless in some ways. Most of the general stuff like that does not leak I'm pretty sure. You sure the beta is only limited to 4 players, I'm allowed to create up to 16 players.

The code seems right, you may need to init all the index's of the 2d array first, I doubt it but i would try it for the hell of it. It might just be a a bug in general with 2d arrays though. Also, you may want to consider using the custom script. A lot faster and easier to read lol. If I get time I can recreate it, and test it out.
Back to top Go down
nomorholywar
Sergeant
Sergeant



PostSubject: Re: Trigger not working but should   Sun Apr 25, 2010 4:53 am

ugh, double post ->


Last edited by nomorholywar on Sun Apr 25, 2010 6:58 am; edited 1 time in total
Back to top Go down
nomorholywar
Sergeant
Sergeant



PostSubject: Re: Trigger not working but should   Sun Apr 25, 2010 6:54 am

Pat, in case you havent messed around with the UI triggers yet, check out this map. Should give you some great ideas for points/team bars in your tron map:

http://static.sc2mapster.com/content/files/425/969/Gettin_payed.SC2Map



SuPa_Link wrote:
You sure the beta is only limited to 4 players, I'm allowed to create up to 16 players.
I'm sure when the new patch arrives, allowing you to upload your own maps, the 4-player restriction will be removed.



Serenity09 wrote:
but the sliding aspect still doesn't work. ideas?

serenity, I made a quick slide trigger this morning:

http://sc2.nibbits.com/maps/download/132252/

couldnt find any simple terrain checks so I just used creep, and the sliding works. hope it helps.

you'll have to go through more trouble to make it smooth, as 'face point' in this engine actually can take place in 0.00 seconds.






The editor is a real pain in the ass. For all the powerful changes added, they could have designed it better. Hardly an improvement over the wc editor, just more panels and subpanels. It's also irritating that every time you make a change in the data editor, it scrolls you back to the top of the value list. Psh
But! the fact that you can now define 4D arrays might make up for it afro
Back to top Go down
Serenity09
Moderator
Moderator
avatar


PostSubject: Re: Trigger not working but should   Sun Apr 25, 2010 11:45 am

Thanks nomor, I have something that I could revert to that worked sorta ok but between mine and yours it should work very well now Smile
since terrain is a texture and is basically spray paint I don't think there will be any terrain check type triggers, especially since you can put terrain on in coats. the closest I think you can get is using something like creep.

I really like the new regions and the arrays are amazing comparatively. For any non maze I think I'd like the terrain as well. Besides the record setting lazy abilities of the new triggers, not too much has changed there as far as gui goes. I'm waiting to see a functions list/let the editor get out of beta before switching to writing in C.
Back to top Go down
Pat1487
Moderator
Moderator
avatar


PostSubject: Re: Trigger not working but should   Sun Apr 25, 2010 1:26 pm

SuPa_Link wrote:
Starcraft 2 can leak. As of right now their garbage collection is useless in some ways. Most of the general stuff like that does not leak I'm pretty sure. You sure the beta is only limited to 4 players, I'm allowed to create up to 16 players.

If the garbage collecting was useless then stuff like that would leak
Ive done a bunch of stuff to make it leak and it isnt so it must be working

The editor lets you go to 16, right now the game only lets you have 4
Custom maps may not have that restriction in game though
And like nomor said they might patch it to allow for more

SuPa_Link wrote:
Also, you may want to consider using the custom script. A lot faster and easier to read lol. If I get time I can recreate it, and test it out.

When the editor is out of beta and when theres more documentation on all the stuff thats in it ill use custom script

nomorholywar wrote:
Pat, in case you havent messed around with the UI triggers yet, check out this map. Should give you some great ideas for points/team bars in your tron map:

http://static.sc2mapster.com/content/files/425/969/Gettin_payed.SC2Map

Thats a pretty cool map

I turned the UI off in mine to (i put in a way for the player to turn it on and off with U, but its off by default) and there doesnt look like theres a way to only show the minimap, or to move it
I was hoping there would be a way to show where people are in the map while they arent on screen, like a marker on your screen that tells you what direction other players are in, but so far i havent found a way to do that

I made a dialog that shows the scores when you press tab, i didnt even think to use something that was always on the screen


nomorholywar wrote:
The editor is a real pain in the ass. For all the powerful changes added, they could have designed it better. Hardly an improvement over the wc editor, just more panels and subpanels. It's also irritating that every time you make a change in the data editor, it scrolls you back to the top of the value list. Psh
But! the fact that you can now define 4D arrays might make up for it afro


Yeah the gui trigger editor takes things that should be simple and makes it harder or take more steps to accomplish, but overall i think its more flexible in what you can do, and it wont make a difference in custom script
The data editor is the same way, but alot more flexible, i think once we get used to it, it wont be so bad
Back to top Go down
cdkid
Recruit
Recruit
avatar


PostSubject: Re: Trigger not working but should   Sun Apr 25, 2010 9:38 pm

Code:

    Events
        Unit - Any Unit Enters a distance of 0.5 from (Closest unit to (Position of skaters[1]) in (Any units in (Entire map) owned by player 1 matching No Unit Filter, with at most Any Amount))
    Local Variables
        killdistance = 1.0 <Real>
        nearestPos = No Point <Point>
        curskater = No Unit <Unit>
        curnearest = No Unit <Unit>
        i = 0 <Integer>
    Conditions
    Actions
        General - For each integer i from 1 to 4 with increment 1, do (Actions)
            Actions
                Variable - Set curnearest = (Triggering unit)
                Variable - Set curskater = skaters[i]
                Variable - Set nearestPos = (Position of curnearest)
                General - If (Conditions) then do (Actions) else do (Actions)
                    If
                        (Distance between (Position of curskater) and nearestPos) <= killdistance
                    Then
                        Unit - Kill curskater
                    Else

(just using 1 for testing, i'll add the others later if this works)
Back to top Go down
Pat1487
Moderator
Moderator
avatar


PostSubject: Re: Trigger not working but should   Sun Apr 25, 2010 10:01 pm

Varibles are a bad idea in events, even when it lets you use them
I havent tried it with constants though

But with non-constant variables it glitches up easy
I change an event similar to this to not use a varible and it fixed several other problems i had

Heres how i did collision
Code:
    Events
        Unit - Any Unit Enters a distance of 3.0 from Hellion [120.00, 130.00]
    Local Variables
    Conditions
        (Unit type of (Triggering unit)) == Archon
    Actions
        Your actions here

Hellion [120.00, 130.00] is your slider unit for player 1 (you need a trigger for each player) in your case and unit type == archon is the unit you want to be the unit they have to touch in order to die, it could also be a condition like all units that belong to a certain player

This is an old school trigger for collision from wc3, and i still havent found a better way to do it in sc2 yet, im not sure if i will

I forgot to mention that you cant kill the unit in order for this to work
As far as i can tell theres no way to revive units yet, and once a non-hero dies you lose it forever (i guess they did it like that to try to prevent leaks)
You can make it appear to die
First Hide the triggering unit
Spawn the same unit on top of the triggering unit for the trigger player, facing the same facing as the triggering unit
Then kill the last created unit
Then move the triggering unit to a region that they cant get to

You can use Unit-[name of unit] enters region [name of the region that you move that unit to at "death"] as the event if you need the event for when they die (since you cant use the unit dies event)
Although a better way to do it is to use the unit-dies event with the condition that the triggering unit is of type [whatever unit you use for sliders]
Since that would get triggered when you kill the last created unit thats created when you want the slider to die

You dont have to worry about other units that your creating being killed instead, last created unit is limited to the current trigger only

All that to do something that the Unit-revive hero at region action would do
Back to top Go down
SuPa_Link
Recruit
Recruit



PostSubject: Re: Trigger not working but should   Sun Apr 25, 2010 10:46 pm

I could try to see if I can find something to revive units. I can't remember what action I was looking at, but I remember one of the arguments. It asked to pick all units in a group, then to pick alive dead or both.

So it does keep the dead units, I will take a look into it. Maybe there is something to revive a dead unit somewhere. Question

Also about garbage collection, what I was talking about was:

"There is an error which implies that this isn't supported. This is quite an important issue since if this isn't supported it renders garbage collection, records and pointers pretty much useless."

Source: http://sc2c.org/scripting/major-issues-with-galaxy-t8.html
Back to top Go down
Pat1487
Moderator
Moderator
avatar


PostSubject: Re: Trigger not working but should   Sun Apr 25, 2010 11:21 pm

Oh i see

They mustve improved the stuff that used to leak to not require garbage collection
I didnt try pointers or records, ill give it a shot and see what happens later

I dont think i saw anything in unit groups about reviving, i tried searching for alive and it didnt come back with anything, ill look again
Back to top Go down
SuPa_Link
Recruit
Recruit



PostSubject: Re: Trigger not working but should   Sun Apr 25, 2010 11:25 pm

No sorry I explained that wrong. I was saying that you can search for dead/alive/both units with unit groups. You can even exclude them in filters. So they are not removed when they are dead, otherwise why would you be able to filter them out?

So there must be some way to get them. I'll keep looking.
Back to top Go down
Pat1487
Moderator
Moderator
avatar


PostSubject: Re: Trigger not working but should   Sun Apr 25, 2010 11:30 pm

I think dead only pertains to heros
When a unit dies you lose it completely
Like in wc3 you could use dead non-hero units in events for triggers
In sc2 you cant
Back to top Go down
AmAzIn[G]
Commander
Commander
avatar


PostSubject: Re: Trigger not working but should   Sun May 23, 2010 8:19 pm

Pat1487 wrote:
I think dead only pertains to heros
When a unit dies you lose it completely
Like in wc3 you could use dead non-hero units in events for triggers
In sc2 you cant

I feel like this is a good thing
Back to top Go down
Sponsored content




PostSubject: Re: Trigger not working but should   

Back to top Go down
 
Trigger not working but should
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Razer Onza revival
» Working Table Equipments
» Does anyone know why the "Pupil" system isnt working
» Animal ID code not working?
» Chrono Trigger

Permissions in this forum:You cannot reply to topics in this forum
Clan TMMM :: Starcraft 2 :: SC2 Tutorials and Help-
Jump to: