Alexander 'z33ky' Hirsch
6297d2b552
Fix ScriptHook_t initialization order
...
When a ScriptClassDesc_t for is initialized (SCRIPTDESC), it recursively
invokes its parents initializers in order to obtain their pHelper
member.
Initialization is only done once, so repeated initialization is skipped.
Initialization includes assignment of a vector of ScriptHook_t's
(DEFINE_SCRIPTFUNC/BEGIN_SCRIPTHOOK), which must be initialized
beforehand.
Both of these use (static) globals; Within a translation unit,
initialization order is defined to be the same as the order of
declaration. So within a translation unit we must define all
ScriptHook_t's before the ScriptClassDesc_t using them.
A problem occurs with the parent initialization though, since there is
no defined order between translation units, meaning initialization of a
ScriptClassDesc_t can happen before its ScriptHook_t's, despite being
the correct order within its translation unit.
On MSVC it seems this issue is benign. On GCC/Linux however the
initialization of a ScriptHook_t essentially cleared whatever happened
during the initialization of the ScriptClassDesc_t, meaning many hooks
simply didn't work.
This situation is remedied by delaying the initialization of the
ScriptClassDesc_t's ScriptHook_t vector to only when the constructor of
it is invoked from its translation unit. This is accomplished simply by
adding a boolean parameter to the function (GetScriptDesc()) that is
true in the global constructor invocation, and false by default
(including when doing parent ScriptClassDesc_t initialization).
When false, a valid ScriptClassDesc_t pointer is still returned, which
is all that is needed for the initialization of the child
ScriptClassDesc_t. The value of the returned pointer is a fixed memory
location, and does not change due to the delayed initialization.
The script-helper must be initialized eagerly though, for the search of
a base-class helper. This also changes the SCRIPTDESC slightly to
accommodate the eager initialization of helper instance pointer.
Fixes #244 .
2024-11-20 23:02:00 +01:00
ALLEN-PC\acj30
471a840ed9
Fix soundlevel_t compile error on VS2013
2024-03-09 02:13:59 -06:00
Blixibon
7f0aec4371
Merge pull request #250 from mapbase-source/develop
...
Mapbase v7.2
mapbase-v7.2
2024-02-25 15:48:08 -06:00
ALLEN-PC\acj30
6bd9bcba5d
Increment version numbers to v7.2
2024-02-24 21:19:52 -06:00
ALLEN-PC\acj30
8f7b70768e
Updated README
2024-02-04 22:30:59 -06:00
Blixibon
f8d8cf6d2f
Merge pull request #279 from samisalreadytaken/fix-weapon_custom_scripted
...
weapon_custom_scripted fixes
2024-02-04 15:27:32 -06:00
Blixibon
02f81094e5
Merge pull request #275 from Blixibon/mapbase/feature/response-followup-criteria-expansion
...
Better circumstantial criteria for followup responses
2024-02-04 15:26:39 -06:00
Blixibon
11533fa292
Merge pull request #274 from Blixibon/mapbase/feature/dot-slash-command-line-param
...
Command line parameter to support dot slashes in VScript file read calls
2024-02-04 15:26:02 -06:00
Blixibon
782053e0b2
Merge pull request #273 from Blixibon/mapbase/feature/zombie-no-flinch-during-unique-anim
...
Cvar to disable zombie flinching during actbusies or scripted sequences
2024-02-04 15:25:09 -06:00
Blixibon
4e3f58f4b5
Merge pull request #272 from Blixibon/mapbase/feature/zombie-serverside-headcrab-ragdoll-fixes
...
Fix serverside zombie headcrab ragdoll not using correct origin
2024-02-04 15:24:31 -06:00
Blixibon
4c2823e814
Merge pull request #271 from Blixibon/mapbase/feature/new-companion-npc-concepts
...
New and ported response concepts for companion NPCs
2024-02-04 15:24:09 -06:00
Blixibon
4cea5d1123
Merge pull request #270 from Blixibon/mapbase/feature/dynamic-interaction-improvements
...
NPC dynamic interaction improvements and fixes
2024-02-04 15:23:40 -06:00
Blixibon
47ddedb153
Merge pull request #269 from Blixibon/mapbase/feature/anim-event-improvements
...
New animation events + OnScriptEvent outputs for ai_hint
2024-02-04 15:22:31 -06:00
Blixibon
8505ab4579
Merge pull request #262 from Blixibon/mapbase/feature/hl2-pistol-upwards-viewkick
...
weapon_pistol upwards view kick cvar
2024-02-04 15:22:03 -06:00
Blixibon
de01ce6292
Merge pull request #261 from samisalreadytaken/dev
...
Misc vscript additions
2024-02-04 15:20:12 -06:00
samisalreadytaken
f1123ed1e7
Tidy up CSimpleCallChainer::PostScriptExecute()
2024-02-02 17:06:25 +03:00
samisalreadytaken
a6f9d0a0e2
Fix CBaseEntity::ScriptGetKeyValue() returning cached string on invalid input
2024-02-02 17:06:25 +03:00
samisalreadytaken
976eb23299
Add vscript funcs
...
Panel::RemoveTickSignal()
CAI_BaseNPC::IsMedic()
2024-02-02 17:06:25 +03:00
samisalreadytaken
a02f3db05b
Fix weapon_custom_scripted hook calls
2024-01-26 23:42:52 +03:00
samisalreadytaken
19702d067d
Fix weapon_custom_scripted ItemPreFrame base call
2024-01-26 23:42:52 +03:00
ALLEN-PC\acj30
5afe4fa08b
Merge branch 'master' into develop
2024-01-11 17:39:03 -06:00
ALLEN-PC\acj30
82bc30cc26
Fix GitHub workflow not installing packages properly
2024-01-11 17:38:01 -06:00
ALLEN-PC\acj30
4adab15982
Add better circumstantial criteria to followup responses
2024-01-06 16:20:09 -06:00
ALLEN-PC\acj30
a96147a6d8
Add command line parameter to allow VScript file read paths with dot slashes
2024-01-05 15:01:44 -06:00
ALLEN-PC\acj30
4e7814eeea
Fix function call being in the wrong place
2024-01-05 14:57:43 -06:00
ALLEN-PC\acj30
a3fe8b5284
Add cvar to prevent zombies from flinching during actbusies and scripted sequences
2024-01-05 14:55:01 -06:00
ALLEN-PC\acj30
8b7c6952ba
Fix AE_ZOMBIE_POPHEADCRAB using inaccurate headcrab release position
2024-01-05 14:40:37 -06:00
ALLEN-PC\acj30
06b27acd74
Fix CNPC_BaseZombie::HeadcrabFits() and blood impacts not working with serverside ragdolls
2024-01-05 14:39:26 -06:00
ALLEN-PC\acj30
14675578a8
Fix "their_" misc criteria not being registered
2024-01-05 14:33:33 -06:00
ALLEN-PC\acj30
7c5c90ebeb
Fix TLK_NEW_ENEMY not playing on headcrabs or zombies
2024-01-05 13:26:47 -06:00
ALLEN-PC\acj30
e1c890a011
New response context-based check for TLK_SPOTTED_HEADCRAB_LEAVING_ZOMBIE (because some death types, such as serverside ragdolling, remove the zombie instantly)
2024-01-05 13:19:33 -06:00
ALLEN-PC\acj30
3ce8a35567
Add func_tank behavior criteria
2024-01-03 16:01:07 -06:00
ALLEN-PC\acj30
a2a4aa3082
Add additional enemy criteria to NPC speech
2024-01-03 16:00:47 -06:00
ALLEN-PC\acj30
9070d9a844
Optional support for fired bullets notifying targets (currently only used for NPC companion speech)
2024-01-03 16:00:10 -06:00
ALLEN-PC\acj30
85c1f7d113
Add new response concepts + port several Alyx concepts for companion NPCs
2024-01-03 15:57:18 -06:00
ALLEN-PC\acj30
3861c6a742
Fix semicolon
2024-01-03 14:21:28 -06:00
ALLEN-PC\acj30
959332b343
Fix related interactions having greater delays stomped out
2024-01-03 13:43:48 -06:00
ALLEN-PC\acj30
591039439c
Fixes and hacks for HL2 NPCs performing dynamic interactions
2024-01-03 13:32:49 -06:00
ALLEN-PC\acj30
dc8fe6021d
Fix dynamic interaction problems caused by walkframe sequence movement
2024-01-03 13:31:38 -06:00
ALLEN-PC\acj30
869ec6d0dd
Improved debugging for dynamic interaction distance
2024-01-03 13:30:10 -06:00
ALLEN-PC\acj30
a88091a4d9
Enhancements for interactions which don't test angles (including a new pose parameter to change animations based on angle)
2024-01-03 13:27:46 -06:00
ALLEN-PC\acj30
fd149ff161
Add new dynamic interaction keyvalues and utilities
2024-01-03 13:19:38 -06:00
ALLEN-PC\acj30
0d37ded0eb
Add OnScriptEvent outputs to ai_hint
2024-01-03 12:49:10 -06:00
ALLEN-PC\acj30
e44f60e8d8
Add new VScript and particle anim events
2024-01-03 12:47:29 -06:00
ALLEN-PC\acj30
b97a58e9fa
Add optional upwards viewkick to HL2 weapon_pistol
2023-12-17 11:55:51 -06:00
ALLEN-PC\acj30
e34e0d3b10
Updated README
2023-11-24 11:08:41 -06:00
ALLEN-PC\acj30
5de0ee49bd
Fix a few syntax mistakes involving bool functions returning NULL
2023-11-24 10:56:56 -06:00
ALLEN-PC\acj30
a131bf42a6
Fix unarmed citizens not picking up weapons from racks
2023-11-24 10:46:45 -06:00
ALLEN-PC\acj30
6a0a0154c6
SetClassRelationship function for VScript
2023-11-24 10:45:56 -06:00
ALLEN-PC\acj30
5fe4621eb6
Various comment changes
2023-11-24 10:45:25 -06:00