Void Ray Beams

DonMushroom

Member
Reaction score
4
Hi again :)

I am looking to make the void ray beams player colored by setting the tint for the beam. I cant seem to find how to access the attack beams actor inside the the trigger editor.

So i want so know how to access the Void Ray Attack Beam actor from the trigger editor so i can set the beam color for each player by tint . :)
 

Dave312

Censored for your safe viewing
Reaction score
269
I would look at using a different method to set the beam tint as I don't think you can reference the beam from the trigger editor. I would use an Actor Event (Event: Events + property on the Void Ray Attack Beam actor) to set the colour depending on the players colour:
Code:
ActorCreation
   ValidatePlayer PlayerIsRed
   SetTintColor 255,0,0

The only problem with this method is creating the validator to check the colour of the player as this validator type does not exist. Fortunately I do have a workaround. You need to start by creating a new Upgrade for every colour a player can be (the upgrade doesn't need to do anything). Then using the Trigger Editor, create a trigger which gives each player the corresponding upgrade for their colour (so for example, if a player is coloured Red, research the PlayerIsRed upgrade for them). Now you can create a validator which checks if a player has the colour upgrade (ie which colour the player is) and use that event posted above.

If you need some more help getting this to work, let me know and I'll post a test map.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
I recently tried to do something similar in Cruiser Command. I have a mining beam, which is just an effect - target ability that creates a beam to the target. I also have an ability that accelerates the mining(it just applies a behavior). When I activate that ability, I wanted the beam to turn red for the duration of the behavior.

This is far from a simple thing to do, and I spent several hours messing around with it (as well as finally asking on sc2mapster) to get it to work.

For your purposes, Dave's way might be simpler, however if you get it to work my way, you wont have to create one upgrade and one validator for each player.

I assume you already know what an actor is. You don't need to have a great understanding of them, just a basic one. Actors exist in actor scopes, which is just a bunch of actors together. I think actors can exist in several scopes at once, but don't quote me on it.

When the void ray attacks, the beam is created. It is(or at least should be) created in the same scope as the void ray.

You can use aliases to refer to actors in a scope. An example of an alias is "_Unit". If you send an actor message to the "_Unit" in a scope, it will send it to the unit actor in that scope. This works because all unit actors have the "_Unit" alias in the Actor: Aliases + field.

So how do you send an actor message to an alias in a scope? In the trigger editor, you can use the "Send Actor Message Via Name" action. Set the name parameter to the alias and the actor to the void ray's actor(you can get the void ray's actor with the Actor from unit action). The thing is, I'm pretty sure you don't even need an alias. You could just write the ID of the beam(VoidRayAttackBeam).

With the data editor, you'll have to go into an existing actor. Say for example that I want to tint the beam when the void ray has a behavior(let's assume the behavior's name is "Quad Damage"). I'd go into the void ray's actor and add a message like this:

Code:
Behavior.Quad Damage.On
   SetTintColor 255,0,0

Now the special part here that isn't visible in what I just wrote, is the target. If you select the action(that's the "SetTintColor 255,0,0" part), you'll see it has the msg type and a lot of parameters. It also has the target field at the top of the window. This is where you specify the alias or name. I think you can just write the ID and it would work as well.

Now there's one part that you have to do, even if you do it with the trigger editor. In the beam actor, you have to open the Hosting: Host Impact + and Hosting: Host Impact + fields and change the scope from "Implicit" to "Scope caster". This is to make sure it is created in the correct scope so you can refer to it.

It occurs to me as I'm writing this, that even though is great for you to know, it wont help you. You would have to tint it through triggers every time it attacks since that's when a new beam is created. You will probably have to do it Dave's way.
 

DonMushroom

Member
Reaction score
4
I have been tinkering and i cant get my head around it all :p Could i have that test map please Dave :)
 

Dave312

Censored for your safe viewing
Reaction score
269
Test map attached.

I have only included 3 colours: Red, Blue and Green. I've also added a couple of Debug functions so you can change your player colour during the game. Type the following commands into the chat window:
"-Red" : Changes the player colour to Red
"-Blue" : Changes the player colour to Blue
"-Green" : Changes the player colour to Green
"-u" : Shows the current upgrade levels for the player
 

Attachments

  • PlayerColourBeam.SC2Map
    24.4 KB · Views: 203
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