Help with Unit Enters Trigger

Knocksious

Sweet, I got 2 little green bars!
Reaction score
46
I can see the Playergroup leak, but the problem is that it doesn't give gold/lumber

Code:
Human Javelineer
    Events
        Unit - A unit enters Human Javelineer <gen>
    Conditions
    Actions
        Custom script:   local location Target
        Set Target = (Center of Starting Upgrade Center Enter <gen>)
        Unit - Remove (Entering unit) from the game
        Unit - Create 1 Javlineer (human) for (Owner of (Entering unit)) at Target facing Default building facing degrees
        Selection - Select (Last created unit) for (Owner of (Entering unit))
        Camera - Pan camera for (Owner of (Entering unit)) to Target over 0.00 seconds
        Custom script:   call RemoveLocation (Target)
        Game - Display to (All players matching ((Owner of (Entering unit)) Equal to (Matching player))) the text: You have selected t...
        Game - Display to (All players matching ((Owner of (Entering unit)) Equal to (Matching player))) the text: |cffff0000 --------...
        Player - Set (Owner of (Entering unit)) Current lumber to 5
        Player - Set (Owner of (Entering unit)) Current gold to 200


fixed it, had to move the Call Removelocation to the end
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> had to move the Call Removelocation to the end

What for? It destroyed a variable that was never used.


> Custom script: local location Target

Remove that line.

Pseudo-locals are evil incarnate anyway...

> Custom script: call RemoveLocation (Target)

Should say:
Custom script: call RemoveLocation( udg_Target )
 

Knocksious

Sweet, I got 2 little green bars!
Reaction score
46
I got it working by moving the remove thing to the end

>Pseudo-locals are evil incarnate anyway...

:eek: Uh-oh, why do you say that?

My whole project so far has been using them, and it's been fine
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Custom script: local location Target

This creates a local variable called "Target".

> Set Target = (Center of Starting Upgrade Center Enter <gen>)

This uses the global variable "Target".
In JASS, its name is "udg_Target".

The local you declared is never used...

Which is why removing that local is such a problem... the variable is not initialized to anything useful.
 

Knocksious

Sweet, I got 2 little green bars!
Reaction score
46
:banghead: :banghead: :banghead:

well I guess that means I need to do some reprogrammin

how do you set a local using customscript then
or should I just change all of the "local location Target" to "local location udg_Target"
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
well...once you had made a variable using the variable editor..there is no need to set a local variable...

Local variable is used when you are writting jass...Importing local to GUI trigger would be a hard time...

So you can remove all custom script that you use to local a variable...

>>how do you set a local using customscript
In GUI...most ...or all of the functions are using Global variable...which can be make by adding unit variable in the variable editor...

When we set local using customscript...the next action we probebly will use custom script too...since Actions in GUI trigger doesnt support locals

< Correct me if i am wrong :p >
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> change all of the "local location Target" to "local location udg_Target"

With this particular trigger, yes, that would do it.

Then again, this trigger has no MUI problems... you may just as well use your global.



> All players matching ((Owner of (Entering unit)) Equal to (Matching player))

"Player group (Owner of (Entering unit))", from "Convert player to player group".


Yes, post #6 is both confused and confusing.
 

Knocksious

Sweet, I got 2 little green bars!
Reaction score
46
gah, but I am using "Target" for almost any point, and this whole time I thought that it was working and MUI

Now I gotta go back and set up 80 million arrays :banghead:
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
For a single point, you certainly don't need an array. Much less that many...

The trigger in post #1 for example works just as good with a simple global.
No waiting, no problem.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
All you need to do here is change

Code:
Custom Script: local location Target

To

Code:
Custom Script: local location udg_Target

Then all of your GUI actions should work fine when you use the variable from the variable editor.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Then all of your GUI actions should work fine

Except those inside "pick every"s.
Or conditions.
And there's features if you use more than one of the same type.

Pseudo-locals are basically bugs waiting to happen.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
> Except those inside "pick every"s.
Or conditions.

Oh, yeah. Forgot about those tricky ones that create a new function. :p

Conditions can be done in the form of an "If", though.
Perhaps even a custom script If.
Custom script could also be used for loops.
Though, at this point, why bother?
 

Knocksious

Sweet, I got 2 little green bars!
Reaction score
46
I would need to bother, just because "target" is the point variable used in everything, because I assumed I was making it local.

That means all of the triggered spells and basically all other actions

There are no "waits" in spells so will they still all be MUI? or do I need to make it Target[PlayerNumber(TriggeringPlayer)]

I dunno, it just seems to me that using a single point variable for all sorts of complicated actions, is a bug waiting to happen

FURTHERMORE, since I didn't know that I have quite a few point leaks
 

Knocksious

Sweet, I got 2 little green bars!
Reaction score
46
ok, for those Pseudo-Locals, will this trigger work as expected?

I've already realized the fact that I need to change a lot of triggers with loops and stuff, but I was just wondering if this type will work

Code:
Genre Set Magic
    Events
        Unit - A unit enters Magic <gen>
    Conditions
    Actions
        Custom script:   local location udg_Local
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Race[(Player number of (Owner of (Entering unit)))] Equal to Human
            Then - Actions
                Set Local = (Center of HM <gen>)
                Set Class[(Player number of (Triggering player))] = 2
                Unit - Move (Triggering unit) instantly to Local
                Camera - Pan camera for (Owner of (Triggering unit)) to Local over 0.00 seconds
                Game - Display to (All players matching ((Owner of (Entering unit)) Equal to (Matching player))) the text: You have Selected t...
                Custom script:   call RemoveLocation (udg_Local)
            Else - Actions
                Do nothing
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Test it? Ctrl+f9 ...
And yes, seems so.
But, you do not need the local custom script line there. Its just....annoying to read, see etc. Its just another useless line, in a trigger that would work without it. Why? Because of 0-wait-functions...
And another suggestion, in your first trigger. You are "remove - entering unit from game" then later you try to "set gold to player owner of entering unit". Well, wc3 is gently with you here, since, if you got no wait functions, it is ok. But remember, try have the "remove entering unit at the end". It will make more sense, logical...etc..:)
And not only, if you look at your upper trigger you use "Set gold..." not add... so... Dno if its supposed to be like that, but, just pointed it out! :)

And to the admins, mods etc... This site works like shit with the browser named OPERA... Any reason? :) I dont need to know why but just to inform you...Or it might be just "my opera". Oh, and what doesnt work properly? the buttons # etc.. the hotkeys for [code ] and [colo r] etc... [ quote ]....these doesnt work properly... :)
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
It looks like it will work ok.
Just don't try to use the point in the condition, since GUI creates a separate function for each condition.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top