Limelight Forums

Full Version: Photoning
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Running Lights

Start with setting up your table. It's like your EMV table from before.
Code:
local PI = {}

PI.Meta
It's the exact same as the meta for emergency lights.

Here's an example for the Crown Victoria's tail light.
Code:
tail_light = { -- Set the name of the light.
    AngleOffset = 90, -- The anglular offset.
    W = 8.5, -- Size of the sprite.
    H = 9,
    Sprite = "sprites/emv/crownvic_tail", -- The material.
    Scale = 1, -- The glow multiplier.
    WMult = 1, -- Not a clue.
},

PI.Positions
Again, the same as emergency lighting. Set the positions of your lights.

An example, for the Crown Victoria's tail light.
Code:
[1] = {Vector(-31.8,-111.15,41.1), Angle(0,-20,-10), "tail_light"},

Breaking this down.
Code:
[lightIndex :: Integer] = {Position :: Vector, Rotation :: Angle, Light Meta :: String}

PI.States
This is the equivalent of the combination of EMV.Sections, EMV.Patterns and EMV.Sequences.

There are 6 states. Headlights, Breaks, Blink_Left, Blink_Right, Reverse and Running.
Headlights are not working, so I don't bother filling them in.
Inside the brackets you fill in the lights and colours, similar to EMV.Sections.

The blinkers toggle on and off, with a pattern similar to 1,1,1,0,0,0.
Hazards are created by toggling both left and right blinkers.

Here's an example from the Crown Victoria's lights.
Code:
PI.States = {
    ["Headlights"] = {}, -- Doesn't work. Leave them.
    ["Brakes"] = {{1, DR}, {2, DR}, {3, DR}, {4, DR}, {5, DR}}, -- Rear Lights, Breaking.
    ["Blink_Left"] = {{1, DR}, {3, DR}, {14, A}, {16, SW}}, -- Left Blinkers
    ["Blink_Right"] = {{2, DR}, {4, DR}, {15, A}, {17, SW}}, -- Right Blickers
    ["Reverse"] = {{10, SW}, {11, SW}}, -- Reverse Lights
    ["Running"] = {
        {1, DR, .25}, {2, DR, .25}, {3, DR, .25}, {4, DR, .25}, {12, DR, .25}, {13, DR, .25},
        {6, SW}, {7, SW}, {8, A, .8}, {9, A, .8} -- General Running Lights.
        -- For the tail lights, I set them to be a quarter of the brightness of the "real" break lights.
    },
}

Finally
Fill all those in, then stick this at the end of your code.
Depending on what you're doing, you'll generally do the first, and sometimes the second.

Code:
if Photon then
    Photon:OverwriteIndex("2011 Ford Crown Vic Police", PI)
    Photon.VehicleLibrary["sgm_2011fcvpho"] = PI
end

If you're doing multiple vehicles with the same base model, you can set the Vehicle Library.
An example from my Crown Victoria, inside the vehicle list.
Code:
    IsEMV = true,
    EMV = EMV,
    HasPhoton = true,
    Photon = "sgm_2011fcvpho"

However, if you're only doing one vehicle, you can also set it in the same file.
An example from my Merc Sprinter.
Code:
    IsEMV = true,
    EMV = EMV,
    HasPhoton = true,
    Photon = PI
    
    ...
    
    if Photon then Photon:OverwriteIndex( name, PI ) end

Both methods work, so there is no "best practice". Do what's best for you.



. Sorry I posted it anyway. You posted about 20 seconds before I did.
smells. :3
Oh, many Thanks. I did not got the running lights to work (but I only tried 5 minutes because time reasons) and this explain quite some more stuff, so.. thank you Big Grin

(Do you also know how to add liveries?)
Liveries

For some reason, the livery code is messed up. It works, but is messed up.

Firstly, you'll need to set your spawning skin.
An example from my Sprinter.
Code:
EMV.Skin = "emvu_skins/merc_sprinter_lwb/livery_police_speed"

In this case, materials/emvu_skins/merc_sprinter_lwb/livery_police_speed is a vmt, vtf pair, so it loads the material as a skin.
You could also set the skin to one of the default skins like so.
Code:
EMV.Skin = 1

Next, liveries.
For some reason, it was decided that you need categories, but they don't show up in the menu.

An example from the Sprinter.
Code:
EMV.Liveries = {
    ["Police"] = {
        ["Speed Enforcement"] = "emvu_skins/merc_sprinter_lwb/livery_police_speed",
        ["Prison Transport"] = "emvu_skins/merc_sprinter_lwb/livery_prison",
        ["SWAT"] = "emvu_skins/merc_sprinter_lwb/livery_swat",
    },
    ["EC:FD"] = {
        ["EMS"] = "emvu_skins/merc_sprinter_lwb/livery_ems",
    },
    ["Penis"] = {
        ["FUMUKU"] = "emvu_skins/merc_sprinter_lwb/dem_hummers_tho",
        ["Lionscrest"] = "emvu_skins/merc_sprinter_lwb/obey_and_survive",
    },
}

In this case, the liveries shown would be:
  • Speed Enforcement
  • Prison Transport
  • SWAT
  • EMS
  • FUMUKU
  • Lionscrest


I just noticed that i dont know what to enter there, so.. What does Photon wants to have there ?

Quote:Code:
if Photon then
Photon:OverwriteIndex("2011 Ford Crown Vic Police", PI)
Photon.VehicleLibrary["sgm_2011fcvpho"] = PI
end
Pages: 1 2