Module:Vehicle specifications: Difference between revisions
From Emergency Response: Liberty County Wiki
More actions
Content deleted Content added
updated error logic slightly |
No edit summary |
||
| Line 11: | Line 11: | ||
end |
end |
||
if not args['form_factor'] == 'Trailer' and |
|||
if ( |
|||
( |
|||
(not args['top_speed'] |
(not args['top_speed'] |
||
and not args['top_reverse_speed'] |
and not args['top_reverse_speed'] |
||
| Line 33: | Line 34: | ||
end |
end |
||
local wikitext = '' |
local wikitext = '|-|General=\n\n{|class="wikitable vehicle-specifications-table' |
||
if args['manufacturer'] then |
|||
wikitext = wikitext .. '\n\n|-\n\n|Manufacturer\n\n|' .. args['manufacturer'] |
|||
end |
|||
if args['form_factor'] then |
|||
wikitext = wikitext .. '\n\n|-\n\n|Form factor\n\n|' .. args['form_factor'] |
|||
end |
|||
wikitext = wikitext .. '\n\n|}\n\n|-|Performance=\n\n{|class="wikitable vehicle-specifications-table' |
|||
if args['top_speed'] then |
|||
wikitext = wikitext .. '\n\n|-\n\n|Top speed\n\n|' .. args['top_speed'] .. ' <small>MPH</small>' |
|||
end |
|||
wikitext = wikitext .. '\n\n|}\n\n|-|Structure=\n\n{|class="wikitable vehicle-specifications-table' |
|||
if args['health'] then |
|||
wikitext = wikitext .. '\n\n|-\n\n|Manufacturer\n\n|' .. args['health'] .. ' HP' |
|||
end |
|||
wikitext = wikitext .. '\n\n|}\n\n|-|Frame=\n\n{|class="wikitable vehicle-specifications-table' |
|||
if args['seats'] then |
|||
wikitext = wikitext .. '\n\n|-\n\n|Seats\n\n|' .. args['seats'] |
|||
end |
|||
wikitext = wikitext .. '\n\n|}' |
|||
return wikitext |
return wikitext |
||
Revision as of 12:48, 20 February 2026
This documentation is transcluded from Module:Vehicle specifications/doc. Changes can be proposed in the talk page.
This module is unused.
This module is neither invoked by a template nor required/loaded by another module. If this is in error, make sure to add
{{Documentation}}/{{No documentation}} to the calling template's or parent's module documentation.| Function list |
|---|
| L 3 — p.main |
local p = {}
function p.main(frame)
local getArgs = require('Module:Arguments').getArgs
local args = getArgs(frame)
local err = '|-|Error=\n\n{{error|The [[Template:Vehicle_specifications|Vehicle_specifications]] has not been configured correctly. Check the documentation for usage.}}'
if args['form_factor'] == nil then
return err
end
if not args['form_factor'] == 'Trailer' and
(
(not args['top_speed']
and not args['top_reverse_speed']
and not args['acceleration']
and not args['deceleration'])
or
(not args['transmission']
and not args['fuel_capacity']
and not args['battery_size']
and not args['drivetrain']
and not args['health'])
) then
return err
end
if not args['seats']
and not args['wheels']
and not args['inspired_by']
then
return err
end
local wikitext = '|-|General=\n\n{|class="wikitable vehicle-specifications-table'
if args['manufacturer'] then
wikitext = wikitext .. '\n\n|-\n\n|Manufacturer\n\n|' .. args['manufacturer']
end
if args['form_factor'] then
wikitext = wikitext .. '\n\n|-\n\n|Form factor\n\n|' .. args['form_factor']
end
wikitext = wikitext .. '\n\n|}\n\n|-|Performance=\n\n{|class="wikitable vehicle-specifications-table'
if args['top_speed'] then
wikitext = wikitext .. '\n\n|-\n\n|Top speed\n\n|' .. args['top_speed'] .. ' <small>MPH</small>'
end
wikitext = wikitext .. '\n\n|}\n\n|-|Structure=\n\n{|class="wikitable vehicle-specifications-table'
if args['health'] then
wikitext = wikitext .. '\n\n|-\n\n|Manufacturer\n\n|' .. args['health'] .. ' HP'
end
wikitext = wikitext .. '\n\n|}\n\n|-|Frame=\n\n{|class="wikitable vehicle-specifications-table'
if args['seats'] then
wikitext = wikitext .. '\n\n|-\n\n|Seats\n\n|' .. args['seats']
end
wikitext = wikitext .. '\n\n|}'
return wikitext
end
return p