Debian Codegraph @

scripts/lnx/osiris_common.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/data/scripts/osiris_common.h $
21 * $Revision: 1.2 $
22 * $Date: 2004/02/09 04:14:52 $
23 * $Author: kevinb $
24 *
25 * Contains code that is common along all modules. Mostly defines, flags, etc.
26 *
27 * $Log: osiris_common.h,v $
28 * Revision 1.2 2004/02/09 04:14:52 kevinb
29 * Added newlines to all headers to reduce number of warnings printed
30 *
31 * Made some small changes to get everything compiling.
32 *
33 * All Ready to merge the 1.5 tree.
34 *
35 * Revision 1.1 2000/05/29 05:48:29 icculus
36 * initial import.
37 *
38 * Revision 1.1 2000/04/18 01:45:56 icculus
39 * Needed for compilation.
40 *
41 *
42 * 146 11/03/99 10:20a Chris
43 * Added the ability to find out if a room is volatile
44 *
45 * 145 11/02/99 12:16p Chris
46 * More Merc code - added support for ignore_obj_lists for the Osiris
47 * RayCast function
48 *
49 * 144 10/27/99 4:18p 3dsmax
50 * added cloak flag for Obj_Value
51 *
52 * 143 10/23/99 6:16p Nate
53 * Added define for Polish Language
54 *
55 * 142 10/16/99 8:44p Jeff
56 * created defines to remove player weapons and all powerups from a room
57 *
58 * 141 10/12/99 4:50p Jeff
59 *
60 * 140 9/10/99 11:03a Samir
61 * added command to get object's name from Obj_Value.
62 *
63 * 139 6/23/99 12:49p Samir
64 * fixed for Linux builds
65 *
66 * 138 5/21/99 7:29a Chris
67 * More tweaking...
68 *
69 * 137 5/19/99 11:25a Matt
70 * Added multisafe functions & Dallas actions for showing a timer on the
71 * screen and adding custom HUD messages.
72 *
73 * 136 5/17/99 6:22p Jeff
74 * added filtered HUD messages
75 *
76 * 135 5/10/99 9:36p Ardussi
77 * changes to compile on Mac
78 *
79 * 134 5/10/99 12:23a Chris
80 * Fixed another hearing/seeing case. :) Buddy bot now is in the player
81 * ship at respawn
82 *
83 * 133 5/06/99 6:38a Chris
84 *
85 * 132 5/06/99 4:11a Jeff
86 * created multisafe function to destroy robots in the level (helps boss
87 * fights)
88 *
89 * 131 5/04/99 6:53p Jeff
90 * added event for when a player dies
91 *
92 * 130 5/04/99 12:13p Matt
93 * Renamed fire-flare symbol to fire-weapon.
94 *
95 * 129 4/30/99 4:32p Matt
96 * Added a Dallas action to fire a flare from an object.
97 *
98 * 128 4/29/99 3:25p Chris
99 * Added support to find out if an object has wbs
100 *
101 * 127 4/29/99 1:59a Chris
102 * Added the portal blockage support
103 *
104 * 126 4/27/99 4:27p Jeff
105 * added player respawn osiris event
106 *
107 * 125 4/27/99 4:40a Jeff
108 * added msafe member to set/get guidebot name
109 *
110 * 124 4/26/99 4:27a Jeff
111 * added multisafe functions to check a player's weapons, and add/remove
112 * weapons from a player
113 *
114 * 123 4/24/99 6:44p Jeff
115 * added functions for theif so he can steal things other than weapons
116 *
117 * 122 4/24/99 12:09a Jeff
118 * added path value functions
119 *
120 * 121 4/22/99 4:58p Kevin
121 * fixed bad merge
122 *
123 * 120 4/22/99 4:44p Jason
124 * fixed level goal stuff for multiplayer
125 *
126 * 118 4/20/99 7:28p Jeff
127 * added guidebot name
128 *
129 * 117 4/20/99 12:00a Jeff
130 * Linux compile
131 *
132 * 116 4/06/99 11:44p Matt
133 * Added action to create a lighting bolt between two gunpoints on the
134 * same object, and queries to return an object's original shields and to
135 * multiply a percent times a float.
136 *
137 * 115 4/06/99 8:44p Matt
138 * Added a couple actions for Mark's energy/shield collector
139 *
140 * 114 4/04/99 8:21p Matt
141 * Fixed include problems with osiris vector stuff. Osiris headers now
142 * include vecmat_external.h, instead of defining the typedefs, structs,
143 * and inlines on the Osiris side.
144 *
145 * 113 4/04/99 6:20p Matt
146 * Added distance-based shake Dallas action.
147 *
148 * 112 4/04/99 4:55p Jeff
149 * gamecinematics_external.h was missing for some reason
150 *
151 * 111 4/03/99 1:13a Jeff
152 * added multisafe/dallas actions to set an object on fire
153 *
154 * 110 4/02/99 10:12p Jeff
155 * made ship permissions multi safe
156 *
157 * 109 4/02/99 10:18a Chris
158 * We can now mess with the Object_info anim stuff
159 *
160 * 108 3/31/99 11:11a Luke
161 * fixed another bad merge (Jeff)
162 *
163 * 107 3/30/99 8:15p Jeff
164 * bad merge
165 *
166 * 106 3/30/99 7:25p Chris
167 * Make the weath_lightning stuff more flexable
168 *
169 * 104 3/30/99 4:32p Chris
170 * Moved subtype to the main goal sturct (from goal_info). Made move
171 * relative object vec finishable. (Like get behind player)
172 *
173 * 103 3/28/99 5:56p Matt
174 * Added Dallas action to turn on object sparking
175 *
176 * 102 3/27/99 12:29p Chris
177 * Fixed problems with assigned lower priority goals that used paths (it
178 * would confuse the bot because the .path field was getting updated for
179 * the new goal even though it was lower priority)
180 *
181 * 101 3/26/99 12:38p Jeff
182 * added cloak predefs
183 *
184 * 100 3/22/99 6:35p Matt
185 * Added Dallas action to create a lightning bolt between two objects.
186 * Jason will implement this.
187 *
188 * 99 3/22/99 1:59p Matt
189 * Added break glass Dallas action
190 *
191 * 98 3/22/99 10:56a Chris
192 * Awareness code was tweaked. Multisafe stuff added for objects.
193 *
194 * 97 3/17/99 3:55p Nate
195 * Added language defines
196 *
197 * 96 3/16/99 11:26a Chris
198 * Buddy is now smarter -- gets to trigger level goals
199 *
200 * 95 3/10/99 1:33p Chris
201 * Fixes for multi-line gb messages
202 *
203 * 94 3/04/99 6:13p Matt
204 * Added message2 buffer to msafe_struct, and made the message longer.
205 *
206 * 93 3/03/99 3:34p Chris
207 *
208 * 92 3/03/99 3:02p Matt
209 * Added Game Message action in Dallas
210 *
211 * 91 3/03/99 3:01a Chris
212 * Exported the difficulty stuff to OSIRIS
213 *
214 * 90 2/28/99 11:30p Chris
215 * FindObjOfType and OSIRIS controllable deaths
216 *
217 * 89 2/25/99 8:54p Jeff
218 * Inventory supports level change persistant items. Inventory supports
219 * time-out objects. Inventory Reset changed (takes a level of reset
220 * now). Quad lasers stay across level change (single player). Guidebot
221 * bug fixed (now back in ship on level start). Quads time out when
222 * spewed. Invulnerability and cloak powerups no longer use game
223 * event/callbacks, so they can be saved in game saves (moved to
224 * MakePlayerInvulnerable and MakeObjectInvisible)
225 *
226 * 88 2/25/99 5:43p Chris
227 * Massive improvement to BOA and AI (again)
228 *
229 * 87 2/22/99 5:59p Chris
230 * Level Goals are now in OSIRIS. :)
231 *
232 * 86 2/22/99 1:20a Jeff
233 * added support for inventory (simple) in dallas. Moved end-level
234 * sequence to use IGC. Add position clipboard stuff for dallas. Fixed
235 * some inventory bug with storing object handles
236 *
237 * 85 2/21/99 7:16p Chris
238 * Added the EVT_LEVEL_GOAL_ITEM_COMPLETE event
239 *
240 * 84 2/21/99 5:51p Chris
241 * FIxed a bug with OBJV_C_TYPE (It should have been OBJV_I_TYPE). Added
242 * Obj_FindType()
243 *
244 * 83 2/21/99 5:49p Matt
245 * Added Dallas action to set an object's volume
246 *
247 * 82 2/20/99 4:28p Chris
248 * SOme updates to the system, not done
249 *
250 * 81 2/19/99 5:16p Chris
251 * Added the child died event
252 *
253 * 80 2/17/99 3:25a Jeff
254 * added checksum member to init struct
255 *
256 * 79 2/15/99 11:09a Matt
257 * Added function to count the number of a certain type of object in the
258 * level. (Also added HUD actions to print an int and float.)
259 *
260 * 78 2/11/99 2:54a Jeff
261 * improvements to introcam
262 *
263 * 77 2/09/99 12:43p Matt
264 * Added function to check for players in a room
265 *
266 * 76 2/08/99 2:53p Jeff
267 * added matcen event data
268 *
269 * 75 2/08/99 2:47p Jeff
270 * new events
271 *
272 * 74 2/08/99 3:10a Jeff
273 * added a multisafe type for player control type setting. Improved intro
274 * cinematic action function, player now follows path.
275 *
276 * 73 2/06/99 10:03p Matt
277 * Added keys system
278 *
279 * 72 2/06/99 1:52a Matt
280 * Added a bunch of Dallas funcs, mostly for Sean
281 *
282 * 71 2/05/99 9:06p Jeff
283 * added aux events for a couple new ainotify's
284 *
285 * 70 2/03/99 5:48p Matt
286 * Added room damage system
287 *
288 * 69 1/31/99 11:05p Matt
289 * Added music region set
290 *
291 * 68 1/31/99 8:53p Jeff
292 * new in game cinematics system finished
293 *
294 * 67 1/30/99 3:19p Matt
295 * Made Dallas spews work from object centers in addition to gunpoints
296 *
297 * 66 1/29/99 12:47p Matt
298 * Rewrote the doorway system
299 *
300 * 65 1/27/99 11:41p Jeff
301 * added dll identifier
302 *
303 * 64 1/26/99 5:16p Matt
304 * Added STOP_SOUND_OBJ
305 *
306 * 63 1/25/99 7:06p Matt
307 * Ripped out doorway index stuff, since doors are referred to by their
308 * door objects.
309 *
310 * 62 1/25/99 8:13a Chris
311 * Made the AUX goal remap more obvious...
312 *
313 * 61 1/24/99 8:17p Chris
314 * Updated AI and OSIRIS. Externalized fireball constants for spew and
315 * sparks. Added CreateRandomSparks to OSIRIS, renamed a bunch of AI
316 * Notify names to use underscores. Fixed a memory access leak in the
317 * matcen effect code.
318 *
319 * 60 1/23/99 2:56a Jeff
320 * added target field to boss intro struct
321 *
322 * 59 1/22/99 6:53p Chris
323 * Fixed LoadandBind Aux notify problems, fixed static path problems,
324 * fixed AIF_FORCE_AWARE Problems, improved path code
325 *
326 * 58 1/22/99 3:34p Kevin
327 * Increased the MSAFE_MESSAGE_LENGTH to 200 bytes
328 *
329 * 57 1/20/99 6:26p Matt
330 * Added several actions
331 *
332 */
333
334 #ifndef __OSIRIS_COMMON_H_
335 #define __OSIRIS_COMMON_H_
336
337 #include "../../Main/lib/vecmat_external.h"
338
339 #include "../../Main/aistruct_external.h"
340 #include "../../Main/object_external.h"
341 #include "../../Main/matcen_external.h"
342 #include "../../Main/robotfirestruct_external.h"
343 #include "../../Main/lib/findintersection_external.h"
344 #include "../../Main/weapon_external.h"
345 #include "../../Main/damage_external.h"
346 #include "../../Main/fireball_external.h"
347 #include "../../Main/levelgoal_external.h"
348 #include "../../Main/deathinfo_external.h"
349 #include "../../Main/difficulty_external.h"
350 #include "../../Main/gamecinematics_external.h"
351 #include "../../Main/player_external.h"
352
353 // =======================================================================
354 // Event return values (OR these if needed)
355 // =======================================================================
356 #define CONTINUE_CHAIN 0x0100 // continue executing the chain of scripts
357 #define CONTINUE_DEFAULT 0x0001 // continue executing the 'in-code' action
358
359 // =======================================================================
360 // Events that OSIRIS handles
361 // =======================================================================
362 #define EVT_INTERVAL 0x100 // called every frame
363 #define EVT_AI_FRAME 0x101 // called every frame for AI info
364 #define EVT_DAMAGED 0x102 // called when object is damaged
365 #define EVT_COLLIDE 0x103 // called when object collides with something
366 #define EVT_CREATED 0x104 // called when object created
367 #define EVT_DESTROY 0x105 // called when object destroyed
368 #define EVT_TIMER 0x106 // called when a timer event is signalled
369 #define EVT_USE 0x107 // called when item is selected for use from inventory
370 #define EVT_AI_NOTIFY 0x110 // called when an AI gets notified
371 #define EVT_AI_INIT 0x111 // called to initialize SCRIPT AI stuff
372 #define EVT_LEVELSTART EVT_CREATED //
373 #define EVT_LEVELEND EVT_DESTROY // called when level is started and ended.
374 #define EVT_CHANGESEG 0x115 // called when object changes room
375 #define EVT_SAVESTATE 0x117 // called when the script should save it's state
376 #define EVT_RESTORESTATE 0x118 // called when the script should restore it's state
377 #define EVT_MEMRESTORE \
378 0x119 // called when the script should restore a pointer to the special auto-save memory it allocated
379 #define EVT_TIMERCANCEL 0x11A // called when a timer is cancels (either by function call or from it's object detonator)
380 #define EVT_AIN_OBJKILLED 0x11B // child event of EVT_AI_NOTIFY
381 #define EVT_AIN_SEEPLAYER 0x11C // child event of EVT_AI_NOTIFY
382 #define EVT_AIN_WHITOBJECT 0x11D // child event of EVT_AI_NOTIFY
383 #define EVT_AIN_GOALCOMPLETE 0x11E // child event of EVT_AI_NOTIFY
384 #define EVT_AIN_GOALFAIL 0x11F // child event of EVT_AI_NOTIFY
385 #define EVT_AIN_MELEE_HIT 0x120 // child event of EVT_AI_NOTIFY
386 #define EVT_AIN_MELEE_ATTACK_FRAME 0x121 // child event of EVT_AI_NOTIFY
387 #define EVT_AIN_MOVIE_START 0x122 // child event of EVT_AI_NOTIFY
388 #define EVT_AIN_MOVIE_END 0x123 // child event of EVT_AI_NOTIFY
389 #define EVT_MATCEN_CREATE 0x124 // level event that a matcen created an object
390 #define EVT_DOOR_ACTIVATE 0x125 // event to when a door is opening
391 #define EVT_DOOR_CLOSE 0x126 // event to when a door is closing
392 #define EVT_CHILD_DIED 0x127
393 #define EVT_LEVEL_GOAL_COMPLETE 0x128
394 #define EVT_ALL_LEVEL_GOALS_COMPLETE 0x129
395 #define EVT_LEVEL_GOAL_ITEM_COMPLETE 0x12A
396 #define EVT_PLAYER_MOVIE_START 0x12B // event when a IGC focusing on the player starts
397 #define EVT_PLAYER_MOVIE_END 0x12C // event when a IGC focusing on the player ends
398 #define EVT_PLAYER_RESPAWN 0x12D // event when a player respawns
399 #define EVT_PLAYER_DIES 0x12E // event when a player dies
400
401 // =======================================================================
402 // General defines
403 // =======================================================================
404 #define MAX_MODULEFUNCS 256 // maximum number of functions imported to OSIRIS
405
406 typedef int OMMSHANDLE;
407
408 // =======================================================================
409 // Language defines
410 // =======================================================================
411 #define LANGUAGE_ENGLISH 0
412 #define LANGUAGE_GERMAN 1
413 #define LANGUAGE_SPANISH 2
414 #define LANGUAGE_ITALIAN 3
415 #define LANGUAGE_FRENCH 4
416 #define LANGUAGE_POLISH 5
417
418 // Player Accessories indices (for Player_Value function)
419 #define ACCESSORY_CLOAK 0
420 #define ACCESSORY_INVULNERABILITY 1
421 #define ACCESSORY_AFTERBURNER 2
422 #define ACCESSORY_HEADLIGHT 3
423 #define ACCESSORY_QUAD 4
424 #define ACCESSORY_RAPID_FIRE 5
425 #define ACCESSORY_MAP 6
426
427 #define MSAFE_ROOM 0
428 #define MSAFE_OBJ 20
429 #define MSAFE_WEATHER 100
430 #define MSAFE_SOUND 110
431 #define MSAFE_MATCEN 130
432 #define MSAFE_MISC 150
433 #define MSAFE_DOOR 170
434 #define MSAFE_MISSION 180
435 #define MSAFE_TRIGGER 190
436 #define MSAFE_INVEN 200
437 #define MSAFE_COUNTERMEASURE 210
438 #define MSAFE_WEAPON 250
439
440 #define SPEW_RAND_SPEED 2
441 #define SPEW_RAND_SIZE 4
442 #define SPEW_RAND_LIFETIME 16
443
444 // =======================================================================
445 // Value Functions
446 // =======================================================================
447
448 #define VF_SET 0
449 #define VF_GET 1
450 #define VF_SET_FLAGS 2
451 #define VF_CLEAR_FLAGS 3
452
453 // =======================================================================
454 // Value - Player only values
455 // =======================================================================
456
457 #define PLYV_F_ENERGY 0
458 #define PLYV_F_MOVEMENT_SCALAR 1
459 #define PLYV_F_RECHARGE_SCALAR 2
460 #define PLYV_F_WSPEED_SCALAR 3
461 #define PLYV_F_DAMAGE_SCALAR 4
462 #define PLYV_F_ARMOR_SCALAR 5
463 #define PLYV_I_BUDDY_HANDLE 6
464
465 // These work off the weapon index
466 #define PLYSV_I_WEAPON 7
467 #define PLYSV_I_WEAPON_AMMO 8
468 #define PLYSV_US_WEAPON_POWERUP_ID 9
469
470 // These work off the accessory index
471 #define PLYSV_F_ACCESSORY 10
472
473 // This is for setting and getting the guidebot name
474 #define PLYV_CS_GUIDEBOTNAME 11
475
476 // this is for thief access
477 #define PLYV_B_THIEF_PLAYERHASITEM 12 // VF_GET only (takes a bool for ptr, int for index..which item..see THIEFITEM_)
478 #define PLYV_I_THIEF_STEALPLAYERITEM 13 // VF_SET only (takes an int for index, ptr is ignored)
479
480 #define PLYV_I_FLAGS 14 // Player flags
481 #define PLYV_I_STRIP_WEAPONS 15 // VF_SET only (removes all weapons but lasers, sets energy to 0)
482
483 // These are used to mask out various controls, put in initially for the training system
484 #define PLYV_CMASK_FORWARD 1
485 #define PLYV_CMASK_REVERSE 2
486 #define PLYV_CMASK_LEFT 4
487 #define PLYV_CMASK_RIGHT 8
488 #define PLYV_CMASK_UP 16
489 #define PLYV_CMASK_DOWN 32
490 #define PLYV_CMASK_PITCHUP 64
491 #define PLYV_CMASK_PITCHDOWN 128
492 #define PLYV_CMASK_HEADINGLEFT 256
493 #define PLYV_CMASK_HEADINGRIGHT 512
494 #define PLYV_CMASK_BANKLEFT 1024
495 #define PLYV_CMASK_BANKRIGHT 2048
496 #define PLYV_CMASK_PRIMARY 4096
497 #define PLYV_CMASK_SECONDARY 8192
498 #define PLYV_CMASK_AFTERBURNER 16384
499
500 // =======================================================================
501 // Value - AI Values
502 // =======================================================================
503
504 #define AIV_F_MAX_SPEED 0
505 #define AIV_F_MAX_DELTA_SPEED 1
506 #define AIV_F_MAX_TURN_RATE 2
507 #define AIV_F_MAX_DELTA_TURN_RATE 3
508 #define AIV_F_ATTACK_VEL_PERCENT 4
509 #define AIV_F_FLEE_VEL_PERCENT 5
510 #define AIV_F_DODGE_VEL_PERCENT 6
511 #define AIV_F_CIRCLE_DIST 7
512 #define AIV_F_DODGE_PERCENT 8
513 #define AIV_F_MELEE_DAMAGE1 9
514 #define AIV_F_MELEE_DAMAGE2 10
515 #define AIV_F_MELEE_LATENCY1 11
516 #define AIV_F_MELEE_LATENCY2 12
517 #define AIV_C_MOVEMENT_TYPE 13
518 #define AIV_C_MOVEMENT_SUBTYPE 14
519 #define AIV_C_ANIMATION_TYPE 15
520 #define AIV_C_NEXT_ANIMATION_TYPE 16
521 #define AIV_C_NEXT_MOVEMENT 17
522 #define AIV_C_CURRENT_WB_FIRING 18
523 #define AIV_I_TARGET_HANDLE 19
524 #define AIV_F_NEXT_TARGET_UPDATE_TIME 20
525 #define AIV_F_DIST_TO_TARGET 21
526 #define AIV_V_VEC_TO_TARGET 22
527 #define AIV_F_NEXT_CHECK_SEE_TARGET_TIME 23
528 #define AIV_V_LAST_SEE_TARGET_POS 24
529 #define AIV_F_LAST_SEE_TARGET_TIME 25
530 #define AIV_F_WEAPON_SPEED 26
531 #define AIV_F_NEXT_MELEE_TIME 27
532 #define AIV_F_LAST_RENDER_TIME 28
533 #define AIV_F_NEXT_FLINCH_TIME 29
534 #define AIV_V_MOVEMENT_DIR 30
535 #define AIV_V_ROT_THRUST_VECTOR 31
536 #define AIV_F_FOV 32
537 #define AIV_F_AVOID_FRIENDS_DIST 33
538 #define AIV_F_FRUSTRATION 34
539 #define AIV_F_CURIOUSITY 35
540 #define AIV_F_FIRE_SPREAD 36
541 #define AIV_F_AGRESSION 37
542 #define AIV_F_NIGHT_VISION 38
543 #define AIV_F_FOG_VISION 39
544 #define AIV_F_LEAD_ACCURACY 40
545 #define AIV_F_LEAD_VARIENCE 41
546 #define AIV_F_FIGHT_TEAM 42
547 #define AIV_F_FIGHT_SAME 43
548 #define AIV_F_HEARING 44
549 #define AIV_F_ROAMING 45
550 #define AIV_F_LIFE_PRESERVATION 46
551 #define AIV_F_BIASED_FLIGHT_IMPORTANCE 47
552 #define AIV_F_BIASED_FLIGHT_MIN 48
553 #define AIV_F_BIASED_FLIGHT_MAX 49
554 #define AIV_F_AWARENESS 50
555 #define AIV_I_FLAGS 51
556 #define AIV_I_STATUS_REG 52
557 #define AIV_F_LAST_HEAR_TARGET_TIME 53
558
559 // =======================================================================
560 // Value - AI Values
561 // =======================================================================
562
563 #define AIGV_I_TYPE 0
564 #define AIGV_C_ACTIVATION_LEVEL 1
565 #define AIGV_F_MIN_INFLUENCE 2
566 #define AIGV_F_MAX_INFLUENCE 3
567
568 #define AIGSV_F_INFLUENCE_DIST 4
569
570 #define AIGV_I_HANDLE 5
571 #define AIGV_I_ROOMNUM 6
572 #define AIGV_I_F_ACTIONS 7
573 #define AIGV_I_ID 8
574 #define AIGV_C_SUBTYPE 9
575 #define AIGV_F_TIME 10
576 #define AIGV_V_VEC 11
577 #define AIGV_V_POS 12
578 #define AIGV_F_STEER_MIN_DIST 13
579 #define AIGV_F_STEER_MAX_DIST 14
580 #define AIGV_F_STEER_MAX_STRENGTH 15
581 #define AIGV_B_ATTACH_F_ALIGNED 16
582 #define AIGV_B_ATTACH_F_SPHERE 17
583 #define AIGV_F_ATTACH_RAD 18
584 #define AIGV_C_ATTACH_CHILD_AP 19
585 #define AIGV_C_ATTACH_PARENT_AP 20
586 #define AIGV_I_WANDER_AVOID_HANDLE 21
587 #define AIGV_C_WANDER_MIN_ROOMS 22
588 #define AIGV_C_WANDER_MAX_ROOMS 23
589 #define AIGV_C_WANDER_FLAGS 24
590 #define AIGV_C_WANDER_MINE_INDEX 25
591 #define AIGV_F_CIRCLE_DIST 26
592 #define AIGV_I_STATUS_REG 27
593 #define AIGV_F_START_TIME 28
594 #define AIGV_F_NEXT_PATH_TIME 29
595 #define AIGV_F_DIST_TO_GOAL 30
596 #define AIGV_V_VEC_TO_TARGET 31
597 #define AIGV_F_NEXT_CHECK_SEE_TARGET_TIME 32
598 #define AIGV_V_LAST_SEE_TARGET_POS 33
599 #define AIGV_F_LAST_SEE_TARGET_TIME 34
600 #define AIGV_F_NEXT_TARGET_UPDATE_TIME 35
601 #define AIGV_I_FLAGS 36
602 #define AIGV_V_ORIENT_FVEC 37
603 #define AIGV_V_ORIENT_UVEC 38
604
605 #define AIGV_C_NUM_ENABLERS 39
606 #define AIGSV_C_ENABLER_TYPE 40
607 #define AIGSV_F_ENABLER_TIME 41
608 #define AIGSV_C_ENABLER_MTYPE 42
609 #define AIGSV_F_ENABLER_FLOAT_VALUE 43
610 #define AIGSV_I_ENABLER_FLAGS 44
611 #define AIGSV_F_ENABLER_DIST 45
612 #define AIGSV_F_ENABLER_PERCENT 46
613 #define AIGSV_F_ENABLER_CHECK_INTERVAL 47
614 #define AIGSV_F_ENABLER_LAST_CHECK_TIME 48
615 #define AIGSV_C_ENABLER_NEXT_ENABLER_OP 49
616
617 #define AIGV_B_USED 50
618 #define AIGV_I_SCRIPTED_DATA_PTR 51
619
620 // =======================================================================
621 // Value - Object Values
622 // =======================================================================
623
624 #define OBJV_F_SHIELDS 0
625 #define OBJV_I_TYPE 1
626 #define OBJV_US_ID 2
627 #define OBJV_V_POS 3
628 #define OBJV_M_ORIENT 4
629 #define OBJV_I_ROOMNUM 5
630 #define OBJV_V_VELOCITY 6
631 #define OBJV_V_ROTVELOCITY 7
632 #define OBJV_V_THRUST 8
633 #define OBJV_V_ROTTHRUST 9
634 #define OBJV_I_FLAGS 10
635 #define OBJV_F_SIZE 11
636 #define OBJV_C_CONTROL_TYPE 12
637 #define OBJV_C_MOVEMENT_TYPE 13
638 #define OBJV_F_CREATION_TIME 14
639 #define OBJV_F_ROTDRAG 15
640 #define OBJV_I_PHYSICS_FLAGS 16
641 #define OBJV_I_PARENT_HANDLE 17
642 #define OBJV_F_ANIM_FRAME 18
643 #define OBJV_F_MAX_SHIELDS 19
644 #define OBJV_PC_MARKER_MESSAGE 20
645 #define OBJSV_F_ANIM_START 21
646 #define OBJSV_F_ANIM_END 22
647 #define OBJSV_F_ANIM_TIME 23
648 #define OBJV_S_NAME 24 // object's name
649 #define OBJV_C_VIRUS_INFECTED 25 // the object show signs of virus infection
650 #define OBJV_C_NEGATIVE_LIGHT 26 // the object casts negative light (black hole)
651 #define OBJV_C_IS_CLOAKED 27 // is object cloaked?
652 #define OBJV_PI_HACK_FVI_IGNORE_LIST 28
653
654 // =======================================================================
655 // Value - Object Weapon Battery Values
656 // =======================================================================
657
658 #define WBV_F_ANIM_FRAME 0
659 #define WBV_F_LAST_FIRE_TIME 1
660 #define WBV_I_DYNAMIC_FLAGS 2
661
662 // WBSV values use the index parameter of Obj_WBValue() for the gun point index
663 #define WBV_C_NUM_GUNPTS 3
664 #define WBSV_US_GUNPT_WEAPON_ID 4
665 #define WBSV_V_GUNPT_POS 5
666
667 // WBSV values use the index parameter of Obj_WBValue() for the firing mask index
668 #define WBV_C_NUM_MASKS 6
669 #define WBSV_C_MASK 7
670 #define WBSV_I_FIRE_SOUND 8
671 #define WBSV_F_LATENCY 9
672 #define WBSV_F_ANIM_TIME 10
673 #define WBSV_F_ANIM_START 11
674 #define WBSV_F_ANIM_FIRE 12
675 #define WBSV_F_ANIM_END 13
676
677 #define WBV_C_NUM_WBS 14
678
679 // =======================================================================
680 // Value - Room Values
681 // =======================================================================
682
683 #define RMV_I_FLAGS 0
684 #define RMV_V_WIND 1
685 #define RMV_C_USED 2
686
687 #define RMV_I_NUM_PATH_PNTS 3
688 #define RMSV_V_PATH_PNT 4
689
690 #define RMV_I_NUM_FACES 5
691 #define RMSV_I_FACE_TEXTURE_ID 6
692 #define RMSV_I_FACE_FLAGS 7
693 #define RMSV_V_FACE_NORMAL 8
694 #define RMSV_V_FACE_CENTER_PNT 14 // I didn't want to reorder the other ones as it is late in the build process
695
696 #define RMV_I_NUM_PORTALS 9
697 #define RMSV_V_PORTAL_PATH_PNT 10
698 #define RMSV_I_PORTAL_CONNECT_ROOM 11
699 #define RMSV_I_PORTAL_CONNECT_PORTAL 12
700 #define RMSV_I_PORTAL_FACE 13
701 #define RMSV_I_PORTAL_FLAGS 15
702
703 #define RMV_F_DAMAGE 16
704
705 // =======================================================================
706 // Value - Level Goal Values
707 // =======================================================================
708
709 #define LGV_I_STATUS 0
710
711 #define LGV_I_NUM_ACTIVE_PRIMARIES 1
712 #define LGSV_I_ACTIVE_PRIMARY_GOAL 2
713
714 #define LGV_I_NUM_ACTIVE_SECONDARIES 3
715 #define LGSV_I_ACTIVE_SECONDARY_GOAL 4
716
717 #define LGV_I_NUM_GOALS 5
718 #define LGSV_PC_GOAL_NAME 6
719 #define LGSV_PC_LOCATION_NAME 7
720 #define LGSV_PC_DESCRIPTION 8
721 #define LGSV_PC_COMPLETION_MESSAGE 9
722 #define LGSV_I_PRIORITY 10
723 #define LGSV_C_GOAL_LIST 11
724 #define LGSV_I_STATUS 12
725
726 #define LGSV_I_NUM_ITEMS 13
727 #define LGSSV_C_ITEM_TYPE 14
728 #define LGSSV_I_ITEM_HANDLE 15
729 #define LGSSV_B_ITEM_DONE 16
730
731 // =======================================================================
732 // Value - Matcen Values
733 // =======================================================================
734
735 #define MTNV_C_ATTACH_TYPE 0
736 #define MTNV_C_CONTROL_TYPE 1
737 #define MTNV_I_ATTACH 2
738 #define MTNV_V_CREATE_POINT 3
739 #define MTNV_I_CREATE_ROOM 4
740 #define MTNV_PC_NAME 5
741 #define MTNV_I_MAX_PROD 6
742 #define MTNV_F_PROD_MULTIPLIER 7
743 #define MTNV_I_STATUS 8
744 #define MTNV_C_CREATION_EFFECT 9
745 #define MTNV_I_MAX_ALIVE_CHILDREN 10
746 #define MTNV_F_PRE_PROD_TIME 11
747 #define MTNV_F_POST_PROD_TIME 12
748 #define MTNV_S_CREATION_TEXTURE 13
749
750 #define MTNSV_I_SOUND 14
751
752 #define MTNV_C_NUM_SPAWN_PTS 15
753 #define MTNSV_I_SPAWN_POINT 16
754
755 #define MTNV_C_NUM_PROD_TYPES 17
756 #define MTNSV_I_PROD_ITEM_ID 18
757 #define MTNSV_I_PROD_ITEM_PRIORITY 19
758 #define MTNSV_F_PROD_ITEM_TIME 20
759 #define MTNSV_I_PROD_ITEM_MAX_PROD 21
760
761 // =======================================================================
762 // inventory add flags
763 // =======================================================================
764 #define INVAF_NOTSPEWABLE 0x0001
765 #define INVAF_TIMEOUTONSPEW 0x0002
766 #define INVAF_LEVELLAST 0x0004
767
768 // =======================================================================
769 // thief stealable items (see PLYV_ actions)
770 // =======================================================================
771 #define THIEFITEM_AUTOMAP 1
772 #define THIEFITEM_HEADLIGHT 2
773 #define THIEFITEM_ETOSCONV 3
774 #define THIEFITEM_CLOAK 4
775 #define THIEFITEM_INVULN 5
776 #define THIEFITEM_RAPIDFIRE 6
777 #define THIEFITEM_QUADFIRE 7
778 #define THIEFITEM_MAXCOUNT 8
779
780 // =======================================================================
781 // Multiplayer safe function type defines
782 // =======================================================================
783
784 #define MSAFE_ROOM_TEXTURE MSAFE_ROOM + 0
785 #define MSAFE_ROOM_WIND MSAFE_ROOM + 1
786 #define MSAFE_ROOM_FOG MSAFE_ROOM + 2
787 #define MSAFE_ROOM_LIGHT_PULSE MSAFE_ROOM + 3
788 #define MSAFE_ROOM_PORTAL_RENDER MSAFE_ROOM + 4
789 #define MSAFE_ROOM_FOG_STATE MSAFE_ROOM + 5
790 #define MSAFE_ROOM_CHANGING_FOG MSAFE_ROOM + 6
791 #define MSAFE_ROOM_CHANGING_WIND MSAFE_ROOM + 7
792 #define MSAFE_ROOM_DAMAGE MSAFE_ROOM + 8
793 #define MSAFE_ROOM_LIGHT_FLICKER MSAFE_ROOM + 9
794 #define MSAFE_ROOM_LIGHT_STROBE MSAFE_ROOM + 10
795 #define MSAFE_ROOM_REFUEL MSAFE_ROOM + 11
796 #define MSAFE_ROOM_HAS_PLAYER MSAFE_ROOM + 12
797 #define MSAFE_ROOM_BREAK_GLASS MSAFE_ROOM + 13
798 #define MSAFE_ROOM_PORTAL_BLOCK MSAFE_ROOM + 14
799 #define MSAFE_ROOM_REMOVE_ALL_POWERUPS MSAFE_ROOM + 15
800
801 #define MSAFE_OBJECT_SHIELDS MSAFE_OBJ + 0
802 #define MSAFE_OBJECT_ENERGY MSAFE_OBJ + 1
803 #define MSAFE_OBJECT_BLANK MSAFE_OBJ + 2
804 #define MSAFE_OBJECT_LIGHT_COLOR MSAFE_OBJ + 3
805 #define MSAFE_OBJECT_MOVEMENT_SCALAR MSAFE_OBJ + 4
806 #define MSAFE_OBJECT_RECHARGE_SCALAR MSAFE_OBJ + 5
807 #define MSAFE_OBJECT_WSPEED_SCALAR MSAFE_OBJ + 6
808 #define MSAFE_OBJECT_DAMAGE_SCALAR MSAFE_OBJ + 7
809 #define MSAFE_OBJECT_ARMOR_SCALAR MSAFE_OBJ + 8
810 #define MSAFE_OBJECT_DAMAGE_OBJECT MSAFE_OBJ + 9
811 #define MSAFE_OBJECT_TYPE MSAFE_OBJ + 10
812 #define MSAFE_OBJECT_ID MSAFE_OBJ + 11
813 #define MSAFE_OBJECT_ADD_WEAPON MSAFE_OBJ + 12
814 #define MSAFE_OBJECT_START_SPEW MSAFE_OBJ + 13
815 #define MSAFE_OBJECT_STOP_SPEW MSAFE_OBJ + 14
816 #define MSAFE_OBJECT_GHOST MSAFE_OBJ + 15
817 #define MSAFE_OBJECT_UNGHOST MSAFE_OBJ + 16
818 #define MSAFE_OBJECT_REMOVE MSAFE_OBJ + 17
819 #define MSAFE_OBJECT_POS MSAFE_OBJ + 18
820 #define MSAFE_OBJECT_ORIENT MSAFE_OBJ + 19
821 #define MSAFE_OBJECT_ROOMNUM MSAFE_OBJ + 20
822 #define MSAFE_OBJECT_VELOCITY MSAFE_OBJ + 21
823 #define MSAFE_OBJECT_ROTVELOCITY MSAFE_OBJ + 22
824 #define MSAFE_OBJECT_THRUST MSAFE_OBJ + 23
825 #define MSAFE_OBJECT_ROTTHRUST MSAFE_OBJ + 24
826 #define MSAFE_OBJECT_FLAGS MSAFE_OBJ + 25
827 #define MSAFE_OBJECT_SIZE MSAFE_OBJ + 26
828 #define MSAFE_OBJECT_CONTROL_TYPE MSAFE_OBJ + 27
829 #define MSAFE_OBJECT_MOVEMENT_TYPE MSAFE_OBJ + 28
830 #define MSAFE_OBJECT_CREATION_TIME MSAFE_OBJ + 29
831 #define MSAFE_OBJECT_CLOAKALLPLAYERS MSAFE_OBJ + 30
832 #define MSAFE_OBJECT_PHYSICS_FLAGS MSAFE_OBJ + 31
833 #define MSAFE_OBJECT_PARENT MSAFE_OBJ + 32
834 #define MSAFE_OBJECT_ROTDRAG MSAFE_OBJ + 33
835 #define MSAFE_OBJECT_INVULNERABLE MSAFE_OBJ + 34
836 #define MSAFE_OBJECT_CLOAK MSAFE_OBJ + 35
837 #define MSAFE_OBJECT_PLAYER_HANDLE MSAFE_OBJ + 36
838 #define MSAFE_OBJECT_PLAYER_CMASK MSAFE_OBJ + 37
839 #define MSAFE_OBJECT_NO_RENDER MSAFE_OBJ + 38
840 #define MSAFE_OBJECT_LIGHT_DIST MSAFE_OBJ + 39
841 #define MSAFE_OBJECT_DEFORM MSAFE_OBJ + 40
842 #define MSAFE_OBJECT_VIEWER_SHAKE MSAFE_OBJ + 41 // or is this player shake?
843 #define MSAFE_OBJECT_PLAYER_KEY MSAFE_OBJ + 42
844 #define MSAFE_OBJECT_PLAYER_CONTROLAI MSAFE_OBJ + 43
845 #define MSAFE_OBJECT_WORLD_POSITION MSAFE_OBJ + 44 // room+pos+orient
846 #define MSAFE_OBJECT_COUNT_TYPE MSAFE_OBJ + 45
847 #define MSAFE_OBJECT_SPARKS MSAFE_OBJ + 46
848 #define MSAFE_OBJECT_SETONFIRE \
849 MSAFE_OBJ + 47 // objhandle, longevity = how long, interval = damage per sec, ithandle = killer (or
850 // OBJECT_HANDLE_NONE)
851 #define MSAFE_OBJECT_SHAKE_AREA MSAFE_OBJ + 48
852 #define MSAFE_OBJECT_ENERGY_WEAPON MSAFE_OBJ + 49
853 #define MSAFE_OBJECT_DAMAGE_AMOUNT MSAFE_OBJ + 50
854 #define MSAFE_OBJECT_SHIELDS_ORIGINAL MSAFE_OBJ + 51
855 #define MSAFE_SHOW_ENABLED_CONTROLS MSAFE_OBJ + 52
856 #define MSAFE_OBJECT_FIRE_WEAPON MSAFE_OBJ + 53
857 #define MSAFE_OBJECT_DESTROY_ROBOTS_EXCEPT MSAFE_OBJ + 54
858
859 #define MSAFE_WEATHER_RAIN MSAFE_WEATHER + 0
860 #define MSAFE_WEATHER_SNOW MSAFE_WEATHER + 1
861 #define MSAFE_WEATHER_LIGHTNING MSAFE_WEATHER + 2
862 #define MSAFE_WEATHER_LIGHTNING_BOLT MSAFE_WEATHER + 3
863 #define MSAFE_WEATHER_LIGHTNING_BOLT_POS MSAFE_WEATHER + 4
864
865 #define MSAFE_SOUND_2D MSAFE_SOUND + 0
866 #define MSAFE_SOUND_OBJECT MSAFE_SOUND + 1
867 #define MSAFE_SOUND_STREAMING MSAFE_SOUND + 2
868 #define MSAFE_SOUND_STOP MSAFE_SOUND + 3
869 #define MSAFE_SOUND_STOP_OBJ MSAFE_SOUND + 4
870 #define MSAFE_SOUND_VOLUME_OBJ MSAFE_SOUND + 5
871
872 #define MSAFE_DOOR_LOCK_STATE MSAFE_DOOR + 0
873 #define MSAFE_DOOR_ACTIVATE MSAFE_DOOR + 1
874 #define MSAFE_DOOR_POSITION MSAFE_DOOR + 2
875 #define MSAFE_DOOR_STOP MSAFE_DOOR + 3
876 #define MSAFE_DOOR_OPENABLE MSAFE_DOOR + 4
877
878 #define MSAFE_TRIGGER_SET MSAFE_TRIGGER + 0
879
880 #define MSAFE_MISC_HUD_MESSAGE MSAFE_MISC + 0
881 #define MSAFE_MISC_WAYPOINT MSAFE_MISC + 1
882 #define MSAFE_MISC_END_LEVEL MSAFE_MISC + 2
883 #define MSAFE_MISC_POPUP_CAMERA MSAFE_MISC + 3
884 #define MSAFE_MISC_CLOSE_POPUP MSAFE_MISC + 4
885 #define MSAFE_MISC_GAME_MESSAGE MSAFE_MISC + 5
886 #define MSAFE_MUSIC_REGION MSAFE_MISC + 6
887 #define MSAFE_MISC_ENABLE_SHIP MSAFE_MISC + 7
888 #define MSAFE_MISC_LEVELGOAL MSAFE_MISC + 8
889 #define MSAFE_MISC_GUIDEBOT_NAME MSAFE_MISC + 9
890 #define MSAFE_MISC_FILTERED_HUD_MESSAGE MSAFE_MISC + 10
891 #define MSAFE_MISC_START_TIMER MSAFE_MISC + 11
892 #define MSAFE_MISC_ADD_HUD_ITEM MSAFE_MISC + 12
893 #define MSAFE_MISC_UPDATE_HUD_ITEM MSAFE_MISC + 13
894
895 #define MSAFE_INVEN_ADD_TYPE_ID MSAFE_INVEN + 0
896 #define MSAFE_INVEN_CHECK MSAFE_INVEN + 1
897 #define MSAFE_INVEN_COUNT MSAFE_INVEN + 2
898 #define MSAFE_INVEN_REMOVE MSAFE_INVEN + 3
899 #define MSAFE_INVEN_SIZE MSAFE_INVEN + 4
900 #define MSAFE_INVEN_GET_TYPE_ID MSAFE_INVEN + 5
901 #define MSAFE_INVEN_ADD_OBJECT MSAFE_INVEN + 6
902 #define MSAFE_INVEN_CHECK_OBJECT MSAFE_INVEN + 7
903 #define MSAFE_INVEN_REMOVE_OBJECT MSAFE_INVEN + 8
904
905 #define MSAFE_COUNTERMEASURE_ADD MSAFE_COUNTERMEASURE + 0
906 #define MSAFE_COUNTERMEASURE_COUNT MSAFE_COUNTERMEASURE + 1
907 #define MSAFE_COUNTERMEASURE_CHECK MSAFE_COUNTERMEASURE + 2
908 #define MSAFE_COUNTERMEASURE_REMOVE MSAFE_COUNTERMEASURE + 3
909 #define MSAFE_COUNTERMEASURE_SIZE MSAFE_COUNTERMEASURE + 4
910 #define MSAFE_COUNTERMEASURE_GET MSAFE_COUNTERMEASURE + 5
911
912 #define MSAFE_WEAPON_CHECK MSAFE_WEAPON + 0
913 #define MSAFE_WEAPON_ADD MSAFE_WEAPON + 1
914
915 // =======================================================================
916 // Structures shared between OSIRIS and the game
917 // =======================================================================
918
919 // Since this header is shared within D3, in order to keep redefinition errors
920 // quiet, the following section will only be included if this header file
921 // is included by a DLL
922 #ifndef INCLUDED_FROM_D3
923
924 // Use this handle when you want a handle that will never be a valid object
925 #ifndef INCLUDED_FROM_PLAYER_H
926 #define MAX_PLAYERS 32
927 #endif
928
929 // define unsigned types;
930 typedef uint8_t uint8_t;
931 typedef int8_t int8_t;
932 typedef uint16_t uint16_t;
933 typedef uint32_t uint32_t;
934 typedef uint32_t ddgr_color;
935
936 #ifndef NULL
937 #define NULL 0
938 #endif
939
940 inline ddgr_color GR_RGB(int r, int g, int b) { return ((r << 16) + (g << 8) + b); }
941
942 #endif // end #ifndef INCLUDED_FROM_D3
943
944 // =======================================================================
945 // GB Menu structure
946 // =======================================================================
947
948 #define MAX_GB_COMMANDS 60
949
950 #define GBCT_EXIT_IMMEDIATELY 0
951 #define GBCT_STRING_DIALOG 1
952
953 #define COM_GET_MENU 0
954 #define COM_DO_ACTION 1
955 #define COM_REINIT 2
956
957 struct gb_com {
958 char action;
959 char index;
960 void *ptr;
961 };
962
963 struct gb_menu {
964 char title[256];
965 int num_commands;
966 char command_text[MAX_GB_COMMANDS][256];
967 char command_id[MAX_GB_COMMANDS];
968 char command_type[MAX_GB_COMMANDS];
969
970 char dialog_text[MAX_GB_COMMANDS][256];
971 };
972
973 // =======================================================================
974 // Osiris structures
975 // =======================================================================
976
977 struct tOSIRISModuleInit {
978 int *fp[MAX_MODULEFUNCS];
979 char **string_table;
980 int string_count;
981 int module_identifier;
982
983 bool module_is_static; // if this is set to true after initialization
984 // then the module will not unload if it's reference
985 // count is 0....only when the level ends.
986 // this is for Game modules ONLY.
987
988 char *script_identifier; // Contains a unique script identifier (string), which
989 // can be used for the OMMS system. While this pointer
990 // will always be valid during the lifetime of the module
991 // DO NOT ALTER THE STRING IT POINTS TO.
992
993 uint32_t game_checksum; // Checksum of game structures, if this doesn't match
994 // the checksum at compile time, it is very likely that
995 // bad things can happen, and this module shouldn't initialize.
996
997 }; // contains the necessary data to initialize
998
999 // an OSIRIS module
1000 struct tOSIRISEVTINTERVAL {
1001 float frame_time;
1002 float game_time;
1003 }; // struct for EVT_INTERVAL data
1004
1005 struct tOSIRISIEVTAIFRAME {
1006 }; // struct for EVT_AI_FRAME data
1007
1008 struct tOSIRISEVTDAMAGED {
1009 float damage;
1010 int it_handle;
1011 int weapon_handle;
1012 int damage_type;
1013 }; // struct for EVT_DAMAGED data
1014
1015 struct tOSIRISEVTCOLLIDE {
1016 int it_handle;
1017 }; // struct for EVT_COLLIDE data
1018
1019 struct tOSIRISEVTCREATED {
1020 }; // struct for EVT_CREATED data
1021
1022 struct tOSIRISEVTDESTROY {
1023 uint8_t is_dying; // if this is !=0 than the event is coming because it is
1024 // really being destroyed. Else it is due to the level ending.
1025 }; // struct for EVT_DESTROY data
1026
1027 struct tOSIRISEVTTIMER {
1028 int id;
1029 float game_time;
1030 }; // struct for EVT_TIMER data
1031
1032 struct tOSIRISEVTUSE {
1033 int it_handle;
1034 }; // struct for EVT_USE data
1035
1036 struct tOSIRISEVTSAVESTATE {
1037 void *fileptr;
1038 }; // struct for EVT_SAVESTATE data
1039
1040 struct tOSIRISEVTRESTORESTATE {
1041 void *fileptr;
1042 }; // struct for EVT_RESTORESTATE data
1043
1044 struct tOSIRISEVTAINOTIFY {
1045 int notify_type;
1046 int it_handle;
1047 int goal_num;
1048 int goal_uid;
1049 union {
1050 int enabler_num;
1051 int attack_num;
1052 };
1053 }; // struct for EVT_AI_NOTIFY data
1054
1055 struct tOSIRISEVTAIINIT {
1056 }; // struct for EVT_AI_INIT data
1057
1058 struct tOSIRISEVTLEVELSTART {
1059 }; // struct for EVT_LEVELSTART data
1060
1061 struct tOSIRISEVTLEVELEND {
1062 }; // struct for EVT_LEVELEND data
1063
1064 struct tOSIRISEVTCHANGESEG {
1065 int room_num;
1066 }; // struct for EVT_CHANGESEG data
1067
1068 struct tOSIRISEVTMEMRESTORE {
1069 int id;
1070 void *memory_ptr;
1071 }; // struct for EVT_MEMRESTORE data
1072
1073 struct tOSIRISEVTTIMERCANCEL {
1074 int handle;
1075 uint8_t detonated;
1076 }; // struct for EVT_TIMERCANCEL data
1077
1078 struct tOSIRISEVTCHILDDIED {
1079 int it_handle;
1080 };
1081
1082 struct tOSIRISEVTMATCENCREATE {
1083 int it_handle;
1084 int id;
1085 }; // struct for EVT_MATCEN_CREATE data
1086
1087 struct tOSIRISEVTDOORACTIVATE {
1088 }; // struct for EVT_DOOR_ACTIVATE data
1089
1090 struct tOSIRISEVTDOORCLOSE {
1091 }; // struct for EVT_DOOR_CLOSE data
1092
1093 struct tOSIRISEVTLEVELGOALCOMPLETE {
1094 int level_goal_index;
1095 };
1096
1097 struct tOSIRISEVTLEVELGOALITEMCOMPLETE {
1098 int level_goal_index;
1099 };
1100
1101 struct tOSIRISEVTALLLEVELGOALSCOMPLETE {
1102 };
1103
1104 struct tOSIRISEVTPLAYERMOVIESTART {
1105 };
1106
1107 struct tOSIRISEVTPLAYERMOVIEEND {
1108 };
1109
1110 struct tOSIRISEVTPLAYERRESPAWN {
1111 int it_handle; // player respawning
1112 };
1113
1114 struct tOSIRISEVTPLAYERDIES {
1115 int it_handle; // player dead
1116 };
1117
1118 struct tOSIRISEventInfo {
1119 union {
1120 tOSIRISEVTINTERVAL evt_interval;
1121 tOSIRISIEVTAIFRAME evt_ai_frame;
1122 tOSIRISEVTDAMAGED evt_damaged;
1123 tOSIRISEVTCOLLIDE evt_collide;
1124 tOSIRISEVTCREATED evt_created;
1125 tOSIRISEVTDESTROY evt_destroy;
1126 tOSIRISEVTTIMER evt_timer;
1127 tOSIRISEVTUSE evt_use;
1128 tOSIRISEVTAINOTIFY evt_ai_notify;
1129 tOSIRISEVTAINOTIFY evt_ain_objkilled;
1130 tOSIRISEVTAINOTIFY evt_ain_seeplayer;
1131 tOSIRISEVTAINOTIFY evt_ain_whitobject;
1132 tOSIRISEVTAINOTIFY evt_ain_goalcomplete;
1133 tOSIRISEVTAINOTIFY evt_ain_goalinvalid;
1134 tOSIRISEVTAINOTIFY evt_ain_goalfail;
1135 tOSIRISEVTAINOTIFY evt_ain_goalerror;
1136 tOSIRISEVTAINOTIFY evt_ain_goalforcedone;
1137 tOSIRISEVTAINOTIFY evt_ain_melee_hit;
1138 tOSIRISEVTAINOTIFY evt_ain_melee_attack_frame;
1139 tOSIRISEVTAINOTIFY evt_ain_movie_start;
1140 tOSIRISEVTAINOTIFY evt_ain_movie_end;
1141 tOSIRISEVTAIINIT evt_ai_init;
1142 tOSIRISEVTLEVELSTART evt_levelstart;
1143 tOSIRISEVTLEVELEND evt_levelend;
1144 tOSIRISEVTCHANGESEG evt_changeseg;
1145 tOSIRISEVTSAVESTATE evt_savestate;
1146 tOSIRISEVTRESTORESTATE evt_restorestate;
1147 tOSIRISEVTMEMRESTORE evt_memrestore;
1148 tOSIRISEVTTIMERCANCEL evt_timercancel;
1149 tOSIRISEVTMATCENCREATE evt_matcen_create;
1150 tOSIRISEVTDOORACTIVATE evt_door_activate;
1151 tOSIRISEVTDOORCLOSE evt_door_close;
1152 tOSIRISEVTCHILDDIED evt_child_died;
1153 tOSIRISEVTLEVELGOALCOMPLETE evt_level_goal_complete;
1154 tOSIRISEVTALLLEVELGOALSCOMPLETE evt_all_level_goals_complete;
1155 tOSIRISEVTLEVELGOALITEMCOMPLETE evt_level_goal_item_complete;
1156 tOSIRISEVTPLAYERMOVIESTART evt_player_movie_start;
1157 tOSIRISEVTPLAYERMOVIEEND evt_player_movie_end;
1158 tOSIRISEVTPLAYERRESPAWN evt_player_respawn;
1159 tOSIRISEVTPLAYERDIES evt_player_dies;
1160 };
1161
1162 int me_handle;
1163 void *extra_info;
1164 }; // contains the necessary data for all events
1165 // to pass what they need to their event handlers.
1166
1167 #define OTF_REPEATER 0x0001 // this timer is to repeat repeat_count times
1168 #define OTF_TRIGGER 0x0002 // this timer is for a trigger, use trigger_number
1169 #define OTF_LEVEL 0x0004 // this timer is for the level
1170 #define OTF_CANCELONDEAD \
1171 0x008 // this timer should be auto-cancelled if object_handle_detonator dies, than the
1172 // timer auto-cancels
1173 struct tOSIRISTIMER {
1174 uint16_t flags;
1175 int id; // an optional id you can use to store, will be passed back on EVT_TIMER signal
1176 int repeat_count; // if OTF_REPEATER is set, this is how many times to repeat the signal (every
1177 // interval). -1 for infinite.
1178 union {
1179 int object_handle; // handle to the object to recieve the EVT_TIMER signal
1180 int trigger_number; // trigger number to recieve the EVT_TIMER signal (OTF_TRIGGER)
1181 };
1182
1183 int object_handle_detonator; // if OTF_CANCELONDEAD is specified, this is the object handle to
1184 // use for checking, if this object dies, than auto-cancel the timer
1185
1186 float timer_interval; // the timeframe in between EVT_TIMER signals (for non-repeaters, this is how
1187 // long until the single EVT_TIMER gets signaled).
1188 };
1189
1190 enum script_type { OBJECT_SCRIPT = 0, TRIGGER_SCRIPT, LEVEL_SCRIPT };
1191
1192 struct tOSIRISSCRIPTID {
1193 script_type type;
1194 union {
1195 int objhandle;
1196 int triggernum;
1197 };
1198 };
1199
1200 struct tOSIRISMEMCHUNK {
1201 tOSIRISSCRIPTID my_id;
1202 uint16_t id;
1203 int size;
1204 };
1205
1206 // =======================================================================
1207 // Multiplayer safe function structs
1208 // =======================================================================
1209
1210 #define KOI_ID 0 // this item is specifying a type/id of object NOT to kill
1211 #define KOI_HANDLE 1 // this item is specifying an object handle of an object NOT to kill
1212 struct tKillObjectItem {
1213 uint8_t info_type;
1214 int id;
1215 int objhandle;
1216 };
1217
1218 #define MSAFE_MESSAGE_LENGTH 255
1219 #define MSAFE_NAME_LENGTH 32
1220 struct msafe_struct {
1221 // Rooms
1222 int roomnum;
1223 int16_t facenum;
1224 int16_t texnum;
1225 int16_t portalnum;
1226 float fog_r, fog_g, fog_b, fog_depth;
1227 vector wind;
1228 uint8_t pulse_time;
1229 uint8_t pulse_offset;
1230
1231 // Objects/Players
1232 uint32_t objhandle;
1233 uint32_t ithandle;
1234 float shields, energy;
1235 int16_t start_tick;
1236 int16_t end_tick;
1237 float cycle_time;
1238 int type, id, aux_type, aux_id;
1239 uint32_t checksum;
1240 int path_id;
1241 float amount;
1242 uint8_t damage_type;
1243 uint32_t killer_handle;
1244 float ammo;
1245 uint8_t playsound;
1246 uint8_t remove;
1247 uint8_t do_powerup;
1248 vector velocity;
1249 vector rot_velocity;
1250 float rot_drag;
1251 vector thrust;
1252 vector rot_thrust;
1253 char control_type;
1254 char movement_type;
1255 float creation_time;
1256 int physics_flags;
1257 vector pos;
1258 matrix orient;
1259 float anim_frame;
1260
1261 // Spew
1262 uint8_t is_real;
1263 uint8_t random;
1264 uint8_t unused2; // was use_gunpoint
1265 int8_t gunpoint;
1266 uint8_t effect_type;
1267 uint8_t phys_info;
1268 float drag, mass;
1269
1270 // Unused
1271 uint16_t unused; // was doorway_index
1272
1273 // Weather
1274 int randval;
1275
1276 // Triggers
1277 uint8_t trigger_num;
1278
1279 // sounds
1280 int sound_handle;
1281 float volume;
1282
1283 // Shared/misc
1284 int index;
1285 float scalar;
1286 float interval;
1287 uint8_t state;
1288 int8_t slot;
1289 char message[MSAFE_MESSAGE_LENGTH];
1290 char name[MSAFE_NAME_LENGTH];
1291 int color;
1292 float longevity;
1293 float lifetime;
1294 float size;
1295 float speed;
1296 int count;
1297 int flags;
1298 void *list;
1299 uint32_t control_mask;
1300 uint8_t control_val;
1301
1302 // Object lighting stuff
1303 float light_distance;
1304 float r1, g1, b1; // light 1 color
1305 float r2, g2, b2; // light 2 color
1306 float time_interval;
1307 float flicker_distance;
1308 float directional_dot;
1309 int timebits;
1310
1311 vector pos2;
1312
1313 // Second message
1314 char message2[MSAFE_MESSAGE_LENGTH];
1315
1316 };
1317
1318 struct ray_info {
1319 int fate;
1320 int hit_room;
1321 vector hit_point;
1322
1323 int hit_object;
1324 int hit_subobject;
1325
1326 int hit_face;
1327 vector hit_face_pnt;
1328 int hit_face_room;
1329 vector hit_wallnorm;
1330 };
1331
1332 #define PV_POS 0x00000001 // set/get pos member (pass in an osiris_path_node_info ptr)
1333 #define PV_ROOMNUM 0x00000002 // set/get roomnum member (pass in an osiris_path_node_info ptr)
1334 #define PV_FLAGS 0x00000004 // set/get flags member (pass in an osiris_path_node_info ptr)
1335 #define PV_FVEC 0x00000008 // set/get fvec member (pass in an osiris_path_node_info ptr)
1336 #define PV_UVEC 0x00000010 // set/get uvec member (pass in an osiris_path_node_info ptr)
1337 #define PV_ALL 0x0000001F // set/get all members (above..pass in an osiris_path_node_info ptr)
1338 #define PV_I_NUMNODES 0x00010000 // get number of nodes in this path
1339 #define PV_CS_NAME 0x00020000 // get name of path
1340 #define PV_I_NUMPATHS 0x00040000 // get number of paths (path_id & node_id are ignored in this case)
1341
1342 struct osiris_path_node_info {
1343 vector pos; // where this node is in the world
1344 int roomnum; // what room?
1345 int flags; // if this point lives over the terrain, etc
1346 vector fvec;
1347 vector uvec;
1348 };
1349
1350 #endif