-
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.
Merge pull request #114 from gruppe-adler/cleanup
one minor bugfix, event cleanup, documentation
- Loading branch information
Showing
26 changed files
with
605 additions
and
457 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Activities | ||
|
||
## Description | ||
|
||
Manages basic life states. Emotions, special activities, | ||
|
||
## API | ||
|
||
### grad_civs_activities_fnc_doCustomActivity | ||
|
||
Let civilians break from their usual activity and do something else for a limited time. | ||
|
||
Example: | ||
|
||
```sqf | ||
[ | ||
_civ, | ||
{ _this#0 setBehaviour "STEALTH" }, | ||
{ _this#0 setBehaviour "CARELESS" }, | ||
600, | ||
[], | ||
"hiding", | ||
"pooped my pants, hiding for ten minutes" | ||
] call grad_civs_activities_fnc_doCustomActivity; | ||
``` | ||
|
||
**NOTE**: this whole thing will *NOT* work while they are panicking. | ||
|
||
**NOTE**: do clean up after yourself in the `doEnd` parameter (reset AI stuff, animations etc)! | ||
|
||
#### Parameters | ||
|
||
Parameter | Explanation | ||
--------------------|----------------------------------------------------------- | ||
civ | unit - civilian to apply to | ||
doStart | code - execute desired behavior. gets `civ` as first parameter, and the elements of `moreParameters` | ||
doEnd | code - end desired behavior. gets `civ` as first parameter, and the elements of `moreParameters`. | ||
timeoutOrCondition | number or code - behavior length in seconds, or condition to end behavior | ||
moreParameters | array (optional) - more parameters to be passed to doStart and doEnd | ||
name | string (optional) - behavior name | ||
description | string (optional) - behavior description |
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
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,17 @@ | ||
# grad\_civs\_cars | ||
|
||
Basic handling of civs driving cars. | ||
|
||
As a user, see transit and voyage modules to actually get civs driving on the streets. | ||
|
||
## API | ||
|
||
### grad_civs_cars_fnc_setVehicles | ||
Sets all vehicles that civilians may drive. Overwrites value from CBA settings. Execute globally | ||
|
||
#### Syntax | ||
`[vehicles] call grad_civs_cars_fnc_setVehicles` | ||
|
||
Parameter | Explanation | ||
----------|------------------------------------------------------------- | ||
vehicles | Array - All classnames of vehicles that civilians may drive. |
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,40 @@ | ||
# grad\_civs\_cba\_statemachine | ||
|
||
Some extensions to the CBA statemachine module. Probably nothing of interest unless you're a developer. | ||
|
||
### state stot wot? | ||
|
||
worry not, here comes a friendly introduction: | ||
|
||
**CBA state machine for dummies** | ||
|
||
#### what are state machines | ||
|
||
A state machine is a construct made of states and transitions between states. It can be visualized very easily as a directed graph with nodes (states) and edges (transitions). The state machine gets fed with a bunch of entities that inhabit the states. It periodically checks the states and moves the entities along the transitions from one state to the next. | ||
|
||
#### how do they look like with CBA | ||
|
||
Let's have a very simple example: | ||
|
||
```sqf | ||
MY_CIV_LIST = ["C_Offroad_01_F" createVehicle position player]; | ||
_machine = [{MY_CIV_LIST}] call CBA_statemachine_fnc_create; | ||
_state_init = [_machine, { diag_log "init"; }, { diag_log "onEnter_init" }, { diag_log "onExit_init" }] call grad_civs_cba_statemachine_fnc_addState; | ||
_state_stuff = [_machine, {diag_log "wörk" }, {diag_log "onEnter_wörk"}, {}] call grad_civs_cba_statemachine_fnc_addState; | ||
_transition = [_machine, _state_init, _state_stuff, {CBA_missionTime > 30}, {diag_log "changing state" }] call grad_civs_cba_statemachine_fnc_addTransition; | ||
``` | ||
|
||
this will print something like this to RPT: | ||
|
||
``` | ||
onEnter_init | ||
init | ||
# … (until CBA_missionTime > 30) | ||
init | ||
onExit_init | ||
changing state | ||
onEnter_wörk | ||
wörk | ||
wörk | ||
# … | ||
``` |
Oops, something went wrong.