Creating Prototypes
Moderator: Panzer Corps 2 Moderators
-
- Private First Class - Wehrmacht Inf
- Posts: 5
- Joined: Wed Jun 24, 2020 4:05 pm
Creating Prototypes
I was searching on how to give prototype units to the player but couldn't find anything related to it on the scenario editor. Is it made on the campaign level? If yes, how can I do it?
Re: Creating Prototypes
Example: to get unit for capturing Hex-- Possible categories: Prototypes, Captured, LimitedAvailability
function AddEquipment(player_id, unit_type, quantity, category)
local player = world:GetPlayer(player_id)
local equipment = player.equipment
local type = GetUnitType(unit_type)
local eq = equipment[type]
if (eq == nil) then
eq = NewEquipment()
eq.category = category
equipment[type] = eq
end
eq.quantity = eq.quantity + quantity
player.equipment = equipment
end
Village = {{27,25}}
function OnCaptureVillage(action)
-- If this flag was not captured by player 0 or 1 (Axis), do nothing
if(action.new_owner ~= 0 and action.new_owner ~= 1) then return end
if IsItemInTable(Village, action.flag) then
--Do not put other nation equipment into Prototypes
--Temporary All Campaign Bonuses Trigger
AddEquipment(0, "Ju87A", 10, Prototypes)
AddEquipment(0, "203mmM1931", 19, Captured)
else
return
end
end
There comes a time on every project when it is time to shoot the engineer and ship the damn thing.
Re: Creating Prototypes
Don't think those functions work in the live version of the game yet.
Re: Creating Prototypes
With the new update, these scripts should now work.
The 1.01.04 update does not require FM or SCW.
AO:SCW requires the new scripting, the new scripting does not require AO:SCW.
The 1.01.04 update does not require FM or SCW.
AO:SCW requires the new scripting, the new scripting does not require AO:SCW.
There comes a time on every project when it is time to shoot the engineer and ship the damn thing.
Re: Creating Prototypes
Best sample to look at for LUA scripts to give players prototypes and captured units are the Seville and Antequera scenarios. Loaded with scripts and examples in both.