I'm wondering how I can issue an order to a specific unit based on an ability another unit has used, except I want it to work universally for many abilities without having to list them all in an if then else-if series.
For example, one method I have been trying to get to work is:
Event: Unit X is issued order
Action: Order unit Y to [CombineStrings]: "Ability command of triggering order" + "1."
Basically I would have two abilities, Stomp, and Stomp1. When Unit X uses Stomp, it will command Unit Y to use Stomp1. I would have many abilities like this: Fart and Fart1, Slash and Slash1, etc. So this trigger would work for a variety of abilities that have a corresponding ability that another unit is commanded to use. Anyone have an idea how I could do this without creating a massive If then else-if trigger?
Looking through the Galaxy editor triggers, it seems like this should be possible, but for some reason, sometimes it only lets me convert a unit name to strings, but I can't figure out the right combination.
An order is a separate data type, which includes another data type called Ability Command. Ability commands finally hold the Id of the ability.
So what you might want to do, would be to get the issued order, get that order's ability command, get that ability command's ability id, modify this id to your liking, and create a new ability command and order from this new id.
I don't know how to do custom script, but I keep getting errors when I copied even just the first line. I would prefer to do it with the GUI, but it seems there is no way to convert an Ability Command ID to a string with GUI.
Could I use a Catalog somehow? I think I would just run into the same problem.
I don't know how to do custom script, but I keep getting errors when I copied even just the first line. I would prefer to do it with the GUI, but it seems there is no way to convert an Ability Command ID to a string with GUI.
The line is not complete, just an indicator, how to use it in galaxy.
Indeed, the function to convert ability commands seems to be not available in Gui, while the data type Ability Command in general is.
Quote:
Could I use a Catalog somehow? I think I would just run into the same problem.
I don't think, Catalog functions would be helpful here.
You could try to create a custom function, which translates the galaxy expression into a function useable in Gui. Wait a second, I will provide the needed code for it.
€ ah, nevermind. You actually can use the function, but not directly. Create a variable of type Ability Command, you can set it to the function Ability Command, where you can select an ability and a command index.
No idea, why you need to do this, but it works.
Okay I feel I'm close. I saw the Ability Command function earlier, but I don't understand what the index is. How do I set the index to the second ability that I want to fire through the trigger action in relation to the specific Ability Command used in the Event?
I want to have a single small trigger for all the abilities I want affected for this trigger without having to create a massive If Then Else-If trigger.
Thanks a lot for your help by the way. You've helped me before. Really appreciate it!
Edit: I think I might just do the long If Then Else-If trigger... there does not seem to be any other way as good, and I don't think it will actually turn out that bad.
The index for the ability command represents the specific command of the ability, which should be used. Most ability only use index 0 to execute (and maybe 1 for cancel), but some abilities, like the build or train abilities support multiple indexes. For example the Train (Barracks) ability would use index 0 to train a marine, index 1 for a marauder, index 2 for a reaper etc.
So you most likely will only need the 0 index. Alternatively, you can also get the index from the triggering ability command and pass it to the new ability command.
Quote:
How do I set the index to the second ability that I want to fire through the trigger action in relation to the specific Ability Command used in the Event?
Not sure, what you mean here, could you re-phrase that?
Quote:
I want to have a single small trigger for all the abilities I want affected for this trigger without having to create a massive If Then Else-If trigger.
This should still be possible for the trigger you describet in the first post.
The indexes are set in the Ability: Commands+ section of the ability data editor right? It does not seem like those are alterable for the Effect-Instant and Effect-Target type abilities I'm using. I think though even when using the index, I would be limited to that same ability when I try to get the unit to use the second ability, so I would basically almost have the same problem, not being able to get the second ability by manipulating the ability ID string.
Three more questions:
1. Can this code you posted earlier: " string id=AbilityCommandGetAbility(OrderGetAbilityCommand(EventUnitOrder())); " be used to to save an Ability Command Event's ID into the string? If so, I won't need to do the If Then Else-If
2. Data question: Can you make it so an ability does not make the unit stop in place? Like, make it so an ability does not interrupt a previous move or attack order?
3. In the SC Universe game, the makers were able to make it so that a green target box appears on a unit and only shows for the individual player who has clicked the target. I've been trying to figure out how to do that for a while now (creating an actor on a unit that only one player could see). I thought it was done with Transmissions since that is where you see the green box in the WoL campaign, but I haven't been able to get it to work yet. Do you know what this is?
I'm wondering how I can issue an order to a specific unit based on an ability another unit has used, except I want it to work universally for many abilities without having to list them all in an if then else-if series.
For example, one method I have been trying to get to work is: Event: Unit X is issued order Action: Order unit Y to [CombineStrings]: "Ability command of triggering order" + "1."
Basically I would have two abilities, Stomp, and Stomp1. When Unit X uses Stomp, it will command Unit Y to use Stomp1. I would have many abilities like this: Fart and Fart1, Slash and Slash1, etc. So this trigger would work for a variety of abilities that have a corresponding ability that another unit is commanded to use. Anyone have an idea how I could do this without creating a massive If then else-if trigger?
Looking through the Galaxy editor triggers, it seems like this should be possible, but for some reason, sometimes it only lets me convert a unit name to strings, but I can't figure out the right combination.
An order is a separate data type, which includes another data type called Ability Command. Ability commands finally hold the Id of the ability.
So what you might want to do, would be to get the issued order, get that order's ability command, get that ability command's ability id, modify this id to your liking, and create a new ability command and order from this new id.
Or, in galaxy terms:
@Kueken531: Go
I don't know how to do custom script, but I keep getting errors when I copied even just the first line. I would prefer to do it with the GUI, but it seems there is no way to convert an Ability Command ID to a string with GUI.
Could I use a Catalog somehow? I think I would just run into the same problem.
The line is not complete, just an indicator, how to use it in galaxy.
Indeed, the function to convert ability commands seems to be not available in Gui, while the data type Ability Command in general is.
I don't think, Catalog functions would be helpful here.
You could try to create a custom function, which translates the galaxy expression into a function useable in Gui. Wait a second, I will provide the needed code for it.
€ ah, nevermind. You actually can use the function, but not directly. Create a variable of type Ability Command, you can set it to the function Ability Command, where you can select an ability and a command index.
No idea, why you need to do this, but it works.
@Kueken531: Go
Okay I feel I'm close. I saw the Ability Command function earlier, but I don't understand what the index is. How do I set the index to the second ability that I want to fire through the trigger action in relation to the specific Ability Command used in the Event?
I want to have a single small trigger for all the abilities I want affected for this trigger without having to create a massive If Then Else-If trigger.
Thanks a lot for your help by the way. You've helped me before. Really appreciate it!
Edit: I think I might just do the long If Then Else-If trigger... there does not seem to be any other way as good, and I don't think it will actually turn out that bad.
The index for the ability command represents the specific command of the ability, which should be used. Most ability only use index 0 to execute (and maybe 1 for cancel), but some abilities, like the build or train abilities support multiple indexes. For example the Train (Barracks) ability would use index 0 to train a marine, index 1 for a marauder, index 2 for a reaper etc.
So you most likely will only need the 0 index. Alternatively, you can also get the index from the triggering ability command and pass it to the new ability command.
Not sure, what you mean here, could you re-phrase that?
This should still be possible for the trigger you describet in the first post.
@Kueken531: Go
The indexes are set in the Ability: Commands+ section of the ability data editor right? It does not seem like those are alterable for the Effect-Instant and Effect-Target type abilities I'm using. I think though even when using the index, I would be limited to that same ability when I try to get the unit to use the second ability, so I would basically almost have the same problem, not being able to get the second ability by manipulating the ability ID string.
Three more questions:
1. Can this code you posted earlier: " string id=AbilityCommandGetAbility(OrderGetAbilityCommand(EventUnitOrder())); " be used to to save an Ability Command Event's ID into the string? If so, I won't need to do the If Then Else-If
2. Data question: Can you make it so an ability does not make the unit stop in place? Like, make it so an ability does not interrupt a previous move or attack order?
3. In the SC Universe game, the makers were able to make it so that a green target box appears on a unit and only shows for the individual player who has clicked the target. I've been trying to figure out how to do that for a while now (creating an actor on a unit that only one player could see). I thought it was done with Transmissions since that is where you see the green box in the WoL campaign, but I haven't been able to get it to work yet. Do you know what this is?