Hi, my goal is to try to understand how the scripting system works for scenery objects, particularly, making objects appear and disappear based on the time of day. My goal is to have ai "car_park" objects appear and disappear based on the time of day.
I found this code from one of the static "people_standing" objects and was wondering if someone could explain the different functions and variables used in the .osc file to make the appear/disappear variable work:
Code
{frame}
(L.L.appear) 0 =
{if}
100 random (S.L.randomint)
(L.L.randomint) 30 <
{if}
5 3600 * (S.L.appear)
23 3600 * (S.L.disappear)
{else}
(L.L.randomint) 70 <
{if}
7 3600 * (S.L.appear)
21 3600 * (S.L.disappear)
{else}
10 3600 * (S.L.appear)
18 3600 * (S.L.disappear)
{endif}
{endif}
1800 random 900 - (S.L.randomseconds)
(L.L.appear) (L.L.randomseconds) + (S.L.appear)
(L.L.disappear) (L.L.randomseconds) + (S.L.disappear)
{endif}
(L.S.Time) (L.L.appear) > (L.S.Time) (L.L.disappear) < &&
{if}
1 (S.L.visible)
{else}
0 (S.L.visible)
{endif}
{end}
Alles anzeigen
I'd like to understand how to edit this code to my specification so that I don't need to ask this question every time!