Debian Codegraph @

scripts/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 <cstdint>
338
339 #include "vecmat_external.h"
340 #include "aistruct_external.h"
341 #include "object_external.h"
342 #include "matcen_external.h"
343 #include "robotfirestruct_external.h"
344 #include "findintersection_external.h"
345 #include "weapon_external.h"
346 #include "damage_external.h"
347 #include "fireball_external.h"
348 #include "levelgoal_external.h"
349 #include "deathinfo_external.h"
350 #include "difficulty_external.h"
351 #include "gamecinematics_external.h"
352 #include "player_external.h"
353
354 // =======================================================================
355 // Event return values (OR these if needed)
356 // =======================================================================
357 #define CONTINUE_CHAIN 0x0100 // continue executing the chain of scripts
358 #define CONTINUE_DEFAULT 0x0001 // continue executing the 'in-code' action
359
360 // =======================================================================
361 // Events that OSIRIS handles
362 // =======================================================================
363 #define EVT_INTERVAL 0x100 // called every frame
364 #define EVT_AI_FRAME 0x101 // called every frame for AI info
365 #define EVT_DAMAGED 0x102 // called when object is damaged
366 #define EVT_COLLIDE 0x103 // called when object collides with something
367 #define EVT_CREATED 0x104 // called when object created
368 #define EVT_DESTROY 0x105 // called when object destroyed
369 #define EVT_TIMER 0x106 // called when a timer event is signalled
370 #define EVT_USE 0x107 // called when item is selected for use from inventory
371 #define EVT_AI_NOTIFY 0x110 // called when an AI gets notified
372 #define EVT_AI_INIT 0x111 // called to initialize SCRIPT AI stuff
373 #define EVT_LEVELSTART EVT_CREATED //
374 #define EVT_LEVELEND EVT_DESTROY // called when level is started and ended.
375 #define EVT_CHANGESEG 0x115 // called when object changes room
376 #define EVT_SAVESTATE 0x117 // called when the script should save it's state
377 #define EVT_RESTORESTATE 0x118 // called when the script should restore it's state
378 #define EVT_MEMRESTORE \
379 0x119 // called when the script should restore a pointer to the special auto-save memory it allocated
380 #define EVT_TIMERCANCEL 0x11A // called when a timer is cancels (either by function call or from it's object detonator)
381 #define EVT_AIN_OBJKILLED 0x11B // child event of EVT_AI_NOTIFY
382 #define EVT_AIN_SEEPLAYER 0x11C // child event of EVT_AI_NOTIFY
383 #define EVT_AIN_WHITOBJECT 0x11D // child event of EVT_AI_NOTIFY
384 #define EVT_AIN_GOALCOMPLETE 0x11E // child event of EVT_AI_NOTIFY
385 #define EVT_AIN_GOALFAIL 0x11F // child event of EVT_AI_NOTIFY
386 #define EVT_AIN_MELEE_HIT 0x120 // child event of EVT_AI_NOTIFY
387 #define EVT_AIN_MELEE_ATTACK_FRAME 0x121 // child event of EVT_AI_NOTIFY
388 #define EVT_AIN_MOVIE_START 0x122 // child event of EVT_AI_NOTIFY
389 #define EVT_AIN_MOVIE_END 0x123 // child event of EVT_AI_NOTIFY
390 #define EVT_MATCEN_CREATE 0x124 // level event that a matcen created an object
391 #define EVT_DOOR_ACTIVATE 0x125 // event to when a door is opening
392 #define EVT_DOOR_CLOSE 0x126 // event to when a door is closing
393 #define EVT_CHILD_DIED 0x127
394 #define EVT_LEVEL_GOAL_COMPLETE 0x128
395 #define EVT_ALL_LEVEL_GOALS_COMPLETE 0x129
396 #define EVT_LEVEL_GOAL_ITEM_COMPLETE 0x12A
397 #define EVT_PLAYER_MOVIE_START 0x12B // event when a IGC focusing on the player starts
398 #define EVT_PLAYER_MOVIE_END 0x12C // event when a IGC focusing on the player ends
399 #define EVT_PLAYER_RESPAWN 0x12D // event when a player respawns
400 #define EVT_PLAYER_DIES 0x12E // event when a player dies
401
402 // =======================================================================
403 // General defines
404 // =======================================================================
405 #define MAX_MODULEFUNCS 256 // maximum number of functions imported to OSIRIS
406
407 typedef int OMMSHANDLE;
408
409 // =======================================================================
410 // Language defines
411 // =======================================================================
412 #define LANGUAGE_ENGLISH 0
413 #define LANGUAGE_GERMAN 1
414 #define LANGUAGE_SPANISH 2
415 #define LANGUAGE_ITALIAN 3
416 #define LANGUAGE_FRENCH 4
417 #define LANGUAGE_POLISH 5
418
419 // Player Accessories indices (for Player_Value function)
420 #define ACCESSORY_CLOAK 0
421 #define ACCESSORY_INVULNERABILITY 1
422 #define ACCESSORY_AFTERBURNER 2
423 #define ACCESSORY_HEADLIGHT 3
424 #define ACCESSORY_QUAD 4
425 #define ACCESSORY_RAPID_FIRE 5
426 #define ACCESSORY_MAP 6
427
428 #define MSAFE_ROOM 0
429 #define MSAFE_OBJ 20
430 #define MSAFE_WEATHER 100
431 #define MSAFE_SOUND 110
432 #define MSAFE_MATCEN 130
433 #define MSAFE_MISC 150
434 #define MSAFE_DOOR 170
435 #define MSAFE_MISSION 180
436 #define MSAFE_TRIGGER 190
437 #define MSAFE_INVEN 200
438 #define MSAFE_COUNTERMEASURE 210
439 #define MSAFE_WEAPON 250
440
441 #define SPEW_RAND_SPEED 2
442 #define SPEW_RAND_SIZE 4
443 #define SPEW_RAND_LIFETIME 16
444
445 // =======================================================================
446 // Value Functions
447 // =======================================================================
448
449 #define VF_SET 0
450 #define VF_GET 1
451 #define VF_SET_FLAGS 2
452 #define VF_CLEAR_FLAGS 3
453
454 // =======================================================================
455 // Value - Player only values
456 // =======================================================================
457
458 #define PLYV_F_ENERGY 0
459 #define PLYV_F_MOVEMENT_SCALAR 1
460 #define PLYV_F_RECHARGE_SCALAR 2
461 #define PLYV_F_WSPEED_SCALAR 3
462 #define PLYV_F_DAMAGE_SCALAR 4
463 #define PLYV_F_ARMOR_SCALAR 5
464 #define PLYV_I_BUDDY_HANDLE 6
465
466 // These work off the weapon index
467 #define PLYSV_I_WEAPON 7
468 #define PLYSV_I_WEAPON_AMMO 8
469 #define PLYSV_US_WEAPON_POWERUP_ID 9
470
471 // These work off the accessory index
472 #define PLYSV_F_ACCESSORY 10
473
474 // This is for setting and getting the guidebot name
475 #define PLYV_CS_GUIDEBOTNAME 11
476
477 // this is for thief access
478 #define PLYV_B_THIEF_PLAYERHASITEM 12 // VF_GET only (takes a bool for ptr, int for index..which item..see THIEFITEM_)
479 #define PLYV_I_THIEF_STEALPLAYERITEM 13 // VF_SET only (takes an int for index, ptr is ignored)
480
481 #define PLYV_I_FLAGS 14 // Player flags
482 #define PLYV_I_STRIP_WEAPONS 15 // VF_SET only (removes all weapons but lasers, sets energy to 0)
483
484 // These are used to mask out various controls, put in initially for the training system
485 #define PLYV_CMASK_FORWARD 1
486 #define PLYV_CMASK_REVERSE 2
487 #define PLYV_CMASK_LEFT 4
488 #define PLYV_CMASK_RIGHT 8
489 #define PLYV_CMASK_UP 16
490 #define PLYV_CMASK_DOWN 32
491 #define PLYV_CMASK_PITCHUP 64
492 #define PLYV_CMASK_PITCHDOWN 128
493 #define PLYV_CMASK_HEADINGLEFT 256
494 #define PLYV_CMASK_HEADINGRIGHT 512
495 #define PLYV_CMASK_BANKLEFT 1024
496 #define PLYV_CMASK_BANKRIGHT 2048
497 #define PLYV_CMASK_PRIMARY 4096
498 #define PLYV_CMASK_SECONDARY 8192
499 #define PLYV_CMASK_AFTERBURNER 16384
500
501 // =======================================================================
502 // Value - AI Values
503 // =======================================================================
504
505 #define AIV_F_MAX_SPEED 0
506 #define AIV_F_MAX_DELTA_SPEED 1
507 #define AIV_F_MAX_TURN_RATE 2
508 #define AIV_F_MAX_DELTA_TURN_RATE 3
509 #define AIV_F_ATTACK_VEL_PERCENT 4
510 #define AIV_F_FLEE_VEL_PERCENT 5
511 #define AIV_F_DODGE_VEL_PERCENT 6
512 #define AIV_F_CIRCLE_DIST 7
513 #define AIV_F_DODGE_PERCENT 8
514 #define AIV_F_MELEE_DAMAGE1 9
515 #define AIV_F_MELEE_DAMAGE2 10
516 #define AIV_F_MELEE_LATENCY1 11
517 #define AIV_F_MELEE_LATENCY2 12
518 #define AIV_C_MOVEMENT_TYPE 13
519 #define AIV_C_MOVEMENT_SUBTYPE 14
520 #define AIV_C_ANIMATION_TYPE 15
521 #define AIV_C_NEXT_ANIMATION_TYPE 16
522 #define AIV_C_NEXT_MOVEMENT 17
523 #define AIV_C_CURRENT_WB_FIRING 18
524 #define AIV_I_TARGET_HANDLE 19
525 #define AIV_F_NEXT_TARGET_UPDATE_TIME 20
526 #define AIV_F_DIST_TO_TARGET 21
527 #define AIV_V_VEC_TO_TARGET 22
528 #define AIV_F_NEXT_CHECK_SEE_TARGET_TIME 23
529 #define AIV_V_LAST_SEE_TARGET_POS 24
530 #define AIV_F_LAST_SEE_TARGET_TIME 25
531 #define AIV_F_WEAPON_SPEED 26
532 #define AIV_F_NEXT_MELEE_TIME 27
533 #define AIV_F_LAST_RENDER_TIME 28
534 #define AIV_F_NEXT_FLINCH_TIME 29
535 #define AIV_V_MOVEMENT_DIR 30
536 #define AIV_V_ROT_THRUST_VECTOR 31
537 #define AIV_F_FOV 32
538 #define AIV_F_AVOID_FRIENDS_DIST 33
539 #define AIV_F_FRUSTRATION 34
540 #define AIV_F_CURIOUSITY 35
541 #define AIV_F_FIRE_SPREAD 36
542 #define AIV_F_AGRESSION 37
543 #define AIV_F_NIGHT_VISION 38
544 #define AIV_F_FOG_VISION 39
545 #define AIV_F_LEAD_ACCURACY 40
546 #define AIV_F_LEAD_VARIENCE 41
547 #define AIV_F_FIGHT_TEAM 42
548 #define AIV_F_FIGHT_SAME 43
549 #define AIV_F_HEARING 44
550 #define AIV_F_ROAMING 45
551 #define AIV_F_LIFE_PRESERVATION 46
552 #define AIV_F_BIASED_FLIGHT_IMPORTANCE 47
553 #define AIV_F_BIASED_FLIGHT_MIN 48
554 #define AIV_F_BIASED_FLIGHT_MAX 49
555 #define AIV_F_AWARENESS 50
556 #define AIV_I_FLAGS 51
557 #define AIV_I_STATUS_REG 52
558 #define AIV_F_LAST_HEAR_TARGET_TIME 53
559
560 // =======================================================================
561 // Value - AI Values
562 // =======================================================================
563
564 #define AIGV_I_TYPE 0
565 #define AIGV_C_ACTIVATION_LEVEL 1
566 #define AIGV_F_MIN_INFLUENCE 2
567 #define AIGV_F_MAX_INFLUENCE 3
568
569 #define AIGSV_F_INFLUENCE_DIST 4
570
571 #define AIGV_I_HANDLE 5
572 #define AIGV_I_ROOMNUM 6
573 #define AIGV_I_F_ACTIONS 7
574 #define AIGV_I_ID 8
575 #define AIGV_C_SUBTYPE 9
576 #define AIGV_F_TIME 10
577 #define AIGV_V_VEC 11
578 #define AIGV_V_POS 12
579 #define AIGV_F_STEER_MIN_DIST 13
580 #define AIGV_F_STEER_MAX_DIST 14
581 #define AIGV_F_STEER_MAX_STRENGTH 15
582 #define AIGV_B_ATTACH_F_ALIGNED 16
583 #define AIGV_B_ATTACH_F_SPHERE 17
584 #define AIGV_F_ATTACH_RAD 18
585 #define AIGV_C_ATTACH_CHILD_AP 19
586 #define AIGV_C_ATTACH_PARENT_AP 20
587 #define AIGV_I_WANDER_AVOID_HANDLE 21
588 #define AIGV_C_WANDER_MIN_ROOMS 22
589 #define AIGV_C_WANDER_MAX_ROOMS 23
590 #define AIGV_C_WANDER_FLAGS 24
591 #define AIGV_C_WANDER_MINE_INDEX 25
592 #define AIGV_F_CIRCLE_DIST 26
593 #define AIGV_I_STATUS_REG 27
594 #define AIGV_F_START_TIME 28
595 #define AIGV_F_NEXT_PATH_TIME 29
596 #define AIGV_F_DIST_TO_GOAL 30
597 #define AIGV_V_VEC_TO_TARGET 31
598 #define AIGV_F_NEXT_CHECK_SEE_TARGET_TIME 32
599 #define AIGV_V_LAST_SEE_TARGET_POS 33
600 #define AIGV_F_LAST_SEE_TARGET_TIME 34
601 #define AIGV_F_NEXT_TARGET_UPDATE_TIME 35
602 #define AIGV_I_FLAGS 36
603 #define AIGV_V_ORIENT_FVEC 37
604 #define AIGV_V_ORIENT_UVEC 38
605
606 #define AIGV_C_NUM_ENABLERS 39
607 #define AIGSV_C_ENABLER_TYPE 40
608 #define AIGSV_F_ENABLER_TIME 41
609 #define AIGSV_C_ENABLER_MTYPE 42
610 #define AIGSV_F_ENABLER_FLOAT_VALUE 43
611 #define AIGSV_I_ENABLER_FLAGS 44
612 #define AIGSV_F_ENABLER_DIST 45
613 #define AIGSV_F_ENABLER_PERCENT 46
614 #define AIGSV_F_ENABLER_CHECK_INTERVAL 47
615 #define AIGSV_F_ENABLER_LAST_CHECK_TIME 48
616 #define AIGSV_C_ENABLER_NEXT_ENABLER_OP 49
617
618 #define AIGV_B_USED 50
619 #define AIGV_I_SCRIPTED_DATA_PTR 51
620
621 // =======================================================================
622 // Value - Object Values
623 // =======================================================================
624
625 #define OBJV_F_SHIELDS 0
626 #define OBJV_I_TYPE 1
627 #define OBJV_US_ID 2
628 #define OBJV_V_POS 3
629 #define OBJV_M_ORIENT 4
630 #define OBJV_I_ROOMNUM 5
631 #define OBJV_V_VELOCITY 6
632 #define OBJV_V_ROTVELOCITY 7
633 #define OBJV_V_THRUST 8
634 #define OBJV_V_ROTTHRUST 9
635 #define OBJV_I_FLAGS 10
636 #define OBJV_F_SIZE 11
637 #define OBJV_C_CONTROL_TYPE 12
638 #define OBJV_C_MOVEMENT_TYPE 13
639 #define OBJV_F_CREATION_TIME 14
640 #define OBJV_F_ROTDRAG 15
641 #define OBJV_I_PHYSICS_FLAGS 16
642 #define OBJV_I_PARENT_HANDLE 17
643 #define OBJV_F_ANIM_FRAME 18
644 #define OBJV_F_MAX_SHIELDS 19
645 #define OBJV_PC_MARKER_MESSAGE 20
646 #define OBJSV_F_ANIM_START 21
647 #define OBJSV_F_ANIM_END 22
648 #define OBJSV_F_ANIM_TIME 23
649 #define OBJV_S_NAME 24 // object's name
650 #define OBJV_C_VIRUS_INFECTED 25 // the object show signs of virus infection
651 #define OBJV_C_NEGATIVE_LIGHT 26 // the object casts negative light (black hole)
652 #define OBJV_C_IS_CLOAKED 27 // is object cloaked?
653 #define OBJV_PI_HACK_FVI_IGNORE_LIST 28
654
655 // =======================================================================
656 // Value - Object Weapon Battery Values
657 // =======================================================================
658
659 #define WBV_F_ANIM_FRAME 0
660 #define WBV_F_LAST_FIRE_TIME 1
661 #define WBV_I_DYNAMIC_FLAGS 2
662
663 // WBSV values use the index parameter of Obj_WBValue() for the gun point index
664 #define WBV_C_NUM_GUNPTS 3
665 #define WBSV_US_GUNPT_WEAPON_ID 4
666 #define WBSV_V_GUNPT_POS 5
667
668 // WBSV values use the index parameter of Obj_WBValue() for the firing mask index
669 #define WBV_C_NUM_MASKS 6
670 #define WBSV_C_MASK 7
671 #define WBSV_I_FIRE_SOUND 8
672 #define WBSV_F_LATENCY 9
673 #define WBSV_F_ANIM_TIME 10
674 #define WBSV_F_ANIM_START 11
675 #define WBSV_F_ANIM_FIRE 12
676 #define WBSV_F_ANIM_END 13
677
678 #define WBV_C_NUM_WBS 14
679
680 // =======================================================================
681 // Value - Room Values
682 // =======================================================================
683
684 #define RMV_I_FLAGS 0
685 #define RMV_V_WIND 1
686 #define RMV_C_USED 2
687
688 #define RMV_I_NUM_PATH_PNTS 3
689 #define RMSV_V_PATH_PNT 4
690
691 #define RMV_I_NUM_FACES 5
692 #define RMSV_I_FACE_TEXTURE_ID 6
693 #define RMSV_I_FACE_FLAGS 7
694 #define RMSV_V_FACE_NORMAL 8
695 #define RMSV_V_FACE_CENTER_PNT 14 // I didn't want to reorder the other ones as it is late in the build process
696
697 #define RMV_I_NUM_PORTALS 9
698 #define RMSV_V_PORTAL_PATH_PNT 10
699 #define RMSV_I_PORTAL_CONNECT_ROOM 11
700 #define RMSV_I_PORTAL_CONNECT_PORTAL 12
701 #define RMSV_I_PORTAL_FACE 13
702 #define RMSV_I_PORTAL_FLAGS 15
703
704 #define RMV_F_DAMAGE 16
705
706 // =======================================================================
707 // Value - Level Goal Values
708 // =======================================================================
709
710 #define LGV_I_STATUS 0
711
712 #define LGV_I_NUM_ACTIVE_PRIMARIES 1
713 #define LGSV_I_ACTIVE_PRIMARY_GOAL 2
714
715 #define LGV_I_NUM_ACTIVE_SECONDARIES 3
716 #define LGSV_I_ACTIVE_SECONDARY_GOAL 4
717
718 #define LGV_I_NUM_GOALS 5
719 #define LGSV_PC_GOAL_NAME 6
720 #define LGSV_PC_LOCATION_NAME 7
721 #define LGSV_PC_DESCRIPTION 8
722 #define LGSV_PC_COMPLETION_MESSAGE 9
723 #define LGSV_I_PRIORITY 10
724 #define LGSV_C_GOAL_LIST 11
725 #define LGSV_I_STATUS 12
726
727 #define LGSV_I_NUM_ITEMS 13
728 #define LGSSV_C_ITEM_TYPE 14
729 #define LGSSV_I_ITEM_HANDLE 15
730 #define LGSSV_B_ITEM_DONE 16
731
732 // =======================================================================
733 // Value - Matcen Values
734 // =======================================================================
735
736 #define MTNV_C_ATTACH_TYPE 0
737 #define MTNV_C_CONTROL_TYPE 1
738 #define MTNV_I_ATTACH 2
739 #define MTNV_V_CREATE_POINT 3
740 #define MTNV_I_CREATE_ROOM 4
741 #define MTNV_PC_NAME 5
742 #define MTNV_I_MAX_PROD 6
743 #define MTNV_F_PROD_MULTIPLIER 7
744 #define MTNV_I_STATUS 8
745 #define MTNV_C_CREATION_EFFECT 9
746 #define MTNV_I_MAX_ALIVE_CHILDREN 10
747 #define MTNV_F_PRE_PROD_TIME 11
748 #define MTNV_F_POST_PROD_TIME 12
749 #define MTNV_S_CREATION_TEXTURE 13
750
751 #define MTNSV_I_SOUND 14
752
753 #define MTNV_C_NUM_SPAWN_PTS 15
754 #define MTNSV_I_SPAWN_POINT 16
755
756 #define MTNV_C_NUM_PROD_TYPES 17
757 #define MTNSV_I_PROD_ITEM_ID 18
758 #define MTNSV_I_PROD_ITEM_PRIORITY 19
759 #define MTNSV_F_PROD_ITEM_TIME 20
760 #define MTNSV_I_PROD_ITEM_MAX_PROD 21
761
762 // =======================================================================
763 // inventory add flags
764 // =======================================================================
765 #define INVAF_NOTSPEWABLE 0x0001
766 #define INVAF_TIMEOUTONSPEW 0x0002
767 #define INVAF_LEVELLAST 0x0004
768
769 // =======================================================================
770 // thief stealable items (see PLYV_ actions)
771 // =======================================================================
772 #define THIEFITEM_AUTOMAP 1
773 #define THIEFITEM_HEADLIGHT 2
774 #define THIEFITEM_ETOSCONV 3
775 #define THIEFITEM_CLOAK 4
776 #define THIEFITEM_INVULN 5
777 #define THIEFITEM_RAPIDFIRE 6
778 #define THIEFITEM_QUADFIRE 7
779 #define THIEFITEM_MAXCOUNT 8
780
781 // =======================================================================
782 // Multiplayer safe function type defines
783 // =======================================================================
784
785 #define MSAFE_ROOM_TEXTURE MSAFE_ROOM + 0
786 #define MSAFE_ROOM_WIND MSAFE_ROOM + 1
787 #define MSAFE_ROOM_FOG MSAFE_ROOM + 2
788 #define MSAFE_ROOM_LIGHT_PULSE MSAFE_ROOM + 3
789 #define MSAFE_ROOM_PORTAL_RENDER MSAFE_ROOM + 4
790 #define MSAFE_ROOM_FOG_STATE MSAFE_ROOM + 5
791 #define MSAFE_ROOM_CHANGING_FOG MSAFE_ROOM + 6
792 #define MSAFE_ROOM_CHANGING_WIND MSAFE_ROOM + 7
793 #define MSAFE_ROOM_DAMAGE MSAFE_ROOM + 8
794 #define MSAFE_ROOM_LIGHT_FLICKER MSAFE_ROOM + 9
795 #define MSAFE_ROOM_LIGHT_STROBE MSAFE_ROOM + 10
796 #define MSAFE_ROOM_REFUEL MSAFE_ROOM + 11
797 #define MSAFE_ROOM_HAS_PLAYER MSAFE_ROOM + 12
798 #define MSAFE_ROOM_BREAK_GLASS MSAFE_ROOM + 13
799 #define MSAFE_ROOM_PORTAL_BLOCK MSAFE_ROOM + 14
800 #define MSAFE_ROOM_REMOVE_ALL_POWERUPS MSAFE_ROOM + 15
801
802 #define MSAFE_OBJECT_SHIELDS MSAFE_OBJ + 0
803 #define MSAFE_OBJECT_ENERGY MSAFE_OBJ + 1
804 #define MSAFE_OBJECT_BLANK MSAFE_OBJ + 2
805 #define MSAFE_OBJECT_LIGHT_COLOR MSAFE_OBJ + 3
806 #define MSAFE_OBJECT_MOVEMENT_SCALAR MSAFE_OBJ + 4
807 #define MSAFE_OBJECT_RECHARGE_SCALAR MSAFE_OBJ + 5
808 #define MSAFE_OBJECT_WSPEED_SCALAR MSAFE_OBJ + 6
809 #define MSAFE_OBJECT_DAMAGE_SCALAR MSAFE_OBJ + 7
810 #define MSAFE_OBJECT_ARMOR_SCALAR MSAFE_OBJ + 8
811 #define MSAFE_OBJECT_DAMAGE_OBJECT MSAFE_OBJ + 9
812 #define MSAFE_OBJECT_TYPE MSAFE_OBJ + 10
813 #define MSAFE_OBJECT_ID MSAFE_OBJ + 11
814 #define MSAFE_OBJECT_ADD_WEAPON MSAFE_OBJ + 12
815 #define MSAFE_OBJECT_START_SPEW MSAFE_OBJ + 13
816 #define MSAFE_OBJECT_STOP_SPEW MSAFE_OBJ + 14
817 #define MSAFE_OBJECT_GHOST MSAFE_OBJ + 15
818 #define MSAFE_OBJECT_UNGHOST MSAFE_OBJ + 16
819 #define MSAFE_OBJECT_REMOVE MSAFE_OBJ + 17
820 #define MSAFE_OBJECT_POS MSAFE_OBJ + 18
821 #define MSAFE_OBJECT_ORIENT MSAFE_OBJ + 19
822 #define MSAFE_OBJECT_ROOMNUM MSAFE_OBJ + 20
823 #define MSAFE_OBJECT_VELOCITY MSAFE_OBJ + 21
824 #define MSAFE_OBJECT_ROTVELOCITY MSAFE_OBJ + 22
825 #define MSAFE_OBJECT_THRUST MSAFE_OBJ + 23
826 #define MSAFE_OBJECT_ROTTHRUST MSAFE_OBJ + 24
827 #define MSAFE_OBJECT_FLAGS MSAFE_OBJ + 25
828 #define MSAFE_OBJECT_SIZE MSAFE_OBJ + 26
829 #define MSAFE_OBJECT_CONTROL_TYPE MSAFE_OBJ + 27
830 #define MSAFE_OBJECT_MOVEMENT_TYPE MSAFE_OBJ + 28
831 #define MSAFE_OBJECT_CREATION_TIME MSAFE_OBJ + 29
832 #define MSAFE_OBJECT_CLOAKALLPLAYERS MSAFE_OBJ + 30
833 #define MSAFE_OBJECT_PHYSICS_FLAGS MSAFE_OBJ + 31
834 #define MSAFE_OBJECT_PARENT MSAFE_OBJ + 32
835 #define MSAFE_OBJECT_ROTDRAG MSAFE_OBJ + 33
836 #define MSAFE_OBJECT_INVULNERABLE MSAFE_OBJ + 34
837 #define MSAFE_OBJECT_CLOAK MSAFE_OBJ + 35
838 #define MSAFE_OBJECT_PLAYER_HANDLE MSAFE_OBJ + 36
839 #define MSAFE_OBJECT_PLAYER_CMASK MSAFE_OBJ + 37
840 #define MSAFE_OBJECT_NO_RENDER MSAFE_OBJ + 38
841 #define MSAFE_OBJECT_LIGHT_DIST MSAFE_OBJ + 39
842 #define MSAFE_OBJECT_DEFORM MSAFE_OBJ + 40
843 #define MSAFE_OBJECT_VIEWER_SHAKE MSAFE_OBJ + 41 // or is this player shake?
844 #define MSAFE_OBJECT_PLAYER_KEY MSAFE_OBJ + 42
845 #define MSAFE_OBJECT_PLAYER_CONTROLAI MSAFE_OBJ + 43
846 #define MSAFE_OBJECT_WORLD_POSITION MSAFE_OBJ + 44 // room+pos+orient
847 #define MSAFE_OBJECT_COUNT_TYPE MSAFE_OBJ + 45
848 #define MSAFE_OBJECT_SPARKS MSAFE_OBJ + 46
849 #define MSAFE_OBJECT_SETONFIRE \
850 MSAFE_OBJ + 47 // objhandle, longevity = how long, interval = damage per sec, ithandle = killer (or
851 // OBJECT_HANDLE_NONE)
852 #define MSAFE_OBJECT_SHAKE_AREA MSAFE_OBJ + 48
853 #define MSAFE_OBJECT_ENERGY_WEAPON MSAFE_OBJ + 49
854 #define MSAFE_OBJECT_DAMAGE_AMOUNT MSAFE_OBJ + 50
855 #define MSAFE_OBJECT_SHIELDS_ORIGINAL MSAFE_OBJ + 51
856 #define MSAFE_SHOW_ENABLED_CONTROLS MSAFE_OBJ + 52
857 #define MSAFE_OBJECT_FIRE_WEAPON MSAFE_OBJ + 53
858 #define MSAFE_OBJECT_DESTROY_ROBOTS_EXCEPT MSAFE_OBJ + 54
859
860 #define MSAFE_WEATHER_RAIN MSAFE_WEATHER + 0
861 #define MSAFE_WEATHER_SNOW MSAFE_WEATHER + 1
862 #define MSAFE_WEATHER_LIGHTNING MSAFE_WEATHER + 2
863 #define MSAFE_WEATHER_LIGHTNING_BOLT MSAFE_WEATHER + 3
864 #define MSAFE_WEATHER_LIGHTNING_BOLT_POS MSAFE_WEATHER + 4
865
866 #define MSAFE_SOUND_2D MSAFE_SOUND + 0
867 #define MSAFE_SOUND_OBJECT MSAFE_SOUND + 1
868 #define MSAFE_SOUND_STREAMING MSAFE_SOUND + 2
869 #define MSAFE_SOUND_STOP MSAFE_SOUND + 3
870 #define MSAFE_SOUND_STOP_OBJ MSAFE_SOUND + 4
871 #define MSAFE_SOUND_VOLUME_OBJ MSAFE_SOUND + 5
872
873 #define MSAFE_DOOR_LOCK_STATE MSAFE_DOOR + 0
874 #define MSAFE_DOOR_ACTIVATE MSAFE_DOOR + 1
875 #define MSAFE_DOOR_POSITION MSAFE_DOOR + 2
876 #define MSAFE_DOOR_STOP MSAFE_DOOR + 3
877 #define MSAFE_DOOR_OPENABLE MSAFE_DOOR + 4
878
879 #define MSAFE_TRIGGER_SET MSAFE_TRIGGER + 0
880
881 #define MSAFE_MISC_HUD_MESSAGE MSAFE_MISC + 0
882 #define MSAFE_MISC_WAYPOINT MSAFE_MISC + 1
883 #define MSAFE_MISC_END_LEVEL MSAFE_MISC + 2
884 #define MSAFE_MISC_POPUP_CAMERA MSAFE_MISC + 3
885 #define MSAFE_MISC_CLOSE_POPUP MSAFE_MISC + 4
886 #define MSAFE_MISC_GAME_MESSAGE MSAFE_MISC + 5
887 #define MSAFE_MUSIC_REGION MSAFE_MISC + 6
888 #define MSAFE_MISC_ENABLE_SHIP MSAFE_MISC + 7
889 #define MSAFE_MISC_LEVELGOAL MSAFE_MISC + 8
890 #define MSAFE_MISC_GUIDEBOT_NAME MSAFE_MISC + 9
891 #define MSAFE_MISC_FILTERED_HUD_MESSAGE MSAFE_MISC + 10
892 #define MSAFE_MISC_START_TIMER MSAFE_MISC + 11
893 #define MSAFE_MISC_ADD_HUD_ITEM MSAFE_MISC + 12
894 #define MSAFE_MISC_UPDATE_HUD_ITEM MSAFE_MISC + 13
895
896 #define MSAFE_INVEN_ADD_TYPE_ID MSAFE_INVEN + 0
897 #define MSAFE_INVEN_CHECK MSAFE_INVEN + 1
898 #define MSAFE_INVEN_COUNT MSAFE_INVEN + 2
899 #define MSAFE_INVEN_REMOVE MSAFE_INVEN + 3
900 #define MSAFE_INVEN_SIZE MSAFE_INVEN + 4
901 #define MSAFE_INVEN_GET_TYPE_ID MSAFE_INVEN + 5
902 #define MSAFE_INVEN_ADD_OBJECT MSAFE_INVEN + 6
903 #define MSAFE_INVEN_CHECK_OBJECT MSAFE_INVEN + 7
904 #define MSAFE_INVEN_REMOVE_OBJECT MSAFE_INVEN + 8
905
906 #define MSAFE_COUNTERMEASURE_ADD MSAFE_COUNTERMEASURE + 0
907 #define MSAFE_COUNTERMEASURE_COUNT MSAFE_COUNTERMEASURE + 1
908 #define MSAFE_COUNTERMEASURE_CHECK MSAFE_COUNTERMEASURE + 2
909 #define MSAFE_COUNTERMEASURE_REMOVE MSAFE_COUNTERMEASURE + 3
910 #define MSAFE_COUNTERMEASURE_SIZE MSAFE_COUNTERMEASURE + 4
911 #define MSAFE_COUNTERMEASURE_GET MSAFE_COUNTERMEASURE + 5
912
913 #define MSAFE_WEAPON_CHECK MSAFE_WEAPON + 0
914 #define MSAFE_WEAPON_ADD MSAFE_WEAPON + 1
915
916 // =======================================================================
917 // Structures shared between OSIRIS and the game
918 // =======================================================================
919
920 // Since this header is shared within D3, in order to keep redefinition errors
921 // quiet, the following section will only be included if this header file
922 // is included by a DLL
923 #ifndef INCLUDED_FROM_D3
924
925 // Use this handle when you want a handle that will never be a valid object
926 #ifndef INCLUDED_FROM_PLAYER_H
927 #define MAX_PLAYERS 32
928 #endif
929
930 // define unsigned types;
931 typedef uint8_t uint8_t;
932 typedef int8_t int8_t;
933 typedef uint16_t uint16_t;
934 typedef uint32_t uint32_t;
935 typedef uint32_t ddgr_color;
936
937 #ifndef NULL
938 #define NULL 0
939 #endif
940
941 inline ddgr_color GR_RGB(int r, int g, int b) { return ((r << 16) + (g << 8) + b); }
942
943 #endif // end #ifndef INCLUDED_FROM_D3
944
945 // =======================================================================
946 // GB Menu structure
947 // =======================================================================
948
949 #define MAX_GB_COMMANDS 60
950
951 #define GBCT_EXIT_IMMEDIATELY 0
952 #define GBCT_STRING_DIALOG 1
953
954 #define COM_GET_MENU 0
955 #define COM_DO_ACTION 1
956 #define COM_REINIT 2
957
958 struct gb_com {
959 int8_t action;
960 int8_t index;
961 void *ptr;
962 };
963
964 struct gb_menu {
965 char title[256];
966 int32_t num_commands;
967 char command_text[MAX_GB_COMMANDS][256];
968 char command_id[MAX_GB_COMMANDS];
969 char command_type[MAX_GB_COMMANDS];
970
971 char dialog_text[MAX_GB_COMMANDS][256];
972 };
973
974 // =======================================================================
975 // Osiris structures
976 // =======================================================================
977
978 struct tOSIRISModuleInit {
979 int32_t *fp[MAX_MODULEFUNCS];
980 char **string_table;
981 int32_t string_count;
982 int32_t module_identifier;
983
984 bool module_is_static; // if this is set to true after initialization
985 // then the module will not unload if it's reference
986 // count is 0....only when the level ends.
987 // this is for Game modules ONLY.
988
989 char *script_identifier; // Contains a unique script identifier (string), which
990 // can be used for the OMMS system. While this pointer
991 // will always be valid during the lifetime of the module
992 // DO NOT ALTER THE STRING IT POINTS TO.
993
994 uint32_t game_checksum; // Checksum of game structures, if this doesn't match
995 // the checksum at compile time, it is very likely that
996 // bad things can happen, and this module shouldn't initialize.
997
998 }; // contains the necessary data to initialize
999
1000 // an OSIRIS module
1001 struct tOSIRISEVTINTERVAL {
1002 float frame_time;
1003 float game_time;
1004 }; // struct for EVT_INTERVAL data
1005
1006 struct tOSIRISIEVTAIFRAME {
1007 }; // struct for EVT_AI_FRAME data
1008
1009 struct tOSIRISEVTDAMAGED {
1010 float damage;
1011 int32_t it_handle;
1012 int32_t weapon_handle;
1013 int32_t damage_type;
1014 }; // struct for EVT_DAMAGED data
1015
1016 struct tOSIRISEVTCOLLIDE {
1017 int32_t it_handle;
1018 }; // struct for EVT_COLLIDE data
1019
1020 struct tOSIRISEVTCREATED {
1021 }; // struct for EVT_CREATED data
1022
1023 struct tOSIRISEVTDESTROY {
1024 uint8_t is_dying; // if this is !=0 than the event is coming because it is
1025 // really being destroyed. Else it is due to the level ending.
1026 }; // struct for EVT_DESTROY data
1027
1028 struct tOSIRISEVTTIMER {
1029 int32_t id;
1030 float game_time;
1031 }; // struct for EVT_TIMER data
1032
1033 struct tOSIRISEVTUSE {
1034 int32_t it_handle;
1035 }; // struct for EVT_USE data
1036
1037 struct tOSIRISEVTSAVESTATE {
1038 void *fileptr;
1039 }; // struct for EVT_SAVESTATE data
1040
1041 struct tOSIRISEVTRESTORESTATE {
1042 void *fileptr;
1043 }; // struct for EVT_RESTORESTATE data
1044
1045 struct tOSIRISEVTAINOTIFY {
1046 int32_t notify_type;
1047 int32_t it_handle;
1048 int32_t goal_num;
1049 int32_t goal_uid;
1050 union {
1051 int32_t enabler_num;
1052 int32_t attack_num;
1053 };
1054 }; // struct for EVT_AI_NOTIFY data
1055
1056 struct tOSIRISEVTAIINIT {
1057 }; // struct for EVT_AI_INIT data
1058
1059 struct tOSIRISEVTLEVELSTART {
1060 }; // struct for EVT_LEVELSTART data
1061
1062 struct tOSIRISEVTLEVELEND {
1063 }; // struct for EVT_LEVELEND data
1064
1065 struct tOSIRISEVTCHANGESEG {
1066 int32_t room_num;
1067 }; // struct for EVT_CHANGESEG data
1068
1069 struct tOSIRISEVTMEMRESTORE {
1070 int32_t id;
1071 void *memory_ptr;
1072 }; // struct for EVT_MEMRESTORE data
1073
1074 struct tOSIRISEVTTIMERCANCEL {
1075 int32_t handle;
1076 uint8_t detonated;
1077 }; // struct for EVT_TIMERCANCEL data
1078
1079 struct tOSIRISEVTCHILDDIED {
1080 int32_t it_handle;
1081 };
1082
1083 struct tOSIRISEVTMATCENCREATE {
1084 int32_t it_handle;
1085 int32_t id;
1086 }; // struct for EVT_MATCEN_CREATE data
1087
1088 struct tOSIRISEVTDOORACTIVATE {
1089 }; // struct for EVT_DOOR_ACTIVATE data
1090
1091 struct tOSIRISEVTDOORCLOSE {
1092 }; // struct for EVT_DOOR_CLOSE data
1093
1094 struct tOSIRISEVTLEVELGOALCOMPLETE {
1095 int32_t level_goal_index;
1096 };
1097
1098 struct tOSIRISEVTLEVELGOALITEMCOMPLETE {
1099 int32_t level_goal_index;
1100 };
1101
1102 struct tOSIRISEVTALLLEVELGOALSCOMPLETE {
1103 };
1104
1105 struct tOSIRISEVTPLAYERMOVIESTART {
1106 };
1107
1108 struct tOSIRISEVTPLAYERMOVIEEND {
1109 };
1110
1111 struct tOSIRISEVTPLAYERRESPAWN {
1112 int32_t it_handle; // player respawning
1113 };
1114
1115 struct tOSIRISEVTPLAYERDIES {
1116 int32_t it_handle; // player dead
1117 };
1118
1119 struct tOSIRISEventInfo {
1120 union {
1121 tOSIRISEVTINTERVAL evt_interval;
1122 tOSIRISIEVTAIFRAME evt_ai_frame;
1123 tOSIRISEVTDAMAGED evt_damaged;
1124 tOSIRISEVTCOLLIDE evt_collide;
1125 tOSIRISEVTCREATED evt_created;
1126 tOSIRISEVTDESTROY evt_destroy;
1127 tOSIRISEVTTIMER evt_timer;
1128 tOSIRISEVTUSE evt_use;
1129 tOSIRISEVTAINOTIFY evt_ai_notify;
1130 tOSIRISEVTAINOTIFY evt_ain_objkilled;
1131 tOSIRISEVTAINOTIFY evt_ain_seeplayer;
1132 tOSIRISEVTAINOTIFY evt_ain_whitobject;
1133 tOSIRISEVTAINOTIFY evt_ain_goalcomplete;
1134 tOSIRISEVTAINOTIFY evt_ain_goalinvalid;
1135 tOSIRISEVTAINOTIFY evt_ain_goalfail;
1136 tOSIRISEVTAINOTIFY evt_ain_goalerror;
1137 tOSIRISEVTAINOTIFY evt_ain_goalforcedone;
1138 tOSIRISEVTAINOTIFY evt_ain_melee_hit;
1139 tOSIRISEVTAINOTIFY evt_ain_melee_attack_frame;
1140 tOSIRISEVTAINOTIFY evt_ain_movie_start;
1141 tOSIRISEVTAINOTIFY evt_ain_movie_end;
1142 tOSIRISEVTAIINIT evt_ai_init;
1143 tOSIRISEVTLEVELSTART evt_levelstart;
1144 tOSIRISEVTLEVELEND evt_levelend;
1145 tOSIRISEVTCHANGESEG evt_changeseg;
1146 tOSIRISEVTSAVESTATE evt_savestate;
1147 tOSIRISEVTRESTORESTATE evt_restorestate;
1148 tOSIRISEVTMEMRESTORE evt_memrestore;
1149 tOSIRISEVTTIMERCANCEL evt_timercancel;
1150 tOSIRISEVTMATCENCREATE evt_matcen_create;
1151 tOSIRISEVTDOORACTIVATE evt_door_activate;
1152 tOSIRISEVTDOORCLOSE evt_door_close;
1153 tOSIRISEVTCHILDDIED evt_child_died;
1154 tOSIRISEVTLEVELGOALCOMPLETE evt_level_goal_complete;
1155 tOSIRISEVTALLLEVELGOALSCOMPLETE evt_all_level_goals_complete;
1156 tOSIRISEVTLEVELGOALITEMCOMPLETE evt_level_goal_item_complete;
1157 tOSIRISEVTPLAYERMOVIESTART evt_player_movie_start;
1158 tOSIRISEVTPLAYERMOVIEEND evt_player_movie_end;
1159 tOSIRISEVTPLAYERRESPAWN evt_player_respawn;
1160 tOSIRISEVTPLAYERDIES evt_player_dies;
1161 };
1162
1163 int32_t me_handle;
1164 void *extra_info;
1165 }; // contains the necessary data for all events
1166 // to pass what they need to their event handlers.
1167
1168 #define OTF_REPEATER 0x0001 // this timer is to repeat repeat_count times
1169 #define OTF_TRIGGER 0x0002 // this timer is for a trigger, use trigger_number
1170 #define OTF_LEVEL 0x0004 // this timer is for the level
1171 #define OTF_CANCELONDEAD \
1172 0x008 // this timer should be auto-cancelled if object_handle_detonator dies, than the
1173 // timer auto-cancels
1174 struct tOSIRISTIMER {
1175 uint16_t flags;
1176 int32_t id; // an optional id you can use to store, will be passed back on EVT_TIMER signal
1177 int32_t repeat_count; // if OTF_REPEATER is set, this is how many times to repeat the signal (every
1178 // interval). -1 for infinite.
1179 union {
1180 int32_t object_handle; // handle to the object to recieve the EVT_TIMER signal
1181 int32_t trigger_number; // trigger number to recieve the EVT_TIMER signal (OTF_TRIGGER)
1182 };
1183
1184 int32_t object_handle_detonator; // if OTF_CANCELONDEAD is specified, this is the object handle to
1185 // use for checking, if this object dies, than auto-cancel the timer
1186
1187 float timer_interval; // the timeframe in between EVT_TIMER signals (for non-repeaters, this is how
1188 // long until the single EVT_TIMER gets signaled).
1189 };
1190
1191 enum script_type { OBJECT_SCRIPT = 0, TRIGGER_SCRIPT, LEVEL_SCRIPT };
1192
1193 struct tOSIRISSCRIPTID {
1194 script_type type;
1195 union {
1196 int32_t objhandle;
1197 int32_t triggernum;
1198 };
1199 };
1200
1201 struct tOSIRISMEMCHUNK {
1202 tOSIRISSCRIPTID my_id;
1203 uint16_t id;
1204 int32_t size;
1205 };
1206
1207 // =======================================================================
1208 // Multiplayer safe function structs
1209 // =======================================================================
1210
1211 #define KOI_ID 0 // this item is specifying a type/id of object NOT to kill
1212 #define KOI_HANDLE 1 // this item is specifying an object handle of an object NOT to kill
1213 struct tKillObjectItem {
1214 uint8_t info_type;
1215 int32_t id;
1216 int32_t objhandle;
1217 };
1218
1219 #define MSAFE_MESSAGE_LENGTH 255
1220 #define MSAFE_NAME_LENGTH 32
1221 struct msafe_struct {
1222 // Rooms
1223 int32_t roomnum;
1224 int16_t facenum;
1225 int16_t texnum;
1226 int16_t portalnum;
1227 float fog_r, fog_g, fog_b, fog_depth;
1228 vector wind;
1229 uint8_t pulse_time;
1230 uint8_t pulse_offset;
1231
1232 // Objects/Players
1233 uint32_t objhandle;
1234 uint32_t ithandle;
1235 float shields, energy;
1236 int16_t start_tick;
1237 int16_t end_tick;
1238 float cycle_time;
1239 int32_t type, id, aux_type, aux_id;
1240 uint32_t checksum;
1241 int32_t path_id;
1242 float amount;
1243 uint8_t damage_type;
1244 uint32_t killer_handle;
1245 float ammo;
1246 uint8_t playsound;
1247 uint8_t remove;
1248 uint8_t do_powerup;
1249 vector velocity;
1250 vector rot_velocity;
1251 float rot_drag;
1252 vector thrust;
1253 vector rot_thrust;
1254 int8_t control_type;
1255 int8_t movement_type;
1256 float creation_time;
1257 int32_t physics_flags;
1258 vector pos;
1259 matrix orient;
1260 float anim_frame;
1261
1262 // Spew
1263 uint8_t is_real;
1264 uint8_t random;
1265 uint8_t unused2; // was use_gunpoint
1266 int8_t gunpoint;
1267 uint8_t effect_type;
1268 uint8_t phys_info;
1269 float drag, mass;
1270
1271 // Unused
1272 uint16_t unused; // was doorway_index
1273
1274 // Weather
1275 int32_t randval;
1276
1277 // Triggers
1278 uint8_t trigger_num;
1279
1280 // sounds
1281 int32_t sound_handle;
1282 float volume;
1283
1284 // Shared/misc
1285 int32_t index;
1286 float scalar;
1287 float interval;
1288 uint8_t state;
1289 int8_t slot;
1290 char message[MSAFE_MESSAGE_LENGTH];
1291 char name[MSAFE_NAME_LENGTH];
1292 int32_t color;
1293 float longevity;
1294 float lifetime;
1295 float size;
1296 float speed;
1297 int32_t count;
1298 int32_t flags;
1299 void *list;
1300 uint32_t control_mask;
1301 uint8_t control_val;
1302
1303 // Object lighting stuff
1304 float light_distance;
1305 float r1, g1, b1; // light 1 color
1306 float r2, g2, b2; // light 2 color
1307 float time_interval;
1308 float flicker_distance;
1309 float directional_dot;
1310 int32_t timebits;
1311
1312 vector pos2;
1313
1314 // Second message
1315 char message2[MSAFE_MESSAGE_LENGTH];
1316
1317 };
1318
1319 struct ray_info {
1320 int32_t fate;
1321 int32_t hit_room;
1322 vector hit_point;
1323
1324 int32_t hit_object;
1325 int32_t hit_subobject;
1326
1327 int32_t hit_face;
1328 vector hit_face_pnt;
1329 int32_t hit_face_room;
1330 vector hit_wallnorm;
1331 };
1332
1333 #define PV_POS 0x00000001 // set/get pos member (pass in an osiris_path_node_info ptr)
1334 #define PV_ROOMNUM 0x00000002 // set/get roomnum member (pass in an osiris_path_node_info ptr)
1335 #define PV_FLAGS 0x00000004 // set/get flags member (pass in an osiris_path_node_info ptr)
1336 #define PV_FVEC 0x00000008 // set/get fvec member (pass in an osiris_path_node_info ptr)
1337 #define PV_UVEC 0x00000010 // set/get uvec member (pass in an osiris_path_node_info ptr)
1338 #define PV_ALL 0x0000001F // set/get all members (above..pass in an osiris_path_node_info ptr)
1339 #define PV_I_NUMNODES 0x00010000 // get number of nodes in this path
1340 #define PV_CS_NAME 0x00020000 // get name of path
1341 #define PV_I_NUMPATHS 0x00040000 // get number of paths (path_id & node_id are ignored in this case)
1342
1343 struct osiris_path_node_info {
1344 vector pos; // where this node is in the world
1345 int32_t roomnum; // what room?
1346 int32_t flags; // if this point lives over the terrain, etc
1347 vector fvec;
1348 vector uvec;
1349 };
1350
1351 #endif