Closed Question2 closed 3 years ago
Doing some testing with the klaxons, im getting some strange results. It seems that the klaxons slowly turn themselves off, but only if i use the look action on the light and wait a few seconds. Not sure why it is doing this when turning the alarm on instantly makes all klaxons update to the flashing lights version.
Did more testing, if i activate the alarm, save, load the save game, then turn the alarm off, it works correctly. All the klaxons will instantly turn themselves off with no issues.
If i activate the alarm, then turn it off, it bugs out. At this point, saving and loading the save game will cause the klaxons to dissapear and other oddities.
What is this, an engine bug?
The whole system is a mess. Need to understand why did they use individual MVARs for security level and GVAR_SIERRA_BASE_SECURITY
and in addition to that GVAR_SIERRA_BASE_ALERT
.
$ grep -R GVAR_SIERRA_BASE_SECURITY scripts_src | grep -v 'set_global_var(GVAR_SIERRA_BASE_SECURITY,SIERRA_SECURITY_ON)'
scripts_src/maps/depolva.ssl: if ( (dude_elevation == 1) and (global_var(GVAR_SIERRA_BASE_SECURITY) == SIERRA_SECURITY_ON) and (map_var(MVAR_Free_Bots) != 0) and (map_var(MVAR_Robot_Activation) == 0) ) then begin
scripts_src/headers/global.h:#define GVAR_SIERRA_BASE_SECURITY (154)
scripts_src/sierra/wcbrnbot.ssl: set_global_var(GVAR_SIERRA_BASE_SECURITY,0);
scripts_src/sierra/wcbrnbot.ssl: set_global_var(GVAR_SIERRA_BASE_SECURITY,0);
scripts_src/sierra/wcbrnbot.ssl: set_global_var(GVAR_SIERRA_BASE_SECURITY,0);
scripts_src/sierra/wcbrnbot.ssl: set_global_var(GVAR_SIERRA_BASE_SECURITY,0);
scripts_src/sierra/wsterm3a.ssl: set_global_var(GVAR_SIERRA_BASE_SECURITY,1);
scripts_src/sierra/wsterm3b.ssl: set_global_var(GVAR_SIERRA_BASE_SECURITY,SIERRA_SECURITY_OFF);
scripts_src/sierra/wsklaxon.ssl: if ((global_var(GVAR_SIERRA_BASE_SECURITY) == SIERRA_SECURITY_ON) and (local_var(LVAR_Once) == 0)) then begin
scripts_src/sierra/wsklaxon.ssl: if (global_var(GVAR_SIERRA_BASE_SECURITY) == SIERRA_SECURITY_ON) then begin
scripts_src/sierra/wsklaxon.ssl: end else if (global_var(GVAR_SIERRA_BASE_SECURITY) == SIERRA_SECURITY_OFF) then begin
scripts_src/sierra/wiscrtdr.ssl: if (global_var(GVAR_SIERRA_BASE_SECURITY) == SIERRA_SECURITY_ON) then begin
scripts_src/sierra/wcscbot2.ssl: if ((global_var(GVAR_SIERRA_BASE_SECURITY) == SIERRA_SECURITY_OFF) or
scripts_src/sierra/wcscbot2.ssl: else if (global_var(GVAR_SIERRA_BASE_SECURITY) == SIERRA_SECURITY_ON) then begin
scripts_src/sierra/wcscbot2.ssl: if ((global_var(GVAR_SIERRA_BASE_SECURITY) == SIERRA_SECURITY_ON) and (local_var(LVAR_Active) == 0)) then begin
scripts_src/sierra/wcsecbot.ssl: if ((global_var(GVAR_SIERRA_BASE_SECURITY) == SIERRA_SECURITY_OFF) or
scripts_src/sierra/wcsecbot.ssl: else if (global_var(GVAR_SIERRA_BASE_SECURITY) == SIERRA_SECURITY_ON) then begin
scripts_src/sierra/wcsecbot.ssl: if ((global_var(GVAR_SIERRA_BASE_SECURITY) == SIERRA_SECURITY_ON) and (local_var(LVAR_Active) == 0)) then begin
GVAR_SIERRA_BASE_SECURITY
is used:
It is only ever turned off from Skynet terminal or assembled brainbot dialog.
$ grep -R GVAR_SIERRA_BASE_ALERT scripts_src
scripts_src/headers/global.h:#define GVAR_SIERRA_BASE_ALERT (151)
scripts_src/sierra/wsemit4c.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,SIERRA_ALERT_ON);
scripts_src/sierra/wcbrnbot.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,0);
scripts_src/sierra/wcbrnbot.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,0);
scripts_src/sierra/wcbrnbot.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,0);
scripts_src/sierra/wcbrnbot.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,0);
scripts_src/sierra/wsemit1a.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,SIERRA_ALERT_ON);
scripts_src/sierra/wsterm3a.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,1);
scripts_src/sierra/wsemit3a.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,SIERRA_ALERT_ON);
scripts_src/sierra/wsemit2c.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,SIERRA_ALERT_ON);
scripts_src/sierra/wiretscn.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,SIERRA_ALERT_ON);
scripts_src/sierra/wsemit1d.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,SIERRA_ALERT_ON);
scripts_src/sierra/wsemit1e.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,SIERRA_ALERT_ON);
scripts_src/sierra/wcscbot2.ssl: //else if ((cur_map_index == MAP_SIERRA_4) and (global_var(GVAR_SIERRA_BASE_ALERT) == 1)) then begin
scripts_src/sierra/wcscbot2.ssl: //else if ((cur_map_index == MAP_SIERRA_4) and (global_var(GVAR_SIERRA_BASE_ALERT) == 1)) then
scripts_src/sierra/wcscbot2.ssl: //else if ((cur_map_index == MAP_SIERRA_4) and (global_var(GVAR_SIERRA_BASE_ALERT) == 1)) then
scripts_src/sierra/wcscbot2.ssl: //else if ((cur_map_index == MAP_SIERRA_4) and (global_var(GVAR_SIERRA_BASE_ALERT) == 1)) then begin
scripts_src/sierra/wsemit4b.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,SIERRA_ALERT_ON);
scripts_src/sierra/wsemit1b.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,SIERRA_ALERT_ON);
scripts_src/sierra/wsemit2d.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,SIERRA_ALERT_ON);
scripts_src/sierra/wsemit2a.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,SIERRA_ALERT_ON);
scripts_src/sierra/wcsecbot.ssl: //else if ((cur_map_index == MAP_SIERRA_4) and (global_var(GVAR_SIERRA_BASE_ALERT) == 1)) then begin
scripts_src/sierra/wcsecbot.ssl: //else if ((cur_map_index == MAP_SIERRA_4) and (global_var(GVAR_SIERRA_BASE_ALERT) == 1)) then
scripts_src/sierra/wcsecbot.ssl: //else if ((cur_map_index == MAP_SIERRA_4) and (global_var(GVAR_SIERRA_BASE_ALERT) == 1)) then
scripts_src/sierra/wcsecbot.ssl: //else if ((cur_map_index == MAP_SIERRA_4) and (global_var(GVAR_SIERRA_BASE_ALERT) == 1)) then begin
scripts_src/sierra/wsemit3b.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,SIERRA_ALERT_ON);
scripts_src/sierra/wsemit2b.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,SIERRA_ALERT_ON);
scripts_src/sierra/wsemit4a.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,SIERRA_ALERT_ON);
scripts_src/sierra/wsemit1c.ssl: set_global_var(GVAR_SIERRA_BASE_ALERT,SIERRA_ALERT_ON);
GVAR_SIERRA_BASE_ALERT
is only set, but never checked anywhere. It can be removed.
There's also GVAR_SIERRA_BASE_ENEMY
, which has something to do with "Evil Skynet", and doesn't look 100% good, too.
Anyway, to summarize:
GVAR_SIERRA_BASE_SECURITY
in addition to MVARs, so it looks like a bug.GVAR_SIERRA_BASE_SECURITY
, so there's no evidence that klaxons not disabling is a bug.Looking at the comments, it seems that the vanilla uses gvars only while the RP wanted to use mvars to specify the alert status on each floor and have the terminals enable/disable security on their respective floors only.
However, it seems that they didnt realise that the bots and klaxons are tied to GVAR_SIERRA_BASE_SECURITY, so setting the MVAR by itself does nothing.
The easiest way to fix this is simply to have each terminal set GVAR_SIERRA_BASE_SECURITY on/off when the player chooses to turn the alarm on/off. This will correctly cause the bots to go hostile instead of nothing happening.
Another strange part is the security terminal on level 3. You can disable the forcefields on level 1 and 2 via terminals, but there is no option to do it on level 3 because using the terminal causes you to talk to skynet. Its not clear if this is a bug, but i think it would make sense for the forcefields on level 3 to be disabled if you agree to help skynet and it would also be consistent with what happens on level 1 and 2.
I will fix and upload the terminal scripts here once im done.
As for the klaxons, they are supposed to turn off because they are tied to the security level in wsklaxon :
else if (global_var(GVAR_SIERRA_BASE_SECURITY) == SIERRA_SECURITY_OFF) then begin if (obj_pid(self_obj) == PID_NS_FLASHING_LIGHT) then begin item:=create_object_sid(PID_NS_LIGHT,tile_num(self_obj),elevation(self_obj),SCRIPT_WSKLAXON); destroy_object(self_obj); end else if (obj_pid(self_obj) == PID_EW_FLASHING_LIGHT) then begin item:=create_object_sid(PID_EW_LIGHT,tile_num(self_obj),elevation(self_obj),SCRIPT_WSKLAXON); destroy_object(self_obj); end end
When I tested it, it was doing this inconsistently. If I activated the security, all the klaxons will start flashing. BUT if i tried to turn it off, nothing would happen. At this point, if i saved and loaded the game, all the flashing klaxons would be deleted from the map.
On the other hand, if i activated the security, saved, loaded THEN turned the alarm off, all of them would instantly turn off as expected.
I will try testing it again to be sure.
OK tested the klaxons again.
Here, i had just turned the alarm on, then turned it off. The secret walls have closed because GVAR_SIERRA_BASE_SECURITY is correctly set to off, but the klaxons are still flashing.
To be more specific, this is what I did :
1.Used the terminal and turned the alarm on. 2.Exited dialog (otherwise the klaxons dont update into the flashing state) 3.Used the terminal and turned the alarm off 4.Save and loaded the game
At this point, all the klaxons had vanished from the walls.
Slot 03 is before activating the alarm, slot 04 is after turning the alarm off.
Also, the bots probably shouldnt be saying their intruder alert text when the alarm has been turned off.
Okay ive fixed the following terminals:
Level 1 security terminal Level 2 security terminal
Turning the alarm on/off will now set the GVAR for security level which will turn the bots/klaxons on and off.
For the level 3 terminals, i have also made a small change : Agreeing to help skynet will disable the forcefields on level 3, similar to what you can do with the level 1 and 2 terminals.
Ive also made the secret doors in skynet's room activate if the security is activated on level 3, as otherwise the bots inside the room remain trapped in it forever and just run around inside the secret room.
I agree the terminals on level 1 and 2 should really activate/disable the alarm (lights and bots). I'd vote no for extra changes on level 3.
Not sure what you mean by klaxons working the same way in both UP and RP...did you try replicating what I did to make the klaxons dissapear?
How do you make a fork and pull?
I agree the terminals on level 1 and 2 should really activate/disable the alarm (lights and bots). I'd vote no for extra changes on level 3.
Main issue with level 3 is that the bots remain trapped in the secret room and are stuck inside, even though they are hostile to the player. They just run around inside. If im not wrong, they also prevent the player from resting on level 3 forever once they go hostile.
This is a bug that killap added by the way, because killap made the secret doors open on level 3 only if you make skynet an enemy. In vanilla, the secret doors open if the security is activated (for any reason).
Theres no reason to keep the bots locked up in the secret room once the player has triggered the security.
How do you make a fork and pull?
Not sure what you mean by klaxons working the same way in both UP and RP...did you try replicating what I did to make the klaxons dissapear?
I couldn't reproduce it in RPU. I'm referring to this
it seems that the vanilla uses gvars only while the RP wanted to use mvars to specify the alert status on each floor and have the terminals enable/disable security on their respective floors only.
This is a bug that killap added by the way, because killap made the secret doors open on level 3 only if you make skynet an enemy. In vanilla, the secret doors open if the security is activated (for any reason).
I think this change should be reverted, yes. Basically, the only things mentioned in RP changelog about Sierra are repair booth and trip wire. Otherwise, the location should work the same and scripts synced between UP and RP where possible.
GVAR_SIERRA_BASE_SECURITY
, but only Skynet can disable it. It makes sense and always been like that.GVAR_SIERRA_BASE_SECURITY
state to the player. Not the MVAR state. MVAR is pretty visible from robots shooting you in the face.
Describe the bug
This is with killap's 2.3.3 patch.
I noticed that activating the alarms via the security terminals on each level does not seem to do anything. There are no alarms and the security bots do not move.
For example, in the attached save, using the terminal to activate the alarm on level 1 does nothing.
Note that this is after I have talked to Skynet and he said he was resetting security on levels 1-3. I am not sure if this makes a difference.
I looked in the scripts and noticed that the terminals seem to do this :
set_map_var(MVAR_Security_Level_1,1); // Seraph's Fix. Original Code: set_global_var(MVAR_Security_Level_1,1);
But the klaxons and bots are not tied to mvar_security_level, so by itself, so it does nothing.
In order to get the klaxons and bots to activate, you need to set this :
set_global_var(GVAR_SIERRA_BASE_SECURITY,SIERRA_SECURITY_ON);
At this point, if security is activated on a specific level, the bots on that level will become active.
So to fix this, you need to make the terminals set the security to be on/off as well or nothing happens.
The klaxons are supposed to stop when the security is turned off as well, but they do not appear to do so. They are permanently active. I looked in the wsklaxon script but i cant see the problem...
SLOT04.zip
To Reproduce Steps to reproduce the behavior:
Edit : I will be editing the terminals myself, i will upload the scripts here when its done. Still dont know whats wrong with the klaxons not turning off though.