[SOLVED] Game does not use proper variables but hardcoded values instead

User avatar
Rahkiin
Former GIANTS employee
Posts: 753
Joined: Tue Jan 17, 2017 12:45 pm

[SOLVED] Game does not use proper variables but hardcoded values instead

Post by Rahkiin »

It is a minor thing, but also a minor fix.

The AIVehicle spec controls when the AI turns on and off its lights. These values are hardcoded to 6 and 19: turn on at 7PM and off at 6AM.
This however is not always correct: there are g_currentMission.environment.nightStart and g_currentMission.environment.nightEnd that hold the values for the actual mission.

For example, in Seasons, we updated these values. These values are used to determine if the street lights need to be turned on.

I suggest to change

Code: Select all

local needLights = (dayMinutes > (19*60) or dayMinutes < (6*60));
to

Code: Select all

local needLights = (dayMinutes > g_currentMission.environment.nightStart or dayMinutes < g_currentMission.environment.nightEnd)
This I have done in Seasons to update the bug. (Also note that the traffic also does not properly use these values).
See https://gdn.giants-software.com/documen ... pdate46152

- PC/Mac/PS4/XB1: All
- Vehicle/Tool/Model/Object: Any AI
- Issue: AI lights do not adhere to builtin values but are statically coded
- Single- or Multiplayer: Both
- Steps to reproduce: Make a mod that changes the configuration of nightEnd/nightStart, and AI does not comply (e.g., use Seasons).
User avatar
pfreek
GIANTS Software | Technical Projects Coordinator
Posts: 382
Joined: Mon Feb 07, 2011 12:04 pm
Location: Erlangen

Re: Game does not use proper variables but hardcoded values instead

Post by pfreek »

Good find Rahkiin, thanks for this! We'll put it on our list for an upcoming update. I'll mark it as SOLVED! ;)
Post Reply