1 |
For mod, You can create a gadget,
|
1 |
For mod, You can create a gadget,
|
|
|
2 |
\n
|
|
|
3 |
{{{
|
2 |
function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam)
|
4 |
function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam)
|
3 |
local gunshipbomb_udid=UnitDefNames.gunshipbomb.id
|
5 |
local gunshipbomb_udid=UnitDefNames.gunshipbomb.id
|
4 |
if unitDefId==gunshipbomb_udid then
|
6 |
if unitDefId==gunshipbomb_udid then
|
5 |
local x,y,z=Spring.GetUnitPosition(unitID)
|
7 |
local x,y,z=Spring.GetUnitPosition(unitID)
|
6 |
local teamID=Spring.GetUnitTeam(unitID)
|
8 |
local teamID=Spring.GetUnitTeam(unitID)
|
7 |
Spring.CreateUnit(gunshipbomb_udid,x,y,z,0,)
|
9 |
Spring.CreateUnit(gunshipbomb_udid,x,y,z,0,)
|
8 |
end
|
10 |
end
|
9 |
end
|
11 |
end
|
|
|
12 |
}}}
|
10 |
\n
|
13 |
\n
|
11 |
for tweak, you can customParams.spawns_name= unit name (irrc you said that)
|
14 |
for tweak, you can customParams.spawns_name= unit name (irrc you said that)
|
12 |
e.g. {gunshipbomb={weaponDefs={gunshipbomb_bomb={customParams={spawns_name="gunshipbomb"}}}}}
|
15 |
e.g. {gunshipbomb={weaponDefs={gunshipbomb_bomb={customParams={spawns_name="gunshipbomb"}}}}}
|