Preserver Glow

DonMushroom

Member
Reaction score
4
Hi again :)

I was wondering if it is possible to change the color of the preserver glow from blue ti player colored :)
 

Dave312

Censored for your safe viewing
Reaction score
269
That 'glow' is built into the model. You would need to edit the model/model skin and change it that way.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293

DonMushroom

Member
Reaction score
4
That is exactly what i need but the file just seems to be a load of random text and there is no instructions of what to do. :(

Am i missing something?
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
It is a test map file. It should have the .SC2Map extension. Try opening it in the editor.

There are several things to do to get this to work.

1. Export all the textures from the import editor and import them back into your own map.
2. Go back into the test map, open up the data editor and go to the "Edit Art and Sound Data>Textures"
3. Set the data source to "Preserver_TeamColor.SC2Map"(so you only see modified objects)
4. Copy all of custom textures over to your map.
5. Go to the PreserverA model and copy the ":Texture Declarations + field to your own map's PreserverA model. (If you select the field, press ctrl + c, change to your map and select the field again and press ctrl + v, you'll copy it)
6. When you create your Preservers, use the "Send Actor Message To Unit" action to send the "Texture Select by Id" message with the parameter "TeamColor_PlayerX"(where X is the player you created the preserver for. Send the actor message to the newly created preserver.
7. (Optional - if you want to remove a lot of the glow) Do the same thing as 6) but with the "NoGlow" parameter instead of "TeamColor_PlayerX"
8. Do the same thing as 6) but with the "Preserver_TeamColor" parameter.
9. (Optional - if you want more glow) Do the same thing as 6) but send the message "Set Tint Color". In the color parameter, set HDR multiplier to 2.

What you're actually doing is changing the texture of the unit. This is a rather complicated process that is explained in more detail here.
 

DonMushroom

Member
Reaction score
4
Ok so now i have loads of different colored preservers :)

I need to find a way to set the glow color at the start of the game to be the same as the players. Does anyone have any idea about how i should go about this? :)
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
Ok so now i have loads of different colored preservers :)

I need to find a way to set the glow color at the start of the game to be the same as the players. Does anyone have any idea about how i should go about this? :)


6. When you create your Preservers, use the "Send Actor Message To Unit" action to send the "Texture Select by Id" message with the parameter "TeamColor_PlayerX"(where X is the player you created the preserver for. Send the actor message to the newly created preserver.
7. (Optional - if you want to remove a lot of the glow) Do the same thing as 6) but with the "NoGlow" parameter instead of "TeamColor_PlayerX"
8. Do the same thing as 6) but with the "Preserver_TeamColor" parameter.
9. (Optional - if you want more glow) Do the same thing as 6) but send the message "Set Tint Color". In the color parameter, set HDR multiplier to 2.


Basically, you just do what I just quoted but for all the preservers. Here's a trigger that should do that. It would be easier to do it with custom script(there is an example custom script in the map), but for GUI, I would create a - Game Link - Texture variable array where you store all the different "TeamColor_PlayerX" textures. So the texture at index 1 is "TeamColor_Player1".

Trigger:
  • Create Preservers
    • Events
      • Game - Map initialization
    • Local Variables
    • Conditions
    • Actions
      • Player Group - Pick each player in (Active Players) and do (Actions)
        • Actions
          • Unit - Create 1 Preserver (A) for player (Picked player) at Point using default facing (No Options)
          • Actor - Send actor message (TextureSelectById team_textures[(Picked Player)]) to main actor of unit (Last created unit)
          • Actor - Send actor message (TextureSelectById No Glow) to main actor of unit (Last created unit)
          • Actor - Send actor message (TextureSelectById Preserver_TeamColor) to main actor of unit (Last created unit)
          • Actor - Send actor message "SetTintColor {255,255,255 2.000000}" to main actor of unit (Last created unit)
 

DonMushroom

Member
Reaction score
4
I think im in over my head. This is my first map and the preserver thin is pretty much all its needs to be complete :(

I cant get my head around the process your teaching me as this is the first time i have tried anything like this. I dont see why there has to be so may preservers made with so many colors.

My map runs like a normal melee game really. Can someone write me a custom script so if the player chooses to be Protoss there preservers are the same color as the player.

Sorry about this. :(

(Preserver is the starting unit on my map if your protoss)
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
Okay, I'll do a more detailed explanation.

First of all, you need a global variable of the type "- Game Link" and the Link type "Texture. Make it an array and set the size to something that fits all your players, like 12. I called my variable "PreserverTexture". First of all, you have to save all textures in that variable when the game starts. If you already have a trigger that runs when the map starts, you can add it to that one, otherwise you'll have to do a new one.

Trigger:
  • Initialize textures
    • Events
      • Game - Map initialization
    • Local Variables
    • Conditions
    • Actions
      • Variable - Set PreserverTexture[1] = TeamColor_Player1
      • Variable - Set PreserverTexture[2] = TeamColor_Player2
      • Variable - Set PreserverTexture[3] = TeamColor_Player3
      • Variable - Set PreserverTexture[4] = TeamColor_Player4


Next up, you need a trigger to color the preservers when they enter the map.

Trigger:
  • Preserver Texture Change
    • Events
      • Unit - Any Unit Enters (Entire map)
    • Local Variables
    • Conditions
      • (Unit type of (Triggering unit)) == Preserver (A)
    • Actions
      • Actor - Send actor message (TextureSelectById PreserverTexture[(Triggering player)]) to main actor of unit (Triggering unit) ****
      • Actor - Send actor message (TextureSelectById No Glow) to main actor of unit (Triggering unit)
      • Actor - Send actor message (TextureSelectById Preserver_TeamColor) to main actor of unit (Triggering unit)
      • Actor - Send actor message "SetTintColor {255,255,255 2.000000}" to main actor of unit (Triggering unit)


**** Note that to send that message, when you select the message, switch from value to function and find "Texture Select By ID". You should then get a Texture parameter below it that you can set to your variable.
 

Kyuft

Member
Reaction score
11
If the glow is a texture, couldn't he have just edited the texture and made the blue, white, and colored white to alpha?

-Kyuft:shades:
 

DonMushroom

Member
Reaction score
4
Ok so all the triggers work :D Thanks you. How would i go about editing them so they are the color the player chooses instead of having a color preset for each player number?) :)
 

Kyuft

Member
Reaction score
11
Most likely, you will use a lot of If player color is...'s in the triggers, but it could work. However, I still believe you could change the texture so it does that automatically.

-Kyuft:shades:
 

Kyuft

Member
Reaction score
11
I am almost positive that there is a "Player color =" field that you caan input under an 'If' statement. You could do something like:
Trigger:
  • If
    • Player Color = Red
    • Then
      • Set preservercolor preserverred


-Kyuft:shades:
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
If the glow is a texture, couldn't he have just edited the texture and made the blue, white, and colored white to alpha?

-Kyuft:shades:
I'm not sure I'm following what you're saying. If you made the preserver have a transparent glow, he wouldn't have any color at all. As far as I know, there is no hidden team color underneath the glow. Kueken531 already modified the textures however to give them a player colored glow.

Ok so all the triggers work :D Thanks you. How would i go about editing them so they are the color the player chooses instead of having a color preset for each player number?) :)

It depends on how you want the player to choose their color. Basically have an integer array that saves the color a person wants. So a player gets to choose between colors 1-12. The number of the color he chooses is saved in the array at his index(at index 1 for player, index 2 for player 2).

You can then use the exact same triggers, you just have to change "(Triggering Player)" in the first action to YourIntegerArray[(Triggering Player)]. So it's "Actor - Send actor message (TextureSelectById PreserverTexture[YourIntegerArray[(Triggering player)]]) to main actor of unit (Triggering unit)"
 

Kyuft

Member
Reaction score
11
I'm not sure I'm following what you're saying. If you made the preserver have a transparent glow, he wouldn't have any color at all. As far as I know, there is no hidden team color underneath the glow. Kueken531 already modified the textures however to give them a player colored glow.

If you make set the glow to alpha (transparent) then the editor automatically fills that in with team color. If you look at the textures of units, they have transparent areas where their team color goes.

-Kyuft:shades:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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