Skip to content

Bikers: Weed farm

Bob74 edited this page Nov 4, 2018 · 3 revisions

Getting the main object to interact with the interior:

BikerWeedFarm = exports['bob74_ipl']:GetBikerWeedFarmObject()

Coordinates

This interior can be found at:

X Y Z
1051.491 -3196.536 -39.14842

Object structure

BikerMethLab
  +-- interiorId
  +-- Ipl
  |   +-- Interior
  |      +-- ipl
  |      +-- Load()
  |      +-- Remove()
  +-- Style
  |   +-- none
  |   +-- empty
  |   +-- basic
  |   +-- upgrade
  |   +-- Set(style, refresh)
  |   +-- Clear(refresh)
  +-- Security
  |   +-- none
  |   +-- upgrade
  |   +-- Set(security, refresh)
  |   +-- Clear(refresh)
  +-- Plant1
  |   +-- Stage
  |      +-- small
  |      +-- medium
  |      +-- full
  |      +-- Set(stage, refresh)
  |      +-- Clear(refresh)
  |   +-- Light
  |      +-- basic
  |      +-- upgrade
  |      +-- Set(light, refresh)
  |      +-- Clear(refresh)
  |   +-- Hose
  |      +-- Enable(state, refresh)
  |   +-- Set(stage, upgrade, refresh)
  |   +-- Clear(refresh)
  +-- Plant2
  |   +-- ...
  +-- Plant3
  |   +-- ...
  +-- Plant4
  |   +-- ...
  +-- Plant5
  |   +-- ...
  +-- Plant6
  |   +-- ...
  +-- Plant7
  |   +-- ...
  +-- Plant8
  |   +-- ...
  +-- Plant9
  |   +-- ...
  +-- Details
  |   +-- production
  |   +-- fans
  |   +-- drying
  |   +-- chairs
  |   +-- Enable(details, state, refresh)
  +-- LoadDefault()

Interior Ipls

Loading Ipls related files in game:

BikerWeedFarm.Ipl.Interior.Load()

Removing Ipls from game:

BikerWeedFarm.Ipl.Interior.Remove()

Style

Setting the interior's style:

BikerWeedFarm.Style.Set(style, refresh)
Parameter Description Valid values
style Basic BikerWeedFarm.Style.basic
Upgraded BikerWeedFarm.Style.upgrade
refresh Refresh the whole interior true or false

Security

Setting the security:

BikerWeedFarm.Security.Set(security, refresh)
Parameter Description Valid values
style Basic BikerWeedFarm.Security.basic
Upgraded BikerWeedFarm.Security.upgrade
refresh Refresh the whole interior true or false

Plants from 1 to 9

This documentation uses Plant1 as example. Replace Plant1 with Plant2, Plant3, etc to set another plant. Plants goes from Plant1 to Plant9
Basically, you can set up plants using two ways. Either you set up a plant in one go, or you set up each parameters individually (Stage + Light + Hose).

Setting up a plant in one go:

BikerWeedFarm.Plant1.Set(stage, light, refresh)
Parameter Description Valid values
stage Sapling BikerWeedFarm.Plant1.Stage.small
Medium height BikerWeedFarm.Plant1.Stage.medium
Fully grown up BikerWeedFarm.Plant1.Stage.full
light Basic BikerWeedFarm.Plant1.Light.basic
Upgraded BikerWeedFarm.Plant1.Light.upgrade
refresh Refresh the whole interior true or false

Stage

Setting the stage of growth:
BikerWeedFarm.Plant1.Stage.Set(stage, refresh)

Parameter Description Valid values
stage Sapling BikerWeedFarm.Plant1.Stage.small
Medium height BikerWeedFarm.Plant1.Stage.medium
Fully grown up BikerWeedFarm.Plant1.Stage.full
refresh Refresh the whole interior true or false

Light

Setting the light tier:

BikerWeedFarm.Plant1.Light.Set(light, refresh)
Parameter Description Valid values
light Basic BikerWeedFarm.Plant1.Light.basic
Upgraded BikerWeedFarm.Plant1.Light.upgrade
refresh Refresh the whole interior true or false

Hose

Enable or disable the watering hose:

BikerWeedFarm.Plant1.Hose.Enable(state, refresh)
Parameter Description Valid values
state Enabled or disabled true or false
refresh Refresh the whole interior true or false

Details

Enable or disable some interior related details:

BikerWeedFarm.Details.Enable(details, state, refresh)
Parameter Description Valid values
details Weed on the tables BikerWeedFarm.Details.production
Fans + mold buckets BikerWeedFarm.Details.fans
Drying weed hooked to the ceiling BikerWeedFarm.Details.drying
Chairs at the tables BikerWeedFarm.Details.chairs
state Enabled or disabled true or false
refresh Refresh the whole interior true or false

Default values set by bob74_ipl

LoadDefault = function()
    BikerWeedFarm.Ipl.Interior.Load()
    BikerWeedFarm.Style.Set(BikerWeedFarm.Style.upgrade)
    BikerWeedFarm.Security.Set(BikerWeedFarm.Security.basic)
    BikerWeedFarm.Details.Enable(BikerWeedFarm.Details.drying, false)
    BikerWeedFarm.Details.Enable(BikerWeedFarm.Details.chairs, false)
    BikerWeedFarm.Details.Enable(BikerWeedFarm.Details.production, false)

    BikerWeedFarm.Details.Enable({BikerWeedFarm.Details.production, BikerWeedFarm.Details.chairs, BikerWeedFarm.Details.drying}, true)

    BikerWeedFarm.Plant1.Set(BikerWeedFarm.Plant1.Stage.medium, BikerWeedFarm.Plant1.Light.basic)
    BikerWeedFarm.Plant2.Set(BikerWeedFarm.Plant2.Stage.full, BikerWeedFarm.Plant2.Light.basic)
    BikerWeedFarm.Plant3.Set(BikerWeedFarm.Plant3.Stage.medium, BikerWeedFarm.Plant3.Light.basic)
    BikerWeedFarm.Plant4.Set(BikerWeedFarm.Plant4.Stage.full, BikerWeedFarm.Plant4.Light.basic)
    BikerWeedFarm.Plant5.Set(BikerWeedFarm.Plant5.Stage.medium, BikerWeedFarm.Plant5.Light.basic)
    BikerWeedFarm.Plant6.Set(BikerWeedFarm.Plant6.Stage.full, BikerWeedFarm.Plant6.Light.basic)
    BikerWeedFarm.Plant7.Set(BikerWeedFarm.Plant7.Stage.medium, BikerWeedFarm.Plant7.Light.basic)
    BikerWeedFarm.Plant8.Set(BikerWeedFarm.Plant8.Stage.full, BikerWeedFarm.Plant8.Light.basic)
    BikerWeedFarm.Plant9.Set(BikerWeedFarm.Plant9.Stage.full, BikerWeedFarm.Plant9.Light.basic)

    RefreshInterior(BikerWeedFarm.interiorId)
end

How to use in your own resources

You can handle and customize the interiors in your own resources using the exported functions:

Citizen.CreateThread(function()
    -- Getting the object to interact with
    BikerWeedFarm = exports['bob74_ipl']:GetBikerWeedFarmObject()

    -- Setting the style
    BikerWeedFarm.Style.Set(BikerWeedFarm.Style.basic)
    
    -- Setting the security
    BikerWeedFarm.Security.Set(BikerWeedFarm.Security.basic)

    -- Enabling a single detail
    BikerWeedFarm.Details.Enable(BikerWeedFarm.Details.chairs, true)

    -- Enabling multiple details at once
    BikerWeedFarm.Details.Enable({BikerWeedFarm.Details.production, BikerWeedFarm.Details.chairs, BikerWeedFarm.Details.drying}, true)

    -- Setting up a plant using the 1st method (in one go)
    BikerWeedFarm.Plant1.Set(BikerWeedFarm.Plant1.Stage.small, BikerWeedFarm.Plant1.Light.basic)

    -- Setting up another plant using the 2nd method (settings each parameters individually)
    BikerWeedFarm.Plant2.Stage.Set(BikerWeedFarm.Plant1.Stage.full)
    BikerWeedFarm.Plant2.Light.Set(BikerWeedFarm.Plant1.Light.basic)
    BikerWeedFarm.Plant2.Hose.Enable(true)
    
    -- No other plants
    BikerWeedFarm.Plant3.Clear(false)
    BikerWeedFarm.Plant4.Clear(false)
    BikerWeedFarm.Plant5.Clear(false)
    BikerWeedFarm.Plant6.Clear(false)
    BikerWeedFarm.Plant7.Clear(false)
    BikerWeedFarm.Plant8.Clear(false)
    BikerWeedFarm.Plant9.Clear(false)

    -- Refreshing the interior to the see the result
    RefreshInterior(BikerWeedFarm.interiorId)
end)
Clone this wiki locally