-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add an unholy number of debug log messages if DEBUG_MODE_FULL * aand fix a bug where ppl in small houses would never move * oh, added transition from meetneighbor to housemove
- Loading branch information
1 parent
4c70e2b
commit 8bbbeec
Showing
19 changed files
with
170 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
addons/residents/functions/fnc_sm_business_state_chat_exit.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#include "..\script_component.hpp" | ||
|
||
_this setVariable["grad_civs_lastSocialContact", CBA_missionTime]; | ||
_this setVariable ["grad_civs_chat_time", nil]; | ||
_this setVariable[QGVAR(lastChat), CBA_missionTime]; | ||
_this setVariable [QGVAR(chatDuration), nil]; | ||
_this setVariable ["grad_civs_neighborToMeet", nil]; | ||
_this setRandomLip false; |
20 changes: 18 additions & 2 deletions
20
addons/residents/functions/fnc_sm_business_state_chat_loop.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
#include "..\script_component.hpp" | ||
|
||
doStop _this; | ||
_this lookAt (_this getVariable ["grad_civs_neighborToMeet", objNull]); | ||
private _neighbor = _this getVariable ["grad_civs_neighborToMeet", objNull]; | ||
if (isNull _neighbor) exitWith { | ||
LOG_1("%1 : I dont remember my chat partner", _this); | ||
}; | ||
if (!(alive _neighbor)) exitWith { | ||
LOG_2("%1 : My chat partner %2 is dead", _this, _neighbor); | ||
}; | ||
|
||
/*get closer than 2m to have a conversation*/ | ||
/* note: this must be fulfilled to even enter the chat state BUT that neighbor may be on the move somewhere else, so follow them if necessary*/ | ||
if ((_this distance _neighbor) < 2) then { | ||
doStop _this; | ||
_this lookAt (_this getVariable ["grad_civs_neighborToMeet", objNull]); | ||
} else { | ||
LOG_2("%1 : Will move closer as my chat partner %2 is too far away", _this, _neighbor); | ||
_this moveTo (getPos _neighbor); | ||
}; | ||
|
||
_this setRandomLip (selectRandom [false, false, false, true]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
addons/residents/functions/fnc_sm_business_state_housemove_loop.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "..\script_component.hpp" | ||
|
||
if (speed _this == 0) then { | ||
private _targetPos = _this getVariable [QGVAR(targetPos), getPos _this]; | ||
LOG_3("%1 : Ordering myself to move from %2 to %3 as my speed was 0 during housemove", _this, getPos _this, _targetPos); | ||
_this moveTo _targetPos; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 14 additions & 3 deletions
17
addons/residents/functions/fnc_sm_business_state_meetNeighbor_loop.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 9 additions & 3 deletions
12
addons/residents/functions/fnc_sm_business_trans_chat_housemove_condition.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
#include "..\script_component.hpp" | ||
|
||
private _neighbor = _this getVariable ["grad_civs_neighborToMeet", objNull]; | ||
if (isNull _neighbor) exitWith {true}; | ||
if (isNull (_neighbor getVariable ["grad_civs_neighborToMeet", objNull])) exitWith {true}; | ||
if (isNull _neighbor) exitWith { | ||
LOG_1("%1 : my current chat partner has ceased existing", _this); | ||
true | ||
}; | ||
if (isNull (_neighbor getVariable ["grad_civs_neighborToMeet", objNull])) exitWith { | ||
LOG_2("%1 : current chat partner %2 does not want to chat anymore", _this, _neighbor); | ||
true | ||
}; | ||
|
||
(_this getVariable ["grad_civs_chat_time", 0]) + _thisStateTime < CBA_missionTime | ||
(_this getVariable [QGVAR(chatDuration), 0]) + _thisStateTime < CBA_missionTime |
14 changes: 11 additions & 3 deletions
14
addons/residents/functions/fnc_sm_business_trans_housemove_housework_condition.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
#include "..\script_component.hpp" | ||
|
||
private _targetPos = _this getVariable [QGVAR(targetPos), getPos _this]; | ||
|
||
private _distance = _this distance _targetPos; | ||
|
||
(_distance < 2) || | ||
(_thisStateTime > 120 && _distance < 10) | ||
if (_distance < 2) exitWith { | ||
LOG_3("%1 : entering housework as distance to %2 is %3", _this, _targetPos, _distance); | ||
true | ||
}; | ||
|
||
if ((_thisStateTime + 120) < CBA_missionTime && (_distance < 10)) exitWith { | ||
LOG_3("%1 : trying to reach destination for >120s and distance to %2 is %3 - entering housework for a change", _this, _targetPos, _distance); | ||
true | ||
}; | ||
|
||
false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 14 additions & 3 deletions
17
addons/residents/functions/fnc_sm_business_trans_meetNeighbor_chat_condition.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
#include "..\script_component.hpp" | ||
|
||
private _neighbor = _this getVariable ["grad_civs_neighborToMeet", objNull]; | ||
if (isNull _neighbor) exitWith {true}; // go to chat only so that chat can lead to housework in the next tick | ||
if (!(alive _neighbor)) exitWith {true}; | ||
if (isNull _neighbor) exitWith { | ||
LOG_1("%1 : cannot enter conversation because neighbor ceased to exist", _this); | ||
false | ||
}; | ||
if (!(alive _neighbor)) exitWith { | ||
LOG_2("%1 : cannot enter conversation because %2 is dead", _this, _neighbor); | ||
false | ||
}; | ||
|
||
/*get closer than 2m to have a conversation*/ | ||
(_this distance _neighbor) < 2 || ((_thisStateTime + 60) < CBA_missionTime) | ||
if ((_this distance _neighbor) < 2) exitWith { | ||
LOG_2("%1 : entering conversation after being closer than 2m from %2", _this, _neighbor); | ||
true | ||
}; | ||
|
||
false |
18 changes: 18 additions & 0 deletions
18
addons/residents/functions/fnc_sm_business_trans_meetNeighbor_housemove_condition.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "..\script_component.hpp" | ||
|
||
private _neighbor = _this getVariable ["grad_civs_neighborToMeet", objNull]; | ||
if (isNull _neighbor) exitWith { | ||
LOG_1("%1 : revertin to housemove because neighbor ceased to exist", _this); | ||
true | ||
}; | ||
if (!(alive _neighbor)) exitWith { | ||
LOG_2("%1 : reverting to housemove because %2 is dead", _this, _neighbor); | ||
true | ||
}; | ||
|
||
if ((_thisStateTime + 60) < CBA_missionTime) exitWith { | ||
LOG_1("%1 : reverting to housemove after trying to meet neighbor for 60s", _this); | ||
true | ||
}; | ||
|
||
false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.