So I duplicated a marine's stimpack and changed its values and named it as Hero Stimpack, and this is available to a hero marine without researching it. Now when I attack a computer's hero marine, it attacks my units without doing its stimpack. From where and how can I manipulate a computer's melee AI script so that it uses Hero Stimpack like a normal marine's stimpack? Thanks for any help.
Well, the hero stimpack belongs to a custom unit called Hero Marine, so I can use it too if I have my own Hero Marine. If I set it as an autocast ability, will the computer know when to use it and not spam it to death?
i doubt you can validate if the owner is ai or user. you need a trigger and an second ability (a copy of the stim but with validators, using the same effects/behaviors, don't duplicate them again)
-add a coldown to the ability at least as long as the behavior
-add 3 validators to the stim CanCharge(unnamed), Caster Life GT50 Percent (to prevent it from stimdeath, can be lower) and a created custom attack range test validator:
add them in both validator fields, even if only one is necessary. it is a bit strange sometimes, which validator set is used
edit: use a trigger to disable the autocast whenever the creator of the marine is an user
x( So what was your validator type when you created the custom validator? I'm not getting the same fields as you have in your image. :( And can you tell me exactly what cooldowns I need to change? :S
Okay, now onto the trigger... What do I need for Event and conditions and actions? Sorry I am a complete noob. :(
Edit: By the way, the hero marine is created by a trigger. if a player's race is terran, then it creates a hero marine at the player's starting location.
Hey I finally managed to work out the computer hero marine's autocast hero stimpack. But I am having a trouble with disabling the auto cast stimpack completely for human players. I tried what you said in your previous post, but it didn't work. :( If my race is Terran and I get a hero marine, it can autocast its stimpack which is not what I want to do. Here's my entire trigger code:
Sigh. I think I need to make a whole new hero marine that is for human players and has no autocast hero stimpack. When I use my own hero marine and disable the stimpack by right clicking on it, the stimpack doesn't even work. :( Anyways, thanks for the help.
Update: Yay I got everything working so far! Now I have to work on hero stalker (with blink ability) and hero hydralisk (with burrow). Q_Q
this is wrong ;) it should be disable ability and not turn autocast off and you don'T have to add a button in the command card for the autocast stim, just add a button for the non auto stim and disable the autostim ability (not turn off)
Edit: Here's my code so far; I think I figured it out... Wait... WHERE ARE THE HEROES? :( Also, there's an error saying that the Execution took too long when I start a game. :(
Edit: Okay, I fixed the execution error taking too long, but now I'm always getting terran and without hero marine. :(
MeleeInitializationEventsGame-MapinitializationLocalVariablesSL=1<Integer>k=NoPoint<Point[6]>
i = 1 <Integer>
j = 2 <Integer>
Conditions
Actions
Variable - Set k[1] = Start Location 001
Variable - Set k[2] = Start Location 002
Variable - Set k[3] = Start Location 003
Variable - Set k[4] = Start Location 004
Variable - Set k[5] = Start Location 005
Variable - Set k[6] = Start Location 006
Game - Set the game speed to Faster
Melee - Set default melee options for all players
Melee - Set melee starting resources for all players
Melee - Create melee starting units for all players
Melee - Start the melee AI for all computer players
General - While (Conditions) are true, do (Actions)
Conditions
j <= 6
Actions
Player - Set player j difficulty level to Insane
General - Wait 0.1 Game Time seconds
Variable - Modify j: + 1
General - While (Conditions) are true, do (Actions)
Conditions
And
Conditions
i <= 6
SL <= 6
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Race of player i) == Protoss
Then
Unit - Create 1 Hero Stalker for player i at k[SL] facing (Start location of player i) (No Options)
Else
General - Else if (Conditions) then do (Actions)
Else If
(Race of player i) == Terran
Then
General - If (Conditions) then do (Actions) else do (Actions)
If
(Controller of player i) == Computer
Then
Unit - Create 1 Cyborg Marine for player i at k[SL] facing (Start location of player i) (No Options)
Else
Unit - Create 1 Superhero Marine for player i at k[SL] facing (Start location of player i) (No Options)
General - Else if (Conditions) then do (Actions)
Else If
(Race of player i) == Zerg
Then
Unit - Create 1 Hunter Killer for player i at k[SL] facing (Start location of player i) (No Options)
Variable - Modify i: + 1
Variable - Modify SL: + 1
General - Wait 0.1 Game Time seconds
remove the wait and put the modify j inside the the while loop. this loop loops forever
stop using SL and i, why do you do this. they've always the same value
you did the else if wrong, you create one else if action and then press add action 3 times inside the else if. this way you get logic and not this mess you have :D
So I duplicated a marine's stimpack and changed its values and named it as Hero Stimpack, and this is available to a hero marine without researching it. Now when I attack a computer's hero marine, it attacks my units without doing its stimpack. From where and how can I manipulate a computer's melee AI script so that it uses Hero Stimpack like a normal marine's stimpack? Thanks for any help.
does only the computer have this stimpack and is it always a computer?
make it an autocast ability
@b0ne123: Go
Well, the hero stimpack belongs to a custom unit called Hero Marine, so I can use it too if I have my own Hero Marine. If I set it as an autocast ability, will the computer know when to use it and not spam it to death?
you can teach him with validators how to use it :)
@b0ne123: Go
Um so there are Auto Cast Validators and Smart Validators for the stimpack, and there are lots of values... what do I do? :S
Edit: And if I get Terran and a hero marine at the start of a game, the validators for the stimpack won't work since I am not an AI, right?
i doubt you can validate if the owner is ai or user. you need a trigger and an second ability (a copy of the stim but with validators, using the same effects/behaviors, don't duplicate them again)
smart stim validation is a bit of a challenge :)
your second autocast stim:
-add a coldown to the ability at least as long as the behavior
-add 3 validators to the stim CanCharge(unnamed), Caster Life GT50 Percent (to prevent it from stimdeath, can be lower) and a created custom attack range test validator:
add them in both validator fields, even if only one is necessary. it is a bit strange sometimes, which validator set is used
edit: use a trigger to disable the autocast whenever the creator of the marine is an user
@b0ne123: Go
x( So what was your validator type when you created the custom validator? I'm not getting the same fields as you have in your image. :( And can you tell me exactly what cooldowns I need to change? :S
here you go
@b0ne123: Go
Okay, now onto the trigger... What do I need for Event and conditions and actions? Sorry I am a complete noob. :(
Edit: By the way, the hero marine is created by a trigger. if a player's race is terran, then it creates a hero marine at the player's starting location.
then add a simple if then after the marine creation
if owner of unit last created unit != computer
then disable auto stim of unit last created unit
@b0ne123: Go
Hey I finally managed to work out the computer hero marine's autocast hero stimpack. But I am having a trouble with disabling the auto cast stimpack completely for human players. I tried what you said in your previous post, but it didn't work. :( If my race is Terran and I get a hero marine, it can autocast its stimpack which is not what I want to do. Here's my entire trigger code:
@b0ne123: Go
Sigh. I think I need to make a whole new hero marine that is for human players and has no autocast hero stimpack. When I use my own hero marine and disable the stimpack by right clicking on it, the stimpack doesn't even work. :( Anyways, thanks for the help.
Update: Yay I got everything working so far! Now I have to work on hero stalker (with blink ability) and hero hydralisk (with burrow). Q_Q
this is wrong ;) it should be disable ability and not turn autocast off and you don'T have to add a button in the command card for the autocast stim, just add a button for the non auto stim and disable the autostim ability (not turn off)
@b0ne123: Go
Bah it's too late to change it now. :/ I actually remade another marine from scratch with no autocast stim. Anyways, thanks for the help. :)
do yourself a favor and put the actions you do 6 times into a while loop ;)
@b0ne123: Go
Okay, I will clean my trigger code using while loop so it looks more nice. :D Again, thanks for being a good mentor. :)
Edit: How do I assign a variable for the start locations 001 through 006 so that they also go through a while loop? :S Help!
a point array should work
@b0ne123: Go
Yeah I found it a while ago. I'm working on it...
Edit: Here's my code so far; I think I figured it out... Wait... WHERE ARE THE HEROES? :( Also, there's an error saying that the Execution took too long when I start a game. :(
Edit: Okay, I fixed the execution error taking too long, but now I'm always getting terran and without hero marine. :(
remove the wait and put the modify j inside the the while loop. this loop loops forever
stop using SL and i, why do you do this. they've always the same value
you did the else if wrong, you create one else if action and then press add action 3 times inside the else if. this way you get logic and not this mess you have :D
should look like this: