shiremct
8th Oct 06, 3:21 AM
In making a buildable bazooka team, I've run into a little problem. My bazooka team are given their bazookas through a global slot_item upgrade, but i don't want the player to have to research the upgrade, i want it to automatically start researched. Within the actions, there is a remove upgrade function, but nothing to add one, however, there is a call scar function, so it should be possible to give the player the upgrade through scar (which is just a scripting language, correct?), yes? I don't have any experience with scar or any of relic's other exclusive structures for that matter, so could perhaps someone direct me to a location with scar functions and descriptions? Thanks in advance.
This would be very helpful, as using upgrades to tweak and add to the game is likely something i will be using alot. Sometimes the same functionality can be achieved through other means (like on_constructed actions,etc) but using upgrades is a great way to keep things consistent. And actually, i have a question regarding my upgrade; as I am not all that familiar with .lua editing, I'm not sure if part of my code is actually valid or not, and its not exactly something that is easy to see.
GameData = Inherit([[]])
GameData["upgrade_bag"] = Reference([[bags\upgrade_bag.lua]])
GameData["upgrade_bag"]["actions"]["action_01"] = Reference([[action\upgrade_action\filter_action.lua]])
GameData["upgrade_bag"]["actions"]["action_01"]["action_table"]["upgrade_actions"]["action_01"] = Reference([[action\upgrade_action\slot_item_add.lua]])
GameData["upgrade_bag"]["actions"]["action_01"]["action_table"]["upgrade_actions"]["action_01"]["slot_item"] = [[slot_item\allies_m9bazooka.lua]]
GameData["upgrade_bag"]["actions"]["action_01"]["action_table"]["upgrade_actions"]["action_02"] = Reference([[action\upgrade_action\slot_item_add.lua]])
GameData["upgrade_bag"]["actions"]["action_01"]["action_table"]["upgrade_actions"]["action_02"]["slot_item"] = [[slot_item\allies_m9bazooka.lua]]
GameData["upgrade_bag"]["actions"]["action_01"]["apply_to_future_units"] = true
GameData["upgrade_bag"]["actions"]["action_01"]["squad_type"] = [[sbps\races\allies\soldiers\ranger_team.lua]]
GameData["upgrade_bag"]["actions"]["action_02"] = Reference([[action\ability_action\filter_action.lua]])
GameData["upgrade_bag"]["actions"]["action_02"]["action_table"]["ability_actions"]["action_01"] = Reference([[action\ability_action\apply_modifiers_action.lua]])
GameData["upgrade_bag"]["actions"]["action_02"]["action_table"]["ability_actions"]["action_01"]["modifiers"]["modifier_01"] = Reference([[modifiers\accuracy_weapon_modifier.lua]])
GameData["upgrade_bag"]["actions"]["action_02"]["action_table"]["ability_actions"]["action_01"]["modifiers"]["modifier_01"]["value"] = 1.20
GameData["upgrade_bag"]["actions"]["action_02"]["action_table"]["ability_actions"]["action_01"]["modifiers"]["modifier_02"] = Reference([[modifiers\damage_weapon_modifier.lua]])
GameData["upgrade_bag"]["actions"]["action_02"]["action_table"]["ability_actions"]["action_01"]["modifiers"]["modifier_02"]["value"]= 1.20
GameData["upgrade_bag"]["actions"]["action_02"]["apply_to_future_units"] = true
GameData["upgrade_bag"]["actions"]["action_02"]["entity_type"] = [[ebps\races\allies\soldiers\bazooka_team_gunner.lua]]
GameData["upgrade_bag"]["global_max_limit"] = 1
GameData["upgrade_bag"]["local_max_limit"] = 1
GameData["upgrade_bag"]["owner_type"] = [[player]]
This is the code, which i frankenstiened from a few abilities and veterency info. I know that action_01 works fine as I have used it many times and as you can see, my boys are packing :)
http://www.freeimagehosting.net/%5D%5Bimg%5Dhttp://img2.freeimagehosting.net/uploads/93ffa5226f.jpg
(If pic doesnt show up = (http://img2.freeimagehosting.net/image.php?93ffa5226f.jpg))
However, I'm not sure about action_02. I think it [i]should work, but I find it hard to tell. I was hoping someone familiar with .lua editing could tell me yes, these are valid commands, but if not, i have a few ideas in mind to test it out, i just didnt want to mess with it if I didnt have too. I could tweak the code to replace the entity's weapon... that would be obvious, but that still doesnt gaurentee that I can alter accuracy and damage on the entity by entity basis, but it seems that I should be able to do so... If someone knows for sure one way or the other, please let me know.
The idea with the code in action_02 is that, honestly, bazookas are not an effective means of anti-tank support as they stand currently, not even against light armor like the puma, however, by tweaking the accuracy of the bazooka team gunners and not the bazooka, it makes it a better idea to leave the bazookas in the trained bazooka team, rather than picking them up with riflemen. If the code works as intended, it would be pretty easy to tack on a requirement that the bazooka slot_item must be equipped to recieve the bonuses.
Using methods like this, you could add a lot of depth and tactical/strategic value to the game with complex relationships, but have it all take place under the surface, where the player could ignore it if they chose and it not really penalize them but at the same time, a player who pays closer attention to what his troops equip and how he uses them would see extra benifits.
Speaking of slot_items, just a FYI for those who may not know it, but slot_items applied through upgrades, and possibly through pickups (not sure, but easily tested) are distributed in the order of the squad's loadout. Say you have a squad with 3 engineers and 4 Riflemen, but you want the engineers to equip the heavy weapons... you would add the engineers to the first entry on the squad loadout and the rifles in the second. Yes, it may be easier to simply place the engineer's heavy weapon as such&such in their ebps/.../hardpoint_01 but that is many times a much worse implementation then adding a slot_item to the squad. In most of the mods that people have released recently, I see their weapon changes largely being implemented by hardcoding it into their hardpoint table. I'm not trying to disrespect the modders or their work, I'm just trying to point out there is a better way. :) (Of coures, excellent work on all the mods you guys are releasing! I am having fun playing around with them and seeing what and how you all changed various things.)
I'm thinking there was something else I intended to include...but, well, no need to write a friggen book!
I'll be back if I forgot something :bigwave:
This would be very helpful, as using upgrades to tweak and add to the game is likely something i will be using alot. Sometimes the same functionality can be achieved through other means (like on_constructed actions,etc) but using upgrades is a great way to keep things consistent. And actually, i have a question regarding my upgrade; as I am not all that familiar with .lua editing, I'm not sure if part of my code is actually valid or not, and its not exactly something that is easy to see.
GameData = Inherit([[]])
GameData["upgrade_bag"] = Reference([[bags\upgrade_bag.lua]])
GameData["upgrade_bag"]["actions"]["action_01"] = Reference([[action\upgrade_action\filter_action.lua]])
GameData["upgrade_bag"]["actions"]["action_01"]["action_table"]["upgrade_actions"]["action_01"] = Reference([[action\upgrade_action\slot_item_add.lua]])
GameData["upgrade_bag"]["actions"]["action_01"]["action_table"]["upgrade_actions"]["action_01"]["slot_item"] = [[slot_item\allies_m9bazooka.lua]]
GameData["upgrade_bag"]["actions"]["action_01"]["action_table"]["upgrade_actions"]["action_02"] = Reference([[action\upgrade_action\slot_item_add.lua]])
GameData["upgrade_bag"]["actions"]["action_01"]["action_table"]["upgrade_actions"]["action_02"]["slot_item"] = [[slot_item\allies_m9bazooka.lua]]
GameData["upgrade_bag"]["actions"]["action_01"]["apply_to_future_units"] = true
GameData["upgrade_bag"]["actions"]["action_01"]["squad_type"] = [[sbps\races\allies\soldiers\ranger_team.lua]]
GameData["upgrade_bag"]["actions"]["action_02"] = Reference([[action\ability_action\filter_action.lua]])
GameData["upgrade_bag"]["actions"]["action_02"]["action_table"]["ability_actions"]["action_01"] = Reference([[action\ability_action\apply_modifiers_action.lua]])
GameData["upgrade_bag"]["actions"]["action_02"]["action_table"]["ability_actions"]["action_01"]["modifiers"]["modifier_01"] = Reference([[modifiers\accuracy_weapon_modifier.lua]])
GameData["upgrade_bag"]["actions"]["action_02"]["action_table"]["ability_actions"]["action_01"]["modifiers"]["modifier_01"]["value"] = 1.20
GameData["upgrade_bag"]["actions"]["action_02"]["action_table"]["ability_actions"]["action_01"]["modifiers"]["modifier_02"] = Reference([[modifiers\damage_weapon_modifier.lua]])
GameData["upgrade_bag"]["actions"]["action_02"]["action_table"]["ability_actions"]["action_01"]["modifiers"]["modifier_02"]["value"]= 1.20
GameData["upgrade_bag"]["actions"]["action_02"]["apply_to_future_units"] = true
GameData["upgrade_bag"]["actions"]["action_02"]["entity_type"] = [[ebps\races\allies\soldiers\bazooka_team_gunner.lua]]
GameData["upgrade_bag"]["global_max_limit"] = 1
GameData["upgrade_bag"]["local_max_limit"] = 1
GameData["upgrade_bag"]["owner_type"] = [[player]]
This is the code, which i frankenstiened from a few abilities and veterency info. I know that action_01 works fine as I have used it many times and as you can see, my boys are packing :)
http://www.freeimagehosting.net/%5D%5Bimg%5Dhttp://img2.freeimagehosting.net/uploads/93ffa5226f.jpg
(If pic doesnt show up = (http://img2.freeimagehosting.net/image.php?93ffa5226f.jpg))
However, I'm not sure about action_02. I think it [i]should work, but I find it hard to tell. I was hoping someone familiar with .lua editing could tell me yes, these are valid commands, but if not, i have a few ideas in mind to test it out, i just didnt want to mess with it if I didnt have too. I could tweak the code to replace the entity's weapon... that would be obvious, but that still doesnt gaurentee that I can alter accuracy and damage on the entity by entity basis, but it seems that I should be able to do so... If someone knows for sure one way or the other, please let me know.
The idea with the code in action_02 is that, honestly, bazookas are not an effective means of anti-tank support as they stand currently, not even against light armor like the puma, however, by tweaking the accuracy of the bazooka team gunners and not the bazooka, it makes it a better idea to leave the bazookas in the trained bazooka team, rather than picking them up with riflemen. If the code works as intended, it would be pretty easy to tack on a requirement that the bazooka slot_item must be equipped to recieve the bonuses.
Using methods like this, you could add a lot of depth and tactical/strategic value to the game with complex relationships, but have it all take place under the surface, where the player could ignore it if they chose and it not really penalize them but at the same time, a player who pays closer attention to what his troops equip and how he uses them would see extra benifits.
Speaking of slot_items, just a FYI for those who may not know it, but slot_items applied through upgrades, and possibly through pickups (not sure, but easily tested) are distributed in the order of the squad's loadout. Say you have a squad with 3 engineers and 4 Riflemen, but you want the engineers to equip the heavy weapons... you would add the engineers to the first entry on the squad loadout and the rifles in the second. Yes, it may be easier to simply place the engineer's heavy weapon as such&such in their ebps/.../hardpoint_01 but that is many times a much worse implementation then adding a slot_item to the squad. In most of the mods that people have released recently, I see their weapon changes largely being implemented by hardcoding it into their hardpoint table. I'm not trying to disrespect the modders or their work, I'm just trying to point out there is a better way. :) (Of coures, excellent work on all the mods you guys are releasing! I am having fun playing around with them and seeing what and how you all changed various things.)
I'm thinking there was something else I intended to include...but, well, no need to write a friggen book!
I'll be back if I forgot something :bigwave: