Results 1 to 39 of 39

Coding Q&A with (some) new lua functions [updated 7/12]

  1. #1
    Member darkelf's Avatar
    Join Date
    Feb 2005
    Location
    A Temple of Khaine, Norway

    Coding Q&A with (some) new lua functions [updated 7/12]

    Going by past experience, I've decided to start a question and answers thread for the CoH modding section as well.

    Everything will be the same as the old one, I will answer any questions I can and update this post with new functions as time passes.

    Here are a few new ones I've found (with a couple of older ones as well).
    Code:
    -- Here is a compilation of different lua functions used in CoH dug out for people at the Relicnews forum
    -- Each entry will contain a small description of what it does and everything will be sorted by what type of file they will be in (ability, ebps etc)
    ---------------------------- Ability ---------------------------
    
    -- Sets actions for use when ability is activated (end_self_actions, end_target_actions and start_self_actions may replace start_target_actions)
    GameData["ability_bag"]["action_list"]["start_target_actions"]["action_01"] = Reference([[action\ability_action\name_of_action.lua]])
    GameData["ability_bag"]["action_list"]["start_target_actions"]["action_01"]["minimum_pop_used"] = n
    GameData["ability_bag"]["action_list"]["start_target_actions"]["action_01"]["points_total"] = n
    GameData["ability_bag"]["action_list"]["start_target_actions"]["action_01"]["squad_table"]["squad_01"] = [[sbps\races\axis\vehicles\tiger_ace_squad.lua]]
    
    -- Sets how ability is activated after pressing the button (timed, targeted, always on, toggled)
    GameData["ability_bag"]["activation"] = timed etc
    
    -- Sets if ability can be targeted in FOW
    GameData["ability_bag"]["can_target_in_fow"] = true\false
    
    -- Sets cost of ability (action, command, fuel, manpower, munition)
    GameData["ability_bag"]["cost"]["name_of_cost_type"] = n
    
    -- Sets time (in seconds) for the ability to be activated
    GameData["ability_bag"]["duration"] = n
    
    -- Sets how long entity is busy and can't do anything else
    GameData["ability_bag"]["entity_busy_time"] = n
    
    -- Sets whether or not recharge is global or not (ie, one use, then no other unit with the ability can use it before recharged)
    GameData["ability_bag"]["global_recharge"] = true\false
    
    -- Sets how long the delay from when you activate the ability to when the ability takes effect
    GameData["ability_bag"]["initial_delay_time"] = n
    
    -- Sets whether or not the ability has to recharge when unit is built
    GameData["ability_bag"]["initial_recharge"] = true\false
    
    -- Sets the range of the ability
    GameData["ability_bag"]["range"] = n
    
    -- Sets if the ability ignores range
    GameData["ability_bag"]["range_ignore"] = true\false
    
    -- Sets recharge time in seconds
    GameData["ability_bag"]["recharge_time"] = n
    
    -- Sets which entities in the squad that casts the ability (all_entities, squad, one_entity, may be more, but that's all I found right now)
    GameData["ability_bag"]["squad_caster"] = who is casting
    
    
    ---------------------------- Ebps ----------------------------
    
    -- Sets which construction menu a building will appear in (may have several entries)
    GameData["construction_ext"]["construction_menus"]["construction_menu_entry_0x"]["construction_type"]  = "name of construction menu"
    
    -- Sets the max number of engineers\pioneers that may work on a single building at any given time
    GameData["construction_ext"]["max_engineers"] = n
    
    -- Sets whether or not building have to be in owners territory to be built
    GameData["construction_ext"]["must_be_in_command_territory"] = true\false
    
    -- Sets whether or not building have to be in LOS of friendly units to be built (when you select building spot on map)
    GameData["construction_ext"]["must_be_in_line_of_sight"] = true\false
    
    -- Sets whether or not building must be in a territory that's in supply when built
    GameData["construction_ext"]["must_be_in_supply"] = true\false
    
    -- I think this one sets that you recieve a squad upon completed construction
    GameData["construction_ext"]["on_construction_squad"] = "squad_name"
    
    -- Sets cost for the unit (note that the actual cost is this one multiplied by the number of starting squad members as you have to pay for each member)
    GameData["cost_ext"]["time_cost"]["name_of_cost_type"] = n
    
    -- Upkeep, I think this is how much is deducted from your income per squadmember
    GameData["cost_ext"]["upkeep"]["name_of_cost_type"] = n
    
    -- This allows units to build buildings
    GameData["engineer_ext"] = Reference([[ebpextensions/engineer_ext.lua]])
    
    -- Sets construction speed (1 is default speed)
    GameData["engineer_ext"][construction_rate_multiplier"] = n
    
    -- This is used to show units even in fow (unknown whether unit has to be spotted by player first or not)
    GameData["entity_blueprint_ext"]["always_revealed_in_fow"] = true\false
    
    -- This decides which model to use for any given unit
    GameData["entity_blueprint_ext"]["animator"] = "races/allies/soldiers/paratrooper"
    
    -- Enables engineers to repair unit
    GameData["health_ext"]["can_repair"] = true\false
    
    -- Hitpoints, quite selfexplanatory
    GameData["health_ext"]["hitpoints"] = n
    
    -- Makes a unit invincible
    GameData["health_ext"]["is_invincible"] = true\false
    
    -- Sets regeneration speed and a disabling option (I think it is measured in hitpoints per second
    GameData["health_ext"]["regeneration"] = n
    GameData["health_ext"]["regeneration_disabled"] = true\false
    
    -- Sets how big the box blocking LOS for other units is
    GameData["line_of_sight_ext"]["blocking_box"]["x"] = n
    GameData["line_of_sight_ext"]["blocking_box"]["y"] = n
    GameData["line_of_sight_ext"]["blocking_box"]["z"] = n
    
    -- Sets a buildings blocking box to block shots as well
    GameData["line_of_sight_ext"]["is_shot_blocking"] = true\false
    
    -- Decides whether or not to use aforementioned LOS blocking box
    GameData["line_of_sight_ext"]["use_blocking_box"] = true\false
    
    -- Allows unit to paradrop
    GameData["paradrop_ext"] = Reference([[ebpextensions/paradrop_ext.lua]])
    
    -- Sets paradrop speed
    GameData["paradrop_ext"]["drop_speed"] = n
    
    -- Sets time from landing to being ready for combat
    GameData["paradrop_ext"]["land_seconds"] = n
    
    -- Funny one, kills unit on drop
    GameData["paradrop_ext"]["make_dead_on_drop"] = true\false
    
    -- Sets what kind of and how much of the different pop types the unit uses
    GameData["population_ext"]["medic_pop"] = n
    GameData["population_ext"]["personell_pop"] = n
    GameData["population_ext"]["vehicle_pop"] = n
    
    -- Sets time until FOW comes after unit is killed (time in seconds)
    GameData["sight_ext"]["reveal_area_on_death_time"] = n
    
    -- Sets types of sight range
    GameData["sight_ext"]["sight_package"]["inner_height"] = n
    GameData["sight_ext"]["sight_package"]["inner_range"] = n
    GameData["sight_ext"]["sight_package"]["outer_height"] = n
    GameData["sight_ext"]["sight_package"]["outer_range"] = n
    
    -- Sets which units can be built from this building along with a few requirements and other stuff
    GameData["spawner_ext"]["fx_rally_point"] = "UI/rally_point_allies" 
    GameData["spawner_ext"]["must_be_in_supply"] = true\false
    GameData["spawner_ext"]["reinforce_radius"] = n
    GameData["spawner_ext"]["spawn_at_map_entry_point"] = true\false
    GameData["spawner_ext"]["squad_table"]["squad_0x"] = "sbps\races\allies\soldiers\rifleman_squad.lua"
    
    -- Sets whether or not unit creates or secures a territory sector
    GameData["territory_ext"]["creates_territory_sector"] = true\false
    GameData["territory_ext"]["default_on"] = true\false -- unsure what exactly this one does
    GameData["territory_ext"]["secures_territory_sector"] = true\false
    
    ----------------------- Requirements -------------------------
    -- Following commands should be put in after ["requirements"]
    
    -- Allows you to put in "either", "and" or "or" arguments into requirements by using several requirement tables (Example from tiger ace file)
    ["required_n"] = Reference([[requirements\required_binary_expr.lua]])
    ["required_n"]["operation"] = [[and]]
    ["required_n"]["reason"] = [[usage_and_display]]
    ["required_n"]["requirement_table_1"]["required_1"] = Reference([[requirements\requirement_1.lua]])
    ["required_n"]["requirement_table_1"]["required_1"]["upgrade_name"] = [[upgrade\axis_propaganda_02.lua]]
    ["required_n"]["requirement_table_2"]["required_1"] = Reference([[requirements\required_entity.lua]])
    ["required_n"]["requirement_table_2"]["required_1"]["entity_type"] = [[grant_abilities]]
    
    ["required_n"] = Reference([[requirements\required_cap.lua]])
    ["required_n"]["max_cap"] = n
    ["required_n"]["reason"] = text -- unknown whether or not this has any actual effect
    ["required_n"]["ui_name"] = "ucs"
    
    ["required_n"] = Reference([[requirements\required_entity.lua]])
    ["required_n"]["entity_blueprint_name"] = [[ebps\races\...]]
    ["required_n"]["entity_type"] =
    ["required_n"]["reason"] = text -- unknown whether or not this has any actual effect
    ["required_n"]["ui_name"] = "ucs"
    
    -- Makes a certain squad required for allowing ability to be cast (example from tiger ace file)
    ["required_n"] = Reference([[requirements\required_squad.lua]])
    ["required_n"]["squad_name"] = [[sbps\races\axis\vehicles\tiger_ace_squad.lua]]
    ["required_n"]["ui_name"] = "ucs"
    
    
    
    --------------------------- Sbps -----------------------------
    
    -- Sets the abilities a squad may use
    GameData["squad_ability_bag"]["abilities"][ability_n"] = name_of_ability
    
    -- Sets if a unit may pick up items and how many may be picked up
    GameData["squad_item_slot_ext"]["can_pick_up"] = true\false
    GameData["squad_item_slot_ext"]["num_slots"] = n
    
    -- Sets what kind of units is deployed, total amount of each type and max amount of each type (this should open for medics and engineers to be fielded in the same squad as riflemen or rangers)
    GameData["squad_loadout_ext"]["unit_list"][unit_01"]["max"] = n
    GameData["squad_loadout_ext"]["unit_list"][unit_01"]["num"] = n
    GameData["squad_loadout_ext"]["unit_list"][unit_01"]["type"] = "ebps\races\allies\soldiers\airborne_infantry.lua"
    
    -- Sets time percentage and cost percentage of reinforcing (1 is  100%)
    GameData["squad_reinforce_ext"]["time_cost_percentage"]["cost_percentage"] = n
    GameData["squad_reinforce_ext"]["time_cost_percentage"]["time_percentage"] = n
    
    -- Sets name of upgrades for the squad
    GameData["squad_upgrade_ext"][upgrades"]["upgrade_01"] = "upgrade\allies\items\allies_paratrooper_anti_tank_  package.lua"
    
    --------------------------- Weapons ---------------------------
    
    -- Sets whether or not a weapon can use burst
    GameData["weapon_bag"]["burst"]["can_burst"] = true\false
    
    -- Sets the duration of the burst
    GameData["weapon_bag"]["burst"]["duration"] = n
    
    -- Sets max\min damage
    GameData["weapon_bag"]["damage"]["max"] = n
    GameData["weapon_bag"]["damage"]["min"] = n
    
    -- Sets the damage a bullet does if deflected and whether or not bullet does damage if deflected
    GameData["weapon_bag"]["deflection"]["deflection_damage_multiplier"] = n
    GameData["weapon_bag"]["deflection"]["has_deflection_damage"] = true\false
    
    -- Sets penalties while moving
    GameData["weapon_bag"]["moving"]["accuracy_multiplier"] = n
    GameData["weapon_bag"]["moving"]["burst_multiplier"] = n
    GameData["weapon_bag"]["moving"]["cooldown_multiplier"] = n
    GameData["weapon_bag"]["moving"]["disable_moving_firing"] = true\false
    
    -- Sets the name of the weapon
    GameData["weapon_bag"]["name"] = Name of gun
    
    -- sets max and min ranges, along with distant, long, medium and short range
    GameData["weapon_bag"]["range"]["max"] = n
    GameData["weapon_bag"]["range"]["mid"]["distant"] = n
    GameData["weapon_bag"]["range"]["mid"]["long"] = n
    GameData["weapon_bag"]["range"]["mid"]["medium"] = n
    GameData["weapon_bag"]["range"]["mid"]["short"] = n
    
    
    -- Sets duration and frequency of reload
    GameData["weapon_bag"]["reload"]["duration"]["max"] = n
    GameData["weapon_bag"]["reload"]["duration"]["min"] = n
    GameData["weapon_bag"]["reload"]["frequency"]["max"] = n
    GameData["weapon_bag"]["reload"]["frequency"]["min"] = n
    
    -- Sets whether or not to show a bar for progress on reload
    GameData["weapon_bag"]["reload_bar"] = true\false
    
    -- Sets different modifiers for targets if pinned by weapon
    GameData["weapon_bag"]["suppression"]["target_pinned_multipliers"]["accuracy_multiplier"] = n
    GameData["weapon_bag"]["suppression"]["target_pinned_multipliers"]["damage_multiplier"] = n
    GameData["weapon_bag"]["suppression"]["target_pinned_multipliers"]["suppression_multiplier"] = n
    
    
    Explanation of terms:
    n = number
    name_of_cost_type = insert the name of cost type here, for example munition or manpower
    name_of_ability = insert name of ability here in this form: abilities\name_of_ability.lua
    ucs = number from ucs file
    
    
    That is all for now.
    EDIT: First update already in, added a weapon section and a few other things.
    EDIT2: Fixed the ability commands to reflect the new version of the modtools

    If you need any help with things that are not listed above, please ask. Also feel free to pm me if the problem is with units that you'd rather not show to the general public.
    And anyone is free to help as well if I should not reply in a timely manner.
    Last edited by darkelf; 7th Dec 06 at 2:18 PM.
    "We are the most civilised race in the world. We have more exquisite ways to kill than any other."
    Lord Vraneth the Cruel, master of Har Ganeth
    Formerly DarkelfLord

  2. #2

  3. #3
    Poster Formerly Known As naradaman's Avatar
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    Good work!

    I'm specifically interested here:
    PHP Code:
    -- Sets what kind of units is deployedtotal amount of each type and max amount of each type (this should open for medics and engineers to be fielded in the same squad as riflemen or rangers)
    GameData["squad_loadout_ext"]["unit_list"]["unit_01"]["max"] = 0
    GameData
    ["squad_loadout_ext"]["unit_list"]["unit_01"]["num"] = 0
    GameData
    ["squad_loadout_ext"]["unit_list"]["unit_01"]["type"] = "ebps\races\allies\soldiers\airborne_infantry.lua" 
    When the tools come we could have some fun here.

    <Edit by Corsix: fixed code typo>
    Last edited by Corsix; 27th Sep 06 at 9:54 AM.
    "So now, less than five years later, you can go up on a steep hill in Las Vegas and look West, and with the right kind of eyes you can almost see the high-water mark — that place where the wave finally broke and rolled back."

  4. #4
    Poster Formerly Known As naradaman's Avatar
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    Okay I've been snooping around with Corsix's tools and I'm getting a feel for this engine now. I have run into a problem though, does anyone know what the 'critical_table' in the weapon bags are?

    GameData["weapon_bag"]["critical_table"]["tp_armour"]["0x27495DF8"]
    I can't for the life of me figure it out what it is. They take up the majority of every weapon lua. It must have something to do with cover/damage modifiers against classes of units, but the specific lua comands come up as hex numbers.

    Any thoughts?

  5. #5
    Member darkelf's Avatar
    Join Date
    Feb 2005
    Location
    A Temple of Khaine, Norway
    I think it has something to do with the critical things like busted engine, ie, the chance of a weapon doing critical damage to something. Though I am in no way sure of this, it seems the most likely thing to me right now.
    Any comments from relic devs would be kind.

  6. #6
    Poster Formerly Known As naradaman's Avatar
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    Every weapon has a whole list of them for a whole lot of classes (light_armour, heavy_armour, infantry, barbwire etc.) It seems to be fairly important.

    Edit: anyone have any idea why you can see accuracy values in the corsix's rgd viewer, but not when you dump it to LUA?
    Last edited by naradaman; 16th Sep 06 at 6:31 PM.

  7. #7
    Member darkelf's Avatar
    Join Date
    Feb 2005
    Location
    A Temple of Khaine, Norway
    No idea, naradaman, we'll have to wait for corsix to answer that one.

  8. #8
    The 22nd Hyperspace Core Corsix's Avatar
    Join Date
    Sep 2004
    Location
    Oxford
    Quote Originally Posted by naradaman
    Every weapon has a whole list of them for a whole lot of classes (light_armour, heavy_armour, infantry, barbwire etc.) It seems to be fairly important.

    Edit: anyone have any idea why you can see accuracy values in the corsix's rgd viewer, but not when you dump it to LUA?
    Could you give a few more details please (eg. which files, what things disappear, etc.) and I'll look into it.

  9. #9
    Poster Formerly Known As naradaman's Avatar
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    Okay, I don't have access to my comp right now so I can't post the exact LUA.

    Check out a weapon under attrib/weapon. All the RGDs have all their values and everything appears fine.

    If you dump to LUA and look at it though, whole bits of it are missing. For example, on the allies sniper rifle, it's missing the 'Short' accuracy value. On an m1 rifle, it's missing all accuracy values (distant, long, medium, short).

    It's very peculiar about what it decides to drop.

  10. #10
    .Spartan
    Guest
    This is a great thread/resource for us Relic newbies - Thanks!

  11. #11
    bien
    Guest
    The lua files use inherited structure. The missing fields mean they are the same as the parent weapon type. The RGD files are binary files where the hierarchical structure is flattened out, which is why every field is filled in.

  12. #12
    Member darkelf's Avatar
    Join Date
    Feb 2005
    Location
    A Temple of Khaine, Norway
    Doh! Why didn't I think of that, it's the exact same thing in dow.
    Thanks, bien. You actually are good.

  13. #13
    The 22nd Hyperspace Core Corsix's Avatar
    Join Date
    Sep 2004
    Location
    Oxford
    Yes, most other RGD -> lua convertors do not actually make use of Reference(), whereas my convertor does.

    I'm guessing bien is a Relic tools programmer?

  14. #14
    Member darkelf's Avatar
    Join Date
    Feb 2005
    Location
    A Temple of Khaine, Norway
    If he is, I want him to give me the tools right now

  15. #15
    Stickying this

  16. #16
    Member darkelf's Avatar
    Join Date
    Feb 2005
    Location
    A Temple of Khaine, Norway
    Thanks, delphy! My second stickied thread.

  17. #17
    Poster Formerly Known As naradaman's Avatar
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    For the life of me I can't figure out where those values are being inherited from. Any ideas?

  18. #18
    Member darkelf's Avatar
    Join Date
    Feb 2005
    Location
    A Temple of Khaine, Norway
    I don't think there are inheritance in RGD files, and so LUAs extracted from RGD don't have inheritance either, or am I wrong here. At least the inheritance field at the top of each lua is blank. But you can also find out what the default values for entries in each extension is by looking at what files it reference, this line for ability_ext:
    Code:
    GameData["ability_ext"] = Reference([[ebpextensions\ability_ext.lua]])
    That's all I know about inheritance right now.

  19. #19
    The 22nd Hyperspace Core Corsix's Avatar
    Join Date
    Sep 2004
    Location
    Oxford
    The luas my tool makes do not make use of Inherit(), but they do make of of Reference().

    You can also use Inherit() in any luas you make and the tool will work with that.

  20. #20
    dimension0
    Guest
    stupid question...where are these files you guys are talking about located?

    i came across this thread looking for a way to fast forward replays or to find out who the players are (and their level) via the console...if possible. That way, anyone hosting games do not have to spend all day/week watching replays to determine players and winners...

  21. #21
    Member darkelf's Avatar
    Join Date
    Feb 2005
    Location
    A Temple of Khaine, Norway
    These files are found in the .SGA archives in your Company of Heroes folder. You need to use Corsix's tool for now (until Relic releases official tools).

  22. #22
    Poster Formerly Known As naradaman's Avatar
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    Has anyone figured out what criticals and all that jazz are for? I hope the we get a bit more explanation with the official attrib editor.

  23. #23
    Member darkelf's Avatar
    Join Date
    Feb 2005
    Location
    A Temple of Khaine, Norway
    what happened here? I'm sure I saw a new post here. Did someone delete it?

  24. #24
    Hatge
    Guest
    nice work, thanks!

  25. #25
    The 22nd Hyperspace Core Corsix's Avatar
    Join Date
    Sep 2004
    Location
    Oxford
    I think this would be better if it lived in the HOWTO forum, any comments?
    (8 stickies is a bit too much, so looking at which might be better elsewhere)

  26. #26
    Member darkelf's Avatar
    Join Date
    Feb 2005
    Location
    A Temple of Khaine, Norway
    sure, might be more visible there as well.

  27. #27
    imlittlev
    Guest
    under the slit_trench\gamedata\garrison_ext\allow_type
    is it possible to use more than one value for the 'child'?
    I'd like to be able to put MGs and/or mortars in the trench.
    For value, I tried tp_infantry, tp_carried but that didnt work

  28. #28
    Member M4n!x's Avatar
    Join Date
    Mar 2009
    Location
    UK
    Hi i think what you've done is great and i want to know how to put this into action. I'm afraid i'm not the greatest of coders

    -- Sets which units can be built from this building along with a few requirements and other stuff
    GameData["spawner_ext"]["fx_rally_point"] = "UI/rally_point_allies"
    GameData["spawner_ext"]["must_be_in_supply"] = true\false
    GameData["spawner_ext"]["reinforce_radius"] = n
    GameData["spawner_ext"]["spawn_at_map_entry_point"] = true\false
    GameData["spawner_ext"]["squad_table"]["squad_0x"] = "sbps\races\allies\soldiers\rifleman_squad.lua"

    if i wanted to this to work
    so that each player starts off with a HQ and a Barracks how would i use this code so that the barracks doesn't spawn jeeps and does spawn MG's, Mortars and Snipers. I'm probs just being blonde but PLEASE HELP"!!!!!!

  29. #29
    hi all,

    there is no such thing as "squad_upgrade_ext" option in GameData for me..

    I'm looking at the airborne_infantry.rgd with corsix's tool...

    Any idea?

  30. #30
    Member Uccido's Avatar
    Join Date
    Aug 2009
    Location
    The Armoury
    (last reply's 12 months old, and a bit dead)

    try looking in sbps instead of ebps
    The Weapon Emporium
    Chevalier Entertainment on Youtube
    Chevalier Entertainment on Facebook
    Pax in Bello - Peace in War. The best possible family motto.

  31. #31
    Hi, where can i find the vehicles ID names. I want to disable some vehicles like the M18 Hellcat, M10 Tank Destroyer and the Sherman along with a few other vehicles.

  32. #32
    Member ChickenNuggets's Avatar
    Join Date
    Mar 2011
    Location
    Your closet
    You mean like the names in the luaconst.scar?

  33. #33
    This is what i have right now.

    Code:
    import("ScarUtil.scar")
    function OnGameSetup()
    end
    function OnInit()
    
    Locker()
    
    end
    
    Scar_AddInit(OnInit)
    
    
    function Locker()
    for i = 1, World_GetPlayerCount() do
    
    	playerid = World_GetPlayerAt(i)
    
    	--American Abilities
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.ALLIES.RECRUIT_PERSHING, ITEM_LOCKED) -- Pershing
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.ALLIES.RECRUIT_CALLIOPE, ITEM_LOCKED) -- Calliope
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.ALLIES.RECRUIT_PARADROP_AT, ITEM_LOCKED) -- Para AT
    	--British Abilities
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.CW.RECRUIT_PRIEST, ITEM_LOCKED) -- Priest
    	--Panzer Elite Abilities
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.ELITE.BERGE_TIGER, ITEM_LOCKED) -- Bergetiger
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.ELITE.RECRUIT_JAGDPANTHER, ITEM_LOCKED) -- Jagdpanther
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.ELITE.RECRUIT_HETZER, ITEM_LOCKED) -- Hetzer
    	--Wehrmact abilities
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.AXIS.RECRUIT_TIGER_ACE, ITEM_LOCKED) -- Tiger Ace
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.AXIS.RECRUIT_STUG, ITEM_LOCKED) -- StuG
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.AXIS.RECRUIT_TIGER, ITEM_LOCKED) -- Tiger
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.AXIS.ASSAULT, ITEM_LOCKED) -- StuH?
    	
    	--Buildings
    	--American Buildings
    	--British Buildings
    	Player_SetEntityProductionAvailability(playerid, EBP.CW.ANTITANK_NEST, ITEM_LOCKED) -- 	17 Pdr
    
    	
    	--Vehicles
    	--American Vehicles
    	Player_SetSquadProductionAvailability(playerid, SBP.ALLIES.AT_57MM, ITEM_LOCKED) -- 57 AT
    	Player_SetSquadProductionAvailability(playerid, SBP.ALLIES.M18_HELLCAT, ITEM_LOCKED) -- Hellcat
    	Player_SetSquadProductionAvailability(playerid, SBP.ALLIES.M18_HELLCAT_REINFORCEMENT, ITEM_LOCKED) -- Hellcat Reinforcements
    	Player_SetSquadProductionAvailability(playerid, SBP.ALLIES.M10_Tank_DESTROYER, ITEM_LOCKED) -- Tank Destroyer
    	Player_SetSquadProductionAvailability(playerid, SBP.ALLIES.M10_Tank_DESTROYER_REINFORCEMENT, ITEM_LOCKED) -- Tank Destroyer Reinforcement
    
    	--British Vehicles
    	Player_SetSquadProductionAvailability(playerid, SBP.CW.STUART, ITEM_LOCKED) -- Stuart
    	Player_SetSquadProductionAvailability(playerid, SBP.CW.SHERMAN_FIREFLY, ITEM_LOCKED) -- Stuart
    	--Panzer Elite Vehicles 
    	Player_SetSquadProductionAvailability(playerid, SBP.ELITE.HALFTRACK_SNIPER, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.ELITE.HUMMEL, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.ELITE.BERGETIGER, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.ELITE.PANTHER, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.ELITE.MARDER, ITEM_LOCKED) -- 
    	--Wehrmact Vehicles
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.PAK_38, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.NEBELWERFER, ITEM_LOCKED) -- 	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.HALFTRACK, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.HALFTRACK_STUKA, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.PUMA, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.KING_TIGER, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.STUG, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.PANZER, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.PANTHER, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.TIGER, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.GESCHUTZWAGEN, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.HOTCHKISS, ITEM_LOCKED) -- 
    end
    end
    Just finished testing and the American's and still build the M10 Tank Destroyer and M18 Hellcat, if anyone knows where i can find the names for these tanks that i can put in the above code to disable them from the game can you please tell me because its bugging me now.
    Last edited by Luke159; 15th Apr 12 at 4:30 PM.

  34. #34
    Member ChickenNuggets's Avatar
    Join Date
    Mar 2011
    Location
    Your closet
    Maybe it's because the hellcat is a reward unit, not sure.

  35. #35
    I hope not because that means the only alternative way is to disable the tank depot and i don't want to do that if i can help it.

  36. #36
    Member ChickenNuggets's Avatar
    Join Date
    Mar 2011
    Location
    Your closet
    I'm looking at the luaconst right now, your tanks are not named correctly it is HELLCAT and M10, not M18_HELLCAT and M10_TANK_DESTROYER, changing it to the proper name will probably fix the problem. Or is this for a mod which changes the names?

  37. #37
    Thanks bud, it works now.

    Wow weird smilies, anyway here's what i have now.

    Code:
    import("ScarUtil.scar")
    function OnGameSetup()
    end
    function OnInit()
    
    Locker()
    
    end
    
    Scar_AddInit(OnInit)
    
    
    function Locker()
    for i = 1, World_GetPlayerCount() do
    
    	playerid = World_GetPlayerAt(i)
    
    	--American Abilities
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.ALLIES.RECRUIT_PERSHING, ITEM_LOCKED) -- Pershing
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.ALLIES.RECRUIT_CALLIOPE, ITEM_LOCKED) -- Calliope
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.ALLIES.RECRUIT_PARADROP_AT, ITEM_LOCKED) -- Para AT
    	--British Abilities
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.CW.RECRUIT_PRIEST, ITEM_LOCKED) -- Priest
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.CW.RECRUIT_CHURCHILL_AVRE, ITEM_LOCKED) -- Churchill AVRE
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.CW.RECRUIT_CROMWELL_COMMAND_TANK, ITEM_LOCKED) --
    	--Panzer Elite Abilities
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.ELITE.BERGE_TIGER, ITEM_LOCKED) -- Bergetiger
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.ELITE.RECRUIT_JAGDPANTHER, ITEM_LOCKED) -- Jagdpanther
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.ELITE.RECRUIT_HETZER, ITEM_LOCKED) -- Hetzer
    	--Wehrmact abilities
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.AXIS.RECRUIT_TIGER_ACE, ITEM_LOCKED) -- Tiger Ace
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.AXIS.RECRUIT_STUG, ITEM_LOCKED) -- StuG
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.AXIS.RECRUIT_TIGER, ITEM_LOCKED) -- Tiger
    	Player_SetAbilityAvailability(playerid, ABILITY.COMMANDER_TREE.AXIS.ASSAULT, ITEM_LOCKED) -- StuH?
    	
    	--Buildings
    	--American Buildings
    	--British Buildings
    	Player_SetEntityProductionAvailability(playerid, EBP.CW.ANTITANK_NEST, ITEM_LOCKED) -- 	17 Pdr
    
    	
    	--Vehicles
    	--American Vehicles
    	Player_SetSquadProductionAvailability(playerid, SBP.ALLIES.AT_57MM, ITEM_LOCKED) -- 57 AT
    	Player_SetSquadProductionAvailability(playerid, SBP.ALLIES.HELLCAT, ITEM_LOCKED) -- M18 Hellcat
    	Player_SetSquadProductionAvailability(playerid, SBP.ALLIES.TANK_DESTROYER, ITEM_LOCKED) -- M10 Tank Destroyer
    	Player_SetSquadProductionAvailability(playerid, SBP.ALLIES.M2_105mm, ITEM_LOCKED) -- M2 105mm Howitzer
    
    	--British Vehicles
    	Player_SetSquadProductionAvailability(playerid, SBP.CW.SHERMAN_FIREFLY, ITEM_LOCKED) --
    	Player_SetSquadProductionAvailability(playerid, SBP.CW.CROMWELL, ITEM_LOCKED) --
    	--Panzer Elite Vehicles 
    	Player_SetSquadProductionAvailability(playerid, SBP.ELITE.HALFTRACK_SNIPER, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.ELITE.HUMMEL, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.ELITE.BERGETIGER, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.ELITE.PANTHER, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.ELITE.MARDER, ITEM_LOCKED) -- 
    	--Wehrmact Vehicles
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.PAK_38, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.NEBELWERFER, ITEM_LOCKED) -- 	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.HALFTRACK, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.HALFTRACK_STUKA, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.PUMA, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.KING_TIGER, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.STUG, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.PANZER, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.PANTHER, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.TIGER, ITEM_LOCKED) -- 
    	Player_SetSquadProductionAvailability(playerid, SBP.AXIS.GESCHUTZWAGEN_H39, ITEM_LOCKED) -- 
    end
    end
    BTW, no this is for a map i'm working on (there's no topic for it yet and its my first every map for COH) so it'll most likely be a poor 1st attempt at map making. I want it to be infantry and vehicles that are for taking out infantry and light vehicles, no tank destroyers like the Hellcat, Pather's etc. The above code works now and will disables heavy tanks.

    Is their any splats, building, tree's, bushes etc etc i should try not to use due to lag or oher issues? you know of, because that would greatly help (BTW, the map is huge).

  38. #38
    Member ChickenNuggets's Avatar
    Join Date
    Mar 2011
    Location
    Your closet
    Well I suggest trying to limit the amount of oak trees, they take up a fair bit of memory with their animations and try to use FX_grass instead of bushes and small objects. also I'm not sure about your map but on all my scar coded maps I have to manually add wcutil like the scarutil as for some reason I always get a loss no matter if I win or not unless I add wcutil.scar

  39. #39
    Oops i placed a lot of those lol, i will remove them because been a big map that on its own will cause some lag. as for grass i have only painted the tiles so far and i don't want to use more than 2 textures if i can help it because i read that you should aviod using more than 3 or 4 (can't remember the exact amount) but i will use splats as and when needed as a pose to textures.

    So far i have got the land scape roughly how i want it (might change a little over time), i have the roads, bridges and all 8 players starting points, map entery points and vehicle entery points in place along with all strategic points which i just finished after putting all points as none researce points to test the map out before i replace some with the munitions, fuel and man power points and redone the territories to how i want them. Now i have to start fine tuning the land scape (if needed) before i start putting in place all the buildings, tree's etc etc.

    I will start a topic tomorrow or something showing the work in progress, like i said though its my first ever map so don't expect to much lol, i'm still learning (and there is a lot to take in).

    No i don't need to add anything to make the game recognise when i have won, the scar code in my previous post is all i have added and it works fine, never have to change or add anything to it between games. I only ever have to put the code back in if i open the sgb with world builder so i keep a back up of the scar file so i can drop it back into the folder after i have saved the work and exited wb.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •