Hello everyone,
I'm working on my first mod attempt... It's a mod about teamplay. Hmpf, sorry, I don't think it's the good place to tell about it. Some minutes ago, I've been to the #moddev channel to ask if I could add a line to a unit's fbi file to reimburse the player (For example, if I need one metal unit and one hundred energy units to build Juan, if Juan dies, I'm given metal unit and one hundred energy units.). KDR told me I could "Make Lua check if a unit died and give the player the resources for the unit". As I don't know how to code in Lua language, could someone of you (My saviour.) create it for me ? I allow myself to ask you it because KDR also said : "Should be really easy though".
Thank you !
Lua Script to automatically reimburse the cost of a unit ?
Moderator: Moderators
- LathanStanley
- Posts: 1429
- Joined: 20 Jun 2005, 05:16
LathanStanley said : "sounds more like a hack, that will just desync games terribly..."
H├â┬®h├â┬®... Actually, I read somewhere on the forum that "food" was not supported, i.e. there's no way to set a unit limitation. In the to-be-released Allianz Arena mod, you'll have to play with your teammates, you won't win by yourself, even if you're really great (Unlike in AA-based mods, where a single player can make the difference.). You'll have to choose if you want to play as a Striker or as a Defenser. Each team's goal will be to kill the opponent's Keeper (H├â┬®h├â┬®... You also find it sounds like football :) ?), who will be the only unit producing resources to build your army and will share it with his mates (As Keeper will be a quite boring job, I hope a bot will work to play it !). What I wouldn't like would be something like : the Defenser takes all the resources and leave nothing to the Striker. With all these resources, he builds several heavy units and blocks the opponent striker's way with them. But if I set for instance 100 energy units as a cost for a Oliver Calm unit and the players have no energy income, he won't be able to buy more than 10 Olli. But what would happen if a unit died ? To unblock the situation, I need something to reimburse these costs... Thank you, I hope your thing will work !
Edit : It works, thanks for all ! The problem is, as I didn't know how to set up a LuaRules folder, I copied the one from CA, and, now, I've got a lot of new options I don't want :) ! Nevermind, I'll find how to clean it all by myself, thank you !
H├â┬®h├â┬®... Actually, I read somewhere on the forum that "food" was not supported, i.e. there's no way to set a unit limitation. In the to-be-released Allianz Arena mod, you'll have to play with your teammates, you won't win by yourself, even if you're really great (Unlike in AA-based mods, where a single player can make the difference.). You'll have to choose if you want to play as a Striker or as a Defenser. Each team's goal will be to kill the opponent's Keeper (H├â┬®h├â┬®... You also find it sounds like football :) ?), who will be the only unit producing resources to build your army and will share it with his mates (As Keeper will be a quite boring job, I hope a bot will work to play it !). What I wouldn't like would be something like : the Defenser takes all the resources and leave nothing to the Striker. With all these resources, he builds several heavy units and blocks the opponent striker's way with them. But if I set for instance 100 energy units as a cost for a Oliver Calm unit and the players have no energy income, he won't be able to buy more than 10 Olli. But what would happen if a unit died ? To unblock the situation, I need something to reimburse these costs... Thank you, I hope your thing will work !
Edit : It works, thanks for all ! The problem is, as I didn't know how to set up a LuaRules folder, I copied the one from CA, and, now, I've got a lot of new options I don't want :) ! Nevermind, I'll find how to clean it all by myself, thank you !