Load transperancy value

X.Terror.X

New Member
Reaction score
10
is it posible to load/get the value of a unit currents transerpancy?

so if transperancy = 10% i want to do this
change unit vertix colouring ---> [transperancy] = artemic == [get transperancy + 10%
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, you could simply use the JASS native for it... It doesn't use %, but actuall values so it's easier to maintain ;)

It looks like this:
[ljass]native SetUnitVertexColor takes unit whichUnit, integer red, integer green, integer blue, integer alpha returns nothing[/ljass]

So, you could do this with a custom script:
Trigger:
  • Vertex Coloring
    • Events
      • Unit - A unit enters Region 1 <gen>
    • Conditions
    • Actions
      • Custom script: call SetUnitVertexColor(GetTriggerUnit(), 255,255,255,0)
      • Wait 5.00 seconds
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Wait 0.10 seconds
          • Custom script: call SetUnitVertexColor(GetTriggerUnit(), 255, 255, 255, 10 * bj_forLoopAIndex)
 

X.Terror.X

New Member
Reaction score
10
i know thats basicly the same like GUI but u use loop
but icanot use loop since that will glitch with other units

its just 1 trigger based that reduces 10% trans and then removes but if u use loop it gets removed to early and it doesnt look realistic
thats why i want to load the value and not use loop
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, don't know if this is either what you're looking for, or if it even works but...

Trigger:
  • Vertex Coloring
    • Events
      • Unit - A unit enters Region 1 <gen>
    • Conditions
    • Actions
      • Unit Group - Add (Triggering unit) to TempGroup
      • Unit - Set the custom value of (Triggering unit) to 100


Trigger:
  • Vertex Color Timer
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • 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
              • (Custom value of (Picked unit)) Greater than or equal to 95
            • Then - Actions
              • Custom script: call SetUnitVertexColor( GetEnumUnit(), 255, 255, 255, GetUnitUserData(GetEnumUnit()) -5)
              • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) - 5)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Less than 95
            • Then - Actions
              • Custom script: call SetUnitVertexColor( GetEnumUnit(), 255, 255, 255, GetUnitUserData(GetEnumUnit()) + 5)
              • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 5)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Greater than 100
            • Then - Actions
              • Custom script: call SetUnitVertexColor( GetEnumUnit(), 255, 255, 255, 100)
              • Unit - Set the custom value of (Picked unit) to 0
              • Unit Group - Remove (Picked unit) from TempGroup
            • Else - Actions
 

X.Terror.X

New Member
Reaction score
10
ok i in putted the custom value but didnt worked yet
i show you my trigger


Code:
NSD
    Events
        Unit - A unit enters Region 095 <gen>
    Conditions
        (Unit-type of (Triggering unit)) Equal to Necro
    Actions
        Unit - Order (Triggering unit) to Stop
        Wait 0.50 seconds
        Set NecroAngleShoot = 1
        Unit - Order (Triggering unit) to Neutral Pandaren Brewmaster - Breath Of Fire ((Position of (Triggering unit)) offset by 1000.00 towards (90.00 x (Real(NecroAngleShoot))) degrees)
        Wait 0.50 seconds
        Unit - Set the custom value of (Triggering unit) to 100
        Unit Group - Add (Triggering unit) to UnitFade

Code:
Remover
    Events
        Time - Every 0.20 seconds of game time
    Conditions
        (Number of units in UnitFade) Not equal to 0
    Actions
        Unit Group - Pick every unit in UnitFade and do (Actions)
            Loop - Actions
                Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) - 10)
                Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with (Real((Custom value of (Picked unit))))% transparency
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Custom value of (Picked unit)) Equal to 0
                    Then - Actions
                        Wait 1.00 seconds
                        Unit - Remove (Picked unit) from the game
                    Else - Actions
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Ok, wait... My trigger wasn't working :(

Here's the working one:
Trigger:
  • Vertex Color Timer
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: (String((Custom value of (Picked unit))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Greater than 50
              • (Custom value of (Picked unit)) Less than or equal to 100
            • Then - Actions
              • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) - 5)
              • Custom script: call SetUnitVertexColor( GetEnumUnit(), 255, 255, 255, R2I(GetUnitUserData(GetEnumUnit()) * 2.55))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Equal to 50
            • Then - Actions
              • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 5)
              • Custom script: call SetUnitVertexColor( GetEnumUnit(), 255, 255, 255, R2I(GetUnitUserData(GetEnumUnit()) * 2.55))
              • Unit Group - Add (Picked unit) to TempGroup2
              • Unit Group - Remove (Picked unit) from TempGroup
            • Else - Actions
      • Unit Group - Pick every unit in TempGroup2 and do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: (String((Custom value of (Picked unit))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Greater than or equal to 50
              • (Custom value of (Picked unit)) Less than or equal to 100
            • Then - Actions
              • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 5)
              • Custom script: call SetUnitVertexColor( GetEnumUnit(), 255, 255, 255, R2I(GetUnitUserData(GetEnumUnit()) * 2.55))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Greater than 100
            • Then - Actions
              • Custom script: call SetUnitVertexColor( GetEnumUnit(), 255, 255, 255, 255)
              • Unit - Set the custom value of (Picked unit) to 0
              • Unit Group - Remove (Picked unit) from TempGroup2
            • Else - Actions


Btw, is nothing happening with your trigger there ? :S
 

X.Terror.X

New Member
Reaction score
10
alredy answered that its not working no

its because i made the custom value in a other trigger?
ive made the basic custom value in the first trigger mabye that whould be the problem


[nsd works but in the second trigger the custo mvalue proberly doesnt work]
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Yes, custom values can be used in other triggers...
They're attached to the units, not the triggers so can be used anywhere ;)

Or, do you mean you have another trigger which sets the custom value again ? :S
 

X.Terror.X

New Member
Reaction score
10
no only the trigger that i am showing

They're attached to the units, not the triggers so can be used anywhere
and they are attached to the units but i dont think it works with pick every unit in group because it only takes the info for only for 1 unit at least it reacts like that
i made a game text of the custom value
i see every 0.2 seconds seeing the numbers going -10 and it doesnt stop while it should show the value of each unit i hope u understand me


excample for 2 units
u see now 90 80 70
but if u got for excample 2 units it it is like this, every 0.2 second u will see
90 90 80 80 70 70


each color is for a unit excample what unit gives
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Yeah, but you mean that it only shows as if there were only 1 unit ? :S

So you mean that it's like, non-MUI ? :S

Well, my trigger isn't :p (non-MUI , I mean XD)
Why not use it ? :eek:
 

Komaqtion

You can change this now in User CP.
Reaction score
469
My trigger works as such that it'll decrease a units custom value (If they're in a specific unit-group) until it comes to a specific value (In my example, it's 50% transparency), then it starts to make it visible again, until it gets to 100%...

But what is it exactly you want to do with your trigger there ? :S
 

X.Terror.X

New Member
Reaction score
10
picking every unit in unit group and for every unit u change the custom value at least that whould be the point with ,pick every unit in unit group,

but instead it only does it for one[i think] while u got multiple units sprawning somethimes per half a second


Edit* the fade is just for changing transperancy from 100 to 0 when its 0 it removes the unit just a naturaly fade
[idea] if the trans realy doesnt work i make it windwalk perhaps for fading time
but i whould liek to know if this is posible learning things is often more importand then making a map on the hardest way if u understand what i mean
 

X.Terror.X

New Member
Reaction score
10
ok i fixed it the problems were i did transperancy from 100 to 0 while i should be from 0 to 100

and the get picked unit while waiting 1 second didnt worked out so the unit wasnt removed

thanks anyway i know hwo to use custom value it helped alot :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • 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

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top