Builder scripts: Difference between revisions

From Spring
Jump to navigationJump to search
Flozi (talk | contribs)
m updated but maybe wrongly
Line 10: Line 10:
== basic script: ==
== basic script: ==
<code>
<code>
:local nano = piece "nano"
:local body = piece "body"
:function script.AimFromWeapon()
:return body
:end
--(not sure if it function really exist )
-- origin the direction of the nano turet will sight
:
:function script.StartBuilding(y0,x0)
:function script.StartBuilding(y0,x0)
:SetUnitValue(19,1)-- ask evacuation of area
--seem not y elevation will never output
:SetUnitValue(5,1)--start emiting nano
:SetUnitValue(19,1)
-- ask evacuation of area
:Spring.SetUnitNanoPieces(nano)
--piece where from the nano particule output
:SetUnitValue(5,1)
--start emiting nano
:end
:end


:function script.StopBuilding()
:function script.StopBuilding()
:SetUnitValue(5,0)--stop emiting nano
:SetUnitValue(5,0)
:SetUnitValue(19,0)--stop asking evacuation of area
--stop emiting nano
:SetUnitValue(19,0)
--stop asking evacuation of area
:end
:end
</code>
</code>
Line 33: Line 52:


UnitDef tags involved in builder activity:
UnitDef tags involved in builder activity:
 
:(more tags exist since updates : lets check [[Units-UnitDefs]]: builders wiki page)
:Builder=1,--the unit build some static or mobile units
<code>
:BuildDistance=199, --the unit build or repair or reclaim or restore or capture or resurect at this distance
:Builder=true,
:WorkerTime=555, --amount per second can be spent in build metal or energy max
--the unit build some static or mobile units
:Reclaimable=1,--the unit can be eated by a unit with canreclamate=1
:BuildDistance=199,
:canreclamate=1, --the unit can eat another unit not having reclamable=0
--the unit build or repair or reclaim or restore or capture or resurect at this distance
:ShowNanoSpray = 1,--to verify --if 0 no spray when build
:WorkerTime=555,
:CanBeAssisted=0, --when the unit start a task a unit that canassist=1 can help
--amount per second can be spent in build metal or energy max
:CanRepair=1,--can repair unit damaged
:Reclaimable=true,
:CanRestore=1,--can reset the ground at the origin map design
--the unit can be eated by a unit with canreclamate=1
:canReclaim=1,--bad synthax?
:canReclaim=true,
:CanAssist=1,--can help other having not canbeassisted =0
--the unit can eat another unit not having reclamable=0
:Capturable=0, --can be stoled by ennemy with cancapture=1
:ShowNanoSpray =true,
:CanCapture=1,--can stole ennemy unit not having canbecaptured=0
--if false no spray when build
:canResurrect=1,--can resurect unit corspes at a price(unknow)
:CanBeAssisted=false,
:RepairSpeed=777,--max spend in repair
--when the unit start a task a unit that canassist=1 can help
:ReclaimSpeed=1600,--max gain in reclaim (corpses will not dispear before complet drain)maybe memory of drain
:CanRepair=true,
:Capturespeed=8000,--maybe the amount of needed (per second) for equal the damge of the unit before being stoled
--can repair unit damaged
:terraformSpeed=600,--amount spend for restore ground at map staart on a zone (unknow calculation)
:CanRestore=true,
 
--can reset the ground at the origin map design
:buildoptions = {
:CanAssist=true,
},
--can help other having not canbeassisted =0
:Capturable=false,  
--can be stoled by ennemy with cancapture=1
:CanCapture=true,
--can stole ennemy unit not having canbecaptured=0
:canResurrect=false,
--can resurect unit corspes at a price(unknow)
:RepairSpeed=777,
--max spend in repair
:ReclaimSpeed=1600,
--max gain in reclaim (corpses will not dispear before complet drain)maybe memory of drain
:Capturespeed=8000,
--maybe the amount of needed (per second) for equal the damge of the unit before being stoled
:terraformSpeed=600,
--amount spend for restore ground at map staart on a zone (unknow calculation)
</code>
:buildoptions = {buildunit1,buildunit2},


[[Category:Emmanuel]]
[[Category:Emmanuel]]

Revision as of 00:28, 28 March 2013

--NANO builder--

this script is requested for enabling the construction of unit by a vehicule,repair, capture,reclaim,recycle,teraform ground

this scripts are not compatible with transportation script (not sure who is winner when both)

note : construction by factory request a diferent kind of script


basic script:

local nano = piece "nano"
local body = piece "body"
function script.AimFromWeapon()
return body
end

--(not sure if it function really exist ) -- origin the direction of the nano turet will sight


function script.StartBuilding(y0,x0)

--seem not y elevation will never output

SetUnitValue(19,1)

-- ask evacuation of area

Spring.SetUnitNanoPieces(nano)

--piece where from the nano particule output

SetUnitValue(5,1)

--start emiting nano

end


function script.StopBuilding()
SetUnitValue(5,0)

--stop emiting nano

SetUnitValue(19,0)

--stop asking evacuation of area

end

advanced script:

  • using turet for nano emiter and conditionnal start





UnitDef tags involved in builder activity:

(more tags exist since updates : lets check Units-UnitDefs: builders wiki page)

Builder=true,

--the unit build some static or mobile units

BuildDistance=199,

--the unit build or repair or reclaim or restore or capture or resurect at this distance

WorkerTime=555,

--amount per second can be spent in build metal or energy max

Reclaimable=true,

--the unit can be eated by a unit with canreclamate=1

canReclaim=true,

--the unit can eat another unit not having reclamable=0

ShowNanoSpray =true,

--if false no spray when build

CanBeAssisted=false,

--when the unit start a task a unit that canassist=1 can help

CanRepair=true,

--can repair unit damaged

CanRestore=true,

--can reset the ground at the origin map design

CanAssist=true,

--can help other having not canbeassisted =0

Capturable=false,

--can be stoled by ennemy with cancapture=1

CanCapture=true,

--can stole ennemy unit not having canbecaptured=0

canResurrect=false,

--can resurect unit corspes at a price(unknow)

RepairSpeed=777,

--max spend in repair

ReclaimSpeed=1600,

--max gain in reclaim (corpses will not dispear before complet drain)maybe memory of drain

Capturespeed=8000,

--maybe the amount of needed (per second) for equal the damge of the unit before being stoled

terraformSpeed=600,

--amount spend for restore ground at map staart on a zone (unknow calculation)

buildoptions = {buildunit1,buildunit2},