I'm trying to make a melee map that, in addition to the normal units, also has heroes that level up with attributes. If i have melee initialization enabled, my heroes don't gain xp, and while having it disabled allows them to gain xp, start locations no longer work. I think I need to make it so that melee initialization doesn't disable xp, but I have no idea how to do that. Do you know how to get this to work.
When you say Start Locations aren't working, do you have some set up and do you have another trigger that contains the Set Starting Units For All Players? If not it makes sense that Start Locations aren't working when you delete melee Initialization because then you're deleting the action which creates the starting structures at the Start Locations.
Look into the Melee Initialization trigger. The issue is you're deleting the whole thing.
Just delete Melee - Set default melee options for all players
You will start to gain experience and your start locations will work.
The only problem with this is you will have to set your own win and lose conditions for a player to actually win or lose. They're not hard to make so it shouldn't be too much of a burden.
How can I make a gas pallet to an energy pallet? I don't now where can I find the answer and also how can I change shooting rate like one shoot not auto fire the weapon?
I believe you already asked this question on teamliquid and recieved the correct answer, tho it seems your new and didn't quite understand. Firstly it would all be done in data not triggers. You can duplicate something like the health iteam, change the model to the what you like (energy like), then changes the effect it has and amount from players resource to unit energy. Your second question you'll have to clarify what exactly your looking to do.
Usually any units (Ghost, Marine...etc) will automatically fire the weapon to attack close enemies, I wandering it's possible to not fire the weapon automatically and how to do so.
This one is math oriented. I feel restricted with the drag-and-drop type of deal in the Trigger editor, if you know programming this is what I'm trying to achieve:
Where $amount_of_players = 1-4 (so if you get it, it's the average of four variables). The $value<number> variables start at 0, and only an active player can add a (real) value to it. One player may add 0.9 (real) to $value3, the average would be 0.9 ( 0+0+0.9+0 / 1). It'll work the same way with more players. In case you're wondering about the context, it's a vote at the start of a map that determines the health of enemy creep (a tower defense map), where I will simply set the health * $average_value.
I've tried numerous ways of implementing it, but the main things I'm distracted by, is that Arithmetic Multiple (real) ends up looking like this at the start:
Set $average_value = (/ <- that sign there confuses me.
I've noticed using custom script a lot of times it prefers a dumbing down of the script. Couldn't you just do something like:
Global Variable:
real gv_choices[5]; (will be 4 in GUI, is just so you can use 1-4 for players 1-4)
Real gf_Average()//Called after all have voted
{
real lv_average = 0.0;
int lv_playercount = 0;
int lv_i = 1;
while(lv_i < 5)
{
if(PlayerStatus(lv_i) == c_playerStatusActive)
{
lv_average += gv_choices[lv_i];
lv_playercount += 1;
}
lv_i += 1;
}
lv_average /= lv_playercount;
return lv_average;
}
Isn't a whole to it, knowing everyone has voted will be the trickiest part I think. From there you can use some global health multiplication variable, lets say gv_health, and just say gv_health = gf_Average();
If the += and /= are confusing, it simply means this:
int lv_A = 8;
lv_A += 2; //Take 8, add 2 to it, assign the new value of 10 to lv_A
lv_A /= 2; // Take 8, divide it by 2, assign the new value of 5 to lv_A
Let me know if that is confusing, I can try to go over parts of it in more detail.
Thank you for the reply. var +=, var /=, etc aren't confusing (veteran in PHP), it's just how the SC2 trigger editor phrased it that was utterly confusing. Note it wasn't "var += ..." but "var = (+ ..." that confused me, especially when I started adding more brackets in the main ones, and all starting with a sign.
I get the logic from your script, I solved it by using a bad practice (that usually solves problems!). I wanted to add and divide in the same equation, which I do fluently in PHP. This lead to my issues (because of the bad phrasing in the editor). I simply added local variables, and did the calculations one at a time, until I got the real I was looking for. It was a surprisingly simple approach.
I published the game, went into the lobby and went AFK for about 10 minutes. In that time 3 people had joined the lobby, the map launched, and I was sitting at the vote screen when I got back. Watching the replay the other three players had voted 0.9, 0.9, and 1.0. I voted 0.8. I calculate the average to 0.9 ( (health of unit to be spawned * 0.9) = 90% health), but the game calculated it to 62%. The strange part is that the values are between 0.8 and 1.2, I don't understand how it went all the way down to 0.62. I guess I simply have to bugtest the map thoroughly. Do Computers count into the player group?
They might actually, I would be sure to ONLY look for players 1-4 to simplify matters. 62 % is an odd one, 3.6 is for your voting for sure, but 3.6 + 2 0s / 6 would be .6, not .62. I suppose they might play, considering they can leave games in coop vs AI or whatever. My apologies for overexplaining, just wasn't sure what experience level you had. I would defiitely aim at dumbing down your approach a little when you are working with this game, it appreciates it. It wants silly things like braces for every function/if/while statement you use... I'm pretty sure this is to safeguard those not experienced with code from doing anything too stupid. Still that .62 bothers me, I think I'd need more information to be of more use, as that number from what you are telling me shouldn't be possible.
Hey, could use a little more details from you about how to help you there. I do have one idea on how you could eliminate this issue though. Like lets say you got players 1-4 on team one and players 5-8 on team two, do something like this:
Event: Any unit dies/is killed
if(killingplayer < 5 && triggeringplayer > 4)
{ (add score to leaderboard for killing)
}
else if(killingplayer > 4 && triggeringplayer < 5)
{
(add score to leaderboard for killing)
}
Yes, it is pseudo code, but the logic should work. 2 different if statements not connected would work too, just be a little less efficient.
If I had the will, I'd try different combinations to see what was needed to arrive at the .62. Worth noting though, 4 players have 4 AI ingame (helps with triggers, or bad map layout causing issues otherwise, take your pick). This would exclude the player 0, if it's counted or not. My experience level of RTS mapping is... well, about ten hours. Maybe twelve. Spend hundreds of hours doing Counter Strike maps though, and thousands doing web programming.
I have a new question. Run Trigger vs Send Generic Event. I noticed if I use Run Trigger, it works as I'd expect. But for some reason I used Send Generic Event when I expanded on my triggers, and noticed it also worked as I'd expect. Both runs a specified trigger. But now that I'm typing the question, I realize the difference is that Send Generic Event can be "caught" by multiple triggers listening to the same phrase?
The trigger is set to run on a specific units property change "Player Battle Units[]." These units are set before this trigger is ever run, and it works just fine except for 1 situation.
I have an ability that spawns an Egg. If anyone attacks this egg this trigger will go haywire and run continously, as this egg has a life-regeneration.
What makes it a headache for me is that i do NOT set this egg ANYWHERE as ANY of the "Player Battle Units[]" arrays. I cannot for the life of me understand why this damned egg is triggering this trigger...
Apparently the egg is somehow getting added to the Battle Units array, otherwise this shouldn't be triggering at all. Would take a good look at how a unit gets added to your array, that is where your answer will most likely lie.
When killing an allied unit the score on my leaderboard increases. Best
way to stop this?
Not sure how to do it Via scoreboard editing. However my preferance
would be making Allied and Self units untargetable.
event
any unit dies
actions
if
killing player != owner of triggering unit
killing player has owner of triggering unit set as enemy = true
then
add a + kill to player score
else
dont count kill
@Projekton: Go
i read somewhere that since one of the patches (1.3 maybe?) heroes don't gain xp unless you have melee initialization disabled
When you say Start Locations aren't working, do you have some set up and do you have another trigger that contains the Set Starting Units For All Players? If not it makes sense that Start Locations aren't working when you delete melee Initialization because then you're deleting the action which creates the starting structures at the Start Locations.
@Spoolofwhool: Go
yes, but when i have melee initialization enabled the heroes i have don't gain xp, even though i think its set up right cause they do with it disabled
@morgoth780:
Okay. I'm going test it pretty soon here so just give me a minute.
@morgoth780:
Look into the Melee Initialization trigger. The issue is you're deleting the whole thing.
Just delete Melee - Set default melee options for all players
You will start to gain experience and your start locations will work.
The only problem with this is you will have to set your own win and lose conditions for a player to actually win or lose. They're not hard to make so it shouldn't be too much of a burden.
@Projekton: Go
ok, thanks for the help!
How can I make a gas pallet to an energy pallet? I don't now where can I find the answer and also how can I change shooting rate like one shoot not auto fire the weapon?
@jamison0136: Go
I believe you already asked this question on teamliquid and recieved the correct answer, tho it seems your new and didn't quite understand. Firstly it would all be done in data not triggers. You can duplicate something like the health iteam, change the model to the what you like (energy like), then changes the effect it has and amount from players resource to unit energy. Your second question you'll have to clarify what exactly your looking to do.
@hobbidude: Go
Usually any units (Ghost, Marine...etc) will automatically fire the weapon to attack close enemies, I wandering it's possible to not fire the weapon automatically and how to do so.
Thanks for your remind I will try it. =)
@Projekton: Go
This one is math oriented. I feel restricted with the drag-and-drop type of deal in the Trigger editor, if you know programming this is what I'm trying to achieve:
$average_value = (($value1 + $value2 + $value3 + $value4) / $amount_of_players);
Where $amount_of_players = 1-4 (so if you get it, it's the average of four variables). The $value<number> variables start at 0, and only an active player can add a (real) value to it. One player may add 0.9 (real) to $value3, the average would be 0.9 ( 0+0+0.9+0 / 1). It'll work the same way with more players. In case you're wondering about the context, it's a vote at the start of a map that determines the health of enemy creep (a tower defense map), where I will simply set the health * $average_value.
I've tried numerous ways of implementing it, but the main things I'm distracted by, is that Arithmetic Multiple (real) ends up looking like this at the start:
Set $average_value = (/ <- that sign there confuses me.
Should it be like this:
$average_value = (/ ($amount_of_players, $value1, $value2, $value3, $value4))
or like this:
$average_value = (+ ($value1, $value2, $value3, $value4, ($variable / $amount_of_players)))
Where $variable is... something that has to be there, don't know what. I just can't formulate it the way I want it.
I'm utterly confused. Hopefully this didn't end up too long a post.
@Raphaei: Go
I've noticed using custom script a lot of times it prefers a dumbing down of the script. Couldn't you just do something like:
Isn't a whole to it, knowing everyone has voted will be the trickiest part I think. From there you can use some global health multiplication variable, lets say gv_health, and just say gv_health = gf_Average();
If the += and /= are confusing, it simply means this:
Let me know if that is confusing, I can try to go over parts of it in more detail.
When killing an allied unit the score on my leaderboard increases. Best way to stop this?
Not sure how to do it Via scoreboard editing. However my preferance would be making Allied and Self units untargetable.
@Deadzergling: Go
Thank you for the reply. var +=, var /=, etc aren't confusing (veteran in PHP), it's just how the SC2 trigger editor phrased it that was utterly confusing. Note it wasn't "var += ..." but "var = (+ ..." that confused me, especially when I started adding more brackets in the main ones, and all starting with a sign.
I get the logic from your script, I solved it by using a bad practice (that usually solves problems!). I wanted to add and divide in the same equation, which I do fluently in PHP. This lead to my issues (because of the bad phrasing in the editor). I simply added local variables, and did the calculations one at a time, until I got the real I was looking for. It was a surprisingly simple approach.
I published the game, went into the lobby and went AFK for about 10 minutes. In that time 3 people had joined the lobby, the map launched, and I was sitting at the vote screen when I got back. Watching the replay the other three players had voted 0.9, 0.9, and 1.0. I voted 0.8. I calculate the average to 0.9 ( (health of unit to be spawned * 0.9) = 90% health), but the game calculated it to 62%. The strange part is that the values are between 0.8 and 1.2, I don't understand how it went all the way down to 0.62. I guess I simply have to bugtest the map thoroughly. Do Computers count into the player group?
@Raphaei: Go
They might actually, I would be sure to ONLY look for players 1-4 to simplify matters. 62 % is an odd one, 3.6 is for your voting for sure, but 3.6 + 2 0s / 6 would be .6, not .62. I suppose they might play, considering they can leave games in coop vs AI or whatever. My apologies for overexplaining, just wasn't sure what experience level you had. I would defiitely aim at dumbing down your approach a little when you are working with this game, it appreciates it. It wants silly things like braces for every function/if/while statement you use... I'm pretty sure this is to safeguard those not experienced with code from doing anything too stupid. Still that .62 bothers me, I think I'd need more information to be of more use, as that number from what you are telling me shouldn't be possible.
@PreTenD: Go
Hey, could use a little more details from you about how to help you there. I do have one idea on how you could eliminate this issue though. Like lets say you got players 1-4 on team one and players 5-8 on team two, do something like this:
Event: Any unit dies/is killed
if(killingplayer < 5 && triggeringplayer > 4)
{
(add score to leaderboard for killing)
}
else if(killingplayer > 4 && triggeringplayer < 5)
{
(add score to leaderboard for killing)
}
Yes, it is pseudo code, but the logic should work. 2 different if statements not connected would work too, just be a little less efficient.
@Deadzergling: Go
If I had the will, I'd try different combinations to see what was needed to arrive at the .62. Worth noting though, 4 players have 4 AI ingame (helps with triggers, or bad map layout causing issues otherwise, take your pick). This would exclude the player 0, if it's counted or not. My experience level of RTS mapping is... well, about ten hours. Maybe twelve. Spend hundreds of hours doing Counter Strike maps though, and thousands doing web programming.
I have a new question. Run Trigger vs Send Generic Event. I noticed if I use Run Trigger, it works as I'd expect. But for some reason I used Send Generic Event when I expanded on my triggers, and noticed it also worked as I'd expect. Both runs a specified trigger. But now that I'm typing the question, I realize the difference is that Send Generic Event can be "caught" by multiple triggers listening to the same phrase?
Hi there!
I was hoping someone could shed some light on an issue i am experiencing with this trigger:
The trigger is set to run on a specific units property change "Player Battle Units[]." These units are set before this trigger is ever run, and it works just fine except for 1 situation.
I have an ability that spawns an Egg. If anyone attacks this egg this trigger will go haywire and run continously, as this egg has a life-regeneration.
What makes it a headache for me is that i do NOT set this egg ANYWHERE as ANY of the "Player Battle Units[]" arrays. I cannot for the life of me understand why this damned egg is triggering this trigger...
Any help would be appreciated.
@Matheusx: Go
Apparently the egg is somehow getting added to the Battle Units array, otherwise this shouldn't be triggering at all. Would take a good look at how a unit gets added to your array, that is where your answer will most likely lie.
Thank you sir. :)
<Great, solved it myself...>