DI-Guy C++ SDK Reference  13.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguyScenario.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2014 VT MAK
4  ** All rights reserved.
5  *********************************************************************/
6 
7 /*********************************************************************
8  **
9  *t diguyScenario
10  **
11  *b Link against: libdiguy
12  */
13 
14 #ifndef __diguyScenario_H
15 #define __diguyScenario_H
16 
17 #ifdef SWIG
18 %module diguyScenario
19 #else
20 #define CPLUSPLUS_ONLY
21 #endif
22 
23 #ifdef CPLUSPLUS_ONLY
24 
25 #include <declspec_diguy.h>
26 #include <diguyViewCamera.h>
27 #include <diguyViewFog.h>
28 #include <diguyViewLight.h>
29 #include <diguyMotionDirection.h>
30 #include <diguyMotionPosture.h>
31 #include <diguyMotionVariant.h>
32 #include <diguyCharacterTypeMap.h>
34 #include <diguy_vector_classes.h>
35 
36 #include "diguy_constants.h"
37 #include "diguy_typedefs.h"
38 #include "diguyCharacterPath.h"
40 #include "diguySensorRegion.h"
41 #include "diguySignal.h"
42 #include "diguyVariable.h"
43 #include "diguyView.h"
44 
45 class bdiScenario;
47 class diguyChainSettings;
48 class diguyCharacter;
51 class diguyCrowd;
52 class diguyCrowdProfile;
53 class diguyLoadManager;
54 class diguyFormation;
55 class diguyViewLabel;
57 class diguyInfoPopup;
58 class diguyImpact;
59 class diguyPathShape;
60 class diguyRegion;
62 class diguySceneObject;
63 class diguySensorRegion;
64 class diguySound;
65 class diguyVariable;
66 class diguyWaypoint;
67 class diguyView;
72 
73 #endif
74 
75 
76 
77 /****************************************************************************/
78 class BDI_DECLSPEC_diguy diguyScenario
79 {
80 
81 /*****************************************************************************/
91 public:
92 
93  /*l
94  *b Description:
95  **
96  ** This static function returns a pointer to the current scenario
97  ** object. All functions below can then be called through this
98  ** pointer. This is the same pointer returned by the call
99  ** diguy_create_scenario().
100  **
101  ** lua scripts get the current scenario through the variable
102  ** this_scenario.
103  **
104  *b Returns:
105  **
106  ** a pointer of type diguyScenario
107  **
108  *b C++ Example:
109  **
110  *e diguyScenario* sc = diguyScenario::get_current_scenario();
111  *e sc->reset();
112  **
113  *b Lua Example:
114  **
115  *e this_scenario:reset();
116  */
117  static diguyScenario* get_current_scenario();
118 
119  /*l
120  *b Description:
121  **
122  ** Returns the name of the object. This pointer will never be NULL.
123  **
124  *b Returns:
125  **
126  ** name of the object
127  */
128  const char* get_name();
129 
130  /*l
131  *b Description:
132  **
133  ** Returns the type name of the object. This pointer will never be
134  ** NULL.
135  **
136  *b Returns:
137  **
138  ** type name of the object
139  */
140  const char* get_type_name();
141 
142  /*l
143  *b Returns:
144  **
145  ** the scenario description as specified in the scenario info page
146  */
147  const char* get_description();
148 
149 
150 /*****************************************************************************/
160 #ifdef CPLUSPLUS_ONLY
161 
162  /*l
163  *b Description:
164  **
165  ** Sets the desired simulation time of the scenario.
166  **
167  ** Some update operations will use the simulation desired time
168  ** directly.
169  **
170  ** Many other scenario operations -- notably character position and
171  ** pose updates -- will not happen until the desired t passes each
172  ** subsequent tick dt threshold. See set_tick_dt().
173  **
174  ** This function sets both elapsed simulation time and elapsed
175  ** realtime to the same value. This is usually desired in DI-Guy
176  ** applications. To pass separate values for simulation time and
177  ** realtime time, call update2().
178  **
179  ** Time can be run backwards. This happens if the passed t is lower
180  ** than any t previously passed to the update() function; the
181  ** scenario remembers the highest t it has reached. If t is set to
182  ** less that the highest t reached, characters that have history data
183  ** will replay what they were doing at the specified time.
184  ** Characters that do not have history will remain motionless until t
185  ** advances past the previous highest t.
186  **
187  ** Scenario time will never go below 0.
188  **
189  ** If t reaches the scenario tout ("T Out") time (as set by
190  ** set_tout(), a number of things may happen. The scenario may:
191  **
192  *- - simply stop at the tout time
193  *- - continue past the tout time
194  *- - rewind to time 0 and play back recorded history
195  *- - reset and re-simulate the scenario from time 0
196  **
197  ** The default tout time is 60000 for DI-Guy applications. The tout
198  ** can be enabled and disabled with set_tout_enabled().
199  **
200  ** This function cannot explicitly be called for DI-Guy Scenario, but
201  ** the effects of t reaching tout during scenario simulation are
202  ** outlined here anyway.
203  **
204  *b For a DI-Guy application:
205  **
206  *- - If the scenario tout is enabled the scenario will stop.
207  *
208  *- - If the scenario tout is disabled the scenario will continue
209  *- indefinitely, regardless of scenario tout.
210  **
211  ** Note that no playback looping happens in a DI-Guy application if
212  ** tout is reached. Only in DI-Guy Scenario does the loop flag
213  ** have an effect.
214  *-
215  *b For DI-Guy Scenario:
216  **
217  *- - If the loop flag is not set (see set_playback_loop()) or a movie
218  *- is being recorded, the scenario will stop.
219  *
220  *- - If the loop flag is set, and any character in the scenario has
221  *- history data (see the History Functions for diguyCharacter), the
222  *- scenario will be rewound to 0 and play back history data.
223  *
224  *- - If the loop flag is set, but no characters in the scenario have
225  *- history data, the scenario will be reset to 0 and re-simulate
226  *- from there.
227  **
228  *b Arguments:
229  **
230  *a t - desired time in seconds
231  **
232  *b Returns:
233  **
234  ** 0 on success, -1 on failure
235  **
236  *b Callable From:
237  **
238  *- - C++
239  */
240  int update(float t);
241 
242  /*l
243  *b Description:
244  **
245  ** Similar to update(), but the realtime time can be explicitly
246  ** passed in.
247  **
248  *b Arguments:
249  **
250  *a t - desired simulation time in seconds
251  *a realtime_t - elapsed real time in seconds
252  **
253  *b Returns:
254  **
255  ** 0 on success, -1 on failure
256  **
257  *b Callable From:
258  **
259  *- - C++
260  */
261  int update2(float t, float realtime_t);
262 
263  /*l
264  *b Description:
265  **
266  ** This function sets whether the scenario is designed to loop at
267  ** tout. The default is for scenarios to loop.
268  **
269  ** Note that this has an effect only in DI-Guy Scenario. DI-Guy
270  ** applications do not use this flag.
271  **
272  ** See get_playback_loop().
273  **
274  *b Arguments:
275  **
276  *a playback_loop - pass 1 to have scenario loop at tout, 0 to not
277  **
278  *b Returns:
279  **
280  ** 0 on success, -1 on failure
281  **
282  *b Callable From:
283  **
284  *- - C++
285  */
286  int set_playback_loop(int playback_loop);
287 
288  /*l
289  *b Description:
290  **
291  ** Scenarios progress at discrete time steps, called "ticks". Each
292  ** tick is of the same duration. This function sets the amount of
293  ** time each tick takes.
294  **
295  ** Because changing the tick interval of a scenario changes when
296  ** event beads occur, any change may introduce subtle differences in
297  ** scenario playback.
298  **
299  ** Note that loading a .dss file will change the tick dt, as tick dt
300  ** is set on a per scenario basis.
301  **
302  ** The default tick dt of a new scenario is 0.03125 seconds, or 32
303  ** frames per second.
304  **
305  *b Arguments:
306  **
307  *a tick_dt - duration, in seconds, of each scenario tick
308  **
309  *b Returns:
310  **
311  ** 0 on success, -1 on failure
312  **
313  *b Callable From:
314  **
315  *- - C++
316  **
317  *b C++ Example:
318  **
319  *e diguyScenario* sc = diguy_create_scenario();
320  *e if (sc)
321  *e {
322  *e sc->load("my_scenario.dss");
323  *e sc->set_tick_dt(0.033333); // 30 fps
324  *e }
325  */
326  int set_tick_dt(float tick_dt);
327 
328 #endif
329 
330  /*l
331  *b Description:
332  **
333  ** This function returns the time in seconds that the scenario is
334  ** currently at. See update().
335  **
336  ** Note that this value will not necessarily track the t passed in
337  ** the update() function. This t advances only when the scenario's
338  ** current tick changes. See set_tick_dt() and update().
339  **
340  *b Returns:
341  **
342  ** current time in seconds
343  */
344  float get_t();
345 
346  /*l
347  *b Description:
348  **
349  ** This function returns the realtime time in seconds that the
350  ** scenario is currently at. This may be different than
351  ** get_desired_t() if the scenario is stopped or the time passed in
352  ** update() is not tracking realtime.
353  **
354  *b Returns:
355  **
356  ** current time in seconds
357  */
358  float get_realtime_t();
359 
360  /*l
361  *b Description:
362  **
363  ** This function returns the desired time in seconds that the
364  ** scenario is currently at. This may be different than get_t(),
365  ** which advances only when the scenario's current tick changes.
366  **
367  *b Returns:
368  **
369  ** current time in seconds
370  */
371  float get_desired_t();
372 
373  /*l
374  *b Description:
375  **
376  ** This function sets the tout ("T Out") time of the scenario. What
377  ** will happen when the scenario reaches this time depends on a
378  ** number of factors. See update() for more information.
379  **
380  *b Returns:
381  **
382  ** 0 on success, -1 on failure
383  **
384  *b Callable From:
385  **
386  *- - C++
387  */
388  int set_tout(float tout);
389 
390  /*l
391  *b Description:
392  **
393  ** This function returns the tout time of the scenario. This is the
394  ** time at which a scenario is designed to end.
395  **
396  ** See set_tout() and update().
397  **
398  *b Returns:
399  **
400  ** tout of scenario
401  */
402  float get_tout();
403 
404  /*l
405  *b Description:
406  **
407  ** This function sets what will happen when the scenario reaches its
408  ** tout time. If set to 0, the scenario will ignore the tout time
409  ** and continue indefinitely.
410  **
411  ** See update() for more information.
412  */
413  void set_tout_enabled(int tout_enabled);
414 
415  /*l
416  *b Description:
417  **
418  ** This function returns the whether tout is enabled.
419  **
420  ** See set_tout_enabled() and update().
421  **
422  *b Returns:
423  **
424  ** 1 if tout enabled, 0 if not
425  */
426  int get_tout_enabled();
427 
428  /*l
429  *b Description:
430  **
431  ** This function returns whether the scenario is designed to loop
432  ** when the scenario's tout time is reached.
433  **
434  ** See update() for more information about looping.
435  **
436  *b Returns:
437  **
438  ** 0 if no loop desired; 1 if loop desired
439  */
440  int get_playback_loop();
441 
442  /*l
443  *b Description:
444  **
445  ** This function returns the most recent setting of set_tick_dt().
446  */
447  float get_tick_dt();
448 
449  /*l
450  *b Returns:
451  **
452  ** This function returns the most recent setting of
453  ** set_ticks_can_be_dropped().
454  */
455  int get_ticks_can_be_dropped();
456 
457  /*l
458  *b Description:
459  **
460  ** This function sets whether a scenario can "drop" ticks in order to
461  ** catch up if it falls behind.
462  **
463  ** Scenario updates progress in discrete time steps called ticks (see
464  ** set_tick_dt() and update()). If the difference in times specified
465  ** in subsequent calls to update() is greater than the tick dt, which
466  ** can happen if calls to update() are taking too long because the
467  ** scenario is too complex or if the caller is attempting to "fast
468  ** forward" to a particular time in the scenario, the scenario may
469  ** skip processing of intermediate ticks in order to catch up.
470  **
471  ** The scenario will not consider itself behind until the number of
472  ** ticks covered by a particular call to update() is equal to or
473  ** greater than the value set by set_max_ticks_behind_until_drop().
474  **
475  ** Dropping ticks, while it improves performance, may have unintended
476  ** side effects, including:
477  **
478  *- - event beads of characters on paths that fall on the dropped
479  *- ticks -- including aim beads, decision beads, gaze beads, and
480  *- script beads -- will not be evaluated and will therefore have
481  *- no effect on the scenario
482  *- - review playback of characters (see
483  *- diguyCharacter::set_history_type()) over the dropped intervals
484  *- will be choppy
485  **
486  ** Not dropping ticks also has potential side effects:
487  **
488  *- - if a scenario is falling behind more and more on each call
489  *- to update(), it may never be able to catch up and performance
490  *- of DI-Guy will increasingly degrade
491  **
492  ** The default setting is that ticks can be dropped.
493  **
494  *b Arguments:
495  **
496  *a ticks_can_be_dropped - pass 1 for ticks to be dropped; else
497  *a pass 0
498  */
499  void set_ticks_can_be_dropped(int ticks_can_be_dropped);
500 
501  /*l
502  *b Returns:
503  **
504  ** This function returns the most recent setting of
505  ** set_max_ticks_behind_until_drop().
506  */
507  long get_max_ticks_behind_until_drop();
508 
509  /*l
510  *b Description:
511  **
512  ** This function sets how many ticks a scenario must be behind before
513  ** it starts dropping ticks in order to catch up.
514  **
515  ** For a discussion of how a scenario may fall behind, see
516  ** set_ticks_can_be_dropped().
517  **
518  ** Note that if ticks cannot be dropped, (e.g., 0 is passed to
519  ** set_ticks_can_be_dropped()) this function will have no effect.
520  **
521  ** The default value is 2.
522  **
523  *b Arguments:
524  **
525  *a max_ticks_behind_until_drop - how many ticks a scenario must
526  *a be behind until it drops ticks
527  */
528  void set_max_ticks_behind_until_drop(long max_ticks_behind_until_drop);
529 
530  /*l
531  *b Description:
532  **
533  ** This function sets the current playback mode of DI-Guy Scenario.
534  ** It currently will have no effect in applications using the DI-Guy
535  ** API.
536  **
537  *b Arguments:
538  **
539  *a playback_mode - new playback mode
540  **
541  *b Returns:
542  **
543  ** 0 on success, -1 on failure
544  */
545  int set_playback_mode(diguyScenarioPlaybackMode playback_mode);
546 
547  /*l
548  *b Description:
549  **
550  ** This function is shorthand for the function call
551  ** set_playback_mode(DIGUY_SCENARIO_PLAYBACK_MODE_STOP). It is
552  ** useful for pausing the scenario in decisions and decision beads.
553  **
554  *b Returns:
555  **
556  ** 0 on success, -1 on failure
557  **
558  *b Callable From:
559  **
560  *- - C++
561  *- - Script
562  *- - Decision
563  */
564  int set_playback_mode_stop();
565 
566  /*l
567  *b Description:
568  **
569  ** This function is shorthand for the function call
570  ** set_playback_mode(DIGUY_SCENARIO_PLAYBACK_MODE_PLAY). It is
571  ** useful for resuming a paused scenario in decisions and decision
572  ** beads.
573  **
574  *b Returns:
575  **
576  ** 0 on success, -1 on failure
577  **
578  *b Callable From:
579  **
580  *- - C++
581  *- - Script
582  *- - Decision
583  */
584  int set_playback_mode_play();
585 
586  /*l
587  *b Returns:
588  **
589  ** current playback mode as set by set_playback_mode() or the
590  ** DI-Guy Scenario user interface
591  */
592  diguyScenarioPlaybackMode get_playback_mode();
593 
594  /*l
595  *b Description:
596  **
597  ** This function derives a dt based on an input dt (usually derived
598  ** from change in realtime from previous to current frame) and the
599  ** scenario's current playback mode. The resulting dt can then be
600  ** used to advance the time passed to diguyScenario::update() so that
601  ** it emulates the effect of the VCR buttons in DI-Guy Scenario.
602  **
603  ** This function does not change the scenario's current time or
604  ** playback mode.
605  **
606  ** Examples based on a dt_in of 0.03 seconds:
607  **
608  *- - DIGUY_SCENARIO_PLAYBACK_MODE_STOP: derived_dt = 0.0
609  *- - DIGUY_SCENARIO_PLAYBACK_MODE_PLAY: derived_dt = 0.03
610  *- - DIGUY_SCENARIO_PLAYBACK_MODE_PLAY_REVERSE: derived_dt = -0.03
611  *- - DIGUY_SCENARIO_PLAYBACK_MODE_FF: derived_dt = 0.12
612  *- - DIGUY_SCENARIO_PLAYBACK_MODE_FF_REVERSE: derived_dt = -0.12
613  *- - DIGUY_SCENARIO_PLAYBACK_MODE_SS: derived_dt = frame dt
614  *- - DIGUY_SCENARIO_PLAYBACK_MODE_SS_REVERSE: derived_dt = - frame dt
615  *- - DIGUY_SCENARIO_PLAYBACK_MODE_REWIND: derived_dt = - scenario t
616  **
617  ** Note that the playback mode should be set to
618  ** DIGUY_SCENARIO_PLAYBACK_MODE_STOP after time advances in either of
619  ** the single step ("SS") modes or the rewind mode.
620  **
621  *b Arguments:
622  **
623  *a dt_in - delta time in seconds from advancing simulation time
624  */
625  float derive_playback_mode_dt(float dt_in);
626 
627  /*l
628  *b Description:
629  **
630  ** This function resets all scenario characters, signals, variables,
631  ** and all other scenario objects to their original state. Scenario
632  ** time will be set to 0.
633  **
634  *b Returns:
635  **
636  ** 0 on success, -1 on failure
637  */
638  int reset();
639 
640 
641 /*****************************************************************************/
646 #ifdef CPLUSPLUS_ONLY
647 
648  /*l
649  *b Description:
650  **
651  ** This function loads the specified scenario. Any previously loaded
652  ** scenario objects will be deleted. To merge a scenario into the
653  ** existing scenario (load without deleting existing objects), use
654  ** the call merge().
655  **
656  ** The passed filename can be either a ".dss" file, which is a DI-Guy
657  ** Scenario file, or a ".dsr" file, which is a DI-Guy Review file.
658  **
659  ** Once the file has been loaded an implicit reset() will occur.
660  **
661  *b Arguments:
662  **
663  *a filename - filename of scenario to be loaded
664  **
665  *b Returns:
666  **
667  ** 0 on success, -1 on failure
668  **
669  *b Callable From:
670  **
671  *- - C++
672  */
673  int load(const char* filename);
674 
675  /*l
676  *b Description:
677  **
678  ** Saves the scenario into its current filename. This filename will
679  ** be the most recent of:
680  **
681  *- - the filename used in a load() function call
682  *- - the filename used in a save_as() function call
683  **
684  ** The filename that will be used can be retrieved using the
685  ** get_filename() or get_filename_without_directory() functions.
686  **
687  ** Once saved the "unsaved" flag (as returned by get_unsaved()) will
688  ** be set to 0.
689  **
690  *b Returns:
691  **
692  ** 0 on success, -1 on failure
693  **
694  *b Callable From:
695  **
696  *- - C++
697  */
698  int save();
699 
700  /*l
701  *b Description:
702  **
703  ** Similar to save(), but new filename is specified by the filename
704  ** argument.
705  **
706  *b Arguments:
707  **
708  *a filename - new filename of scenario
709  **
710  *b Returns:
711  **
712  ** 0 on success, -1 on failure
713  **
714  *b Callable From:
715  **
716  *- - C++
717  */
718  int save_as(const char* filename);
719 
720  /*l
721  *b Description:
722  **
723  ** Returns the most recent of:
724  **
725  *- - the filename used in a load() function call
726  *- - the filename used in a save_as() function call
727  **
728  *b Returns:
729  **
730  ** filename of saved scenario
731  **
732  *b Callable From:
733  **
734  *- - C++
735  */
736  const char* get_filename();
737 
738  /*l
739  *b Description:
740  **
741  ** Similar to get_filename(), but with any leading directories
742  ** removed.
743  **
744  *b Callable From:
745  **
746  *- - C++
747  */
748  const char* get_filename_without_directory();
749 
750  /*l
751  *b Returns:
752  **
753  ** 1 if scenario has been modified since save or load, else 0
754  **
755  *b Callable From:
756  **
757  *- - C++
758  */
759  int get_unsaved();
760 
761  /*l
762  *b Description:
763  **
764  ** Manually sets the "unsaved" flag to the passed value.
765  **
766  *b Arguments:
767  **
768  *a unsaved - new unsaved status; 1 for unsaved, 0 for saved
769  **
770  *b Callable From:
771  **
772  *- - C++
773  */
774  void set_unsaved(int unsaved);
775 
776 
777 /*****************************************************************************/
783 #ifdef CPLUSPLUS_ONLY
784 
785  /*l
786  *b Description:
787  **
788  ** This function draws all visible elements of the loaded scenario in
789  ** immediate mode graphics environments (see below). This is the
790  ** equivalent of calling draw_pass1(), immediately followed by
791  ** draw_pass2(), immediately followed by post_draw().
792  **
793  ** Note that any character graphics culling, far position rendering,
794  ** etc., depend on the render camera set by the set_render_camera()
795  ** function. A render camera does not always need to be set; see
796  ** set_render_camera() for more details.
797  **
798  *b Returns:
799  **
800  ** 0 on success, -1 on failure
801  **
802  *i OpenGL Version:
803  **
804  ** This function immediately draws all scenario elements. Either
805  ** this function, or draw_pass1(), draw_pass2(), and post_draw(),
806  ** should be called once per frame.
807  **
808  *b Callable From:
809  **
810  *- - C++
811  */
812  int draw();
813 
814  /*l
815  *b Description:
816  **
817  ** This function, along with draw_pass2(), allows the drawing of
818  ** opaque and transparent polygons to be separated. This function
819  ** draws all opaque polygons.
820  **
821  *b Returns:
822  **
823  ** 0 on success, -1 on failure
824  **
825  *i OpenGL Version:
826  **
827  ** This function immediately draws the opaque scenario elements.
828  ** Either this function or draw() should be called once per frame.
829  **
830  *b Callable From:
831  **
832  *- - C++
833  */
834  int draw_pass1();
835 
836  /*l
837  *b Description:
838  **
839  ** Same as draw_pass1(), but draws transparent scenario elements.
840  ** The also_call_post_draw argument is set to 1 for backwards
841  ** compatibility.
842  **
843  *b Callable From:
844  **
845  *- - C++
846  */
847  int draw_pass2(int also_call_post_draw = 1);
848 
849 
850 #endif // CPLUSPLUS_ONLY
851 
852  /*l
853  *b Description:
854  **
855  ** This function draws visual elements that must be drawn after the
856  ** main render has been done.
857  **
858  ** Note that this function is called automatically by the draw()
859  ** call. Only call this function if draw() is not called; e.g.,
860  ** if draw_pass1() and draw_pass2() are used.
861  **
862  ** This function can be called from scene graph type renderers which
863  ** typically don't need or want to have the draw() function called.
864  **
865  *b Arguments:
866  **
867  *a call_plugins_post_draw - pass 1 to call plugin post_draw()
868  *a functions
869  *a call_lua_packages_draw - pass 1 to call lua package draw functions
870  *a call_post_draw_callback - pass 1 to invoke callbacks with callback
871  *a id CALLBACK_ID_POST_DRAW
872  **
873  *b Returns:
874  **
875  ** 0 on success, -1 on failure
876  */
877  int post_draw(int call_plugins_post_draw = 1,
878  int call_lua_packages_draw = 1,
879  int call_post_draw_callback = 1);
880 
881  /*l
882  *b Description:
883  **
884  ** This function sets the attachment point that to be used for
885  ** graphics created by the library.
886  **
887  *b Arguments:
888  **
889  *a graphics_attach_ptr - this is a pointer to a group-type object;
890  *a the specific type is dependent on graphics
891  *a environment
892  **
893  *b Returns:
894  **
895  ** 0 on success, -1 on failure
896  **
897  *i OpenGL Version:
898  **
899  ** This function does not have any effect.
900  **
901  *i Direct3D Version:
902  **
903  ** The passed pointer should be a LPDIRECT3DRMFRAME2.
904  **
905  *e LPDIRECT3DRMFRAME2 attach_frame = get_scene_frame();
906  *e scenario->set_graphics_attach_ptr(attach_frame);
907  **
908  **
909  *b Callable From:
910  **
911  *- - C++
912  */
913  int set_graphics_attach_ptr(void* graphics_attach_ptr);
914 
915 #endif // CPLUSPLUS_ONLY
916 
917 
918 /*****************************************************************************/
928  /*l
929  *b Description:
930  **
931  ** This function creates a merge settings object. This object can
932  ** allow for fine control over which elements in a scenario are
933  ** merged during a merge() call, and what to do if there is a
934  ** collision with an existing element.
935  **
936  ** Once the initial settings are made based on the initial_settings
937  ** argument, the settings can be fine-tuned by calling member
938  ** functions of the diguyScenarioMergeSettings object.
939  **
940  ** Destroy the object with a call to destroy_merge_settings().
941  **
942  *b Arguments:
943  **
944  *a initial_settings - what the initial settings should be when
945  *a the object is created
946  **
947  *i DIGUY_MERGE_INITIAL_SETTINGS_DEFAULT
948  **
949  *a scenario settings - DIGUY_MERGE_FLAG_DONT_MERGE
950  *a current view settings - DIGUY_MERGE_FLAG_OVERWRITE_EXISTING
951  *a character - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
952  *a decision - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
953  *a formation - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
954  *a group - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
955  *a guide - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
956  *a info popup - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
957  *a library function - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
958  *a script - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
959  *a sensor region - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
960  *a signal - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
961  *a variables - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
962  *a camera settings - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
963  *a face exp - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
964  *a fog settings - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
965  *a light settings - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
966  *a particle system - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
967  *a path shape - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
968  *a scene object - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
969  *a scene object grid - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
970  *a sound - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
971  **
972  *i DIGUY_MERGE_INITIAL_SETTINGS_MERGE_EVERYTHING
973  **
974  *a scenario settings - DIGUY_MERGE_FLAG_OVERWRITE_EXISTING
975  *a current view settings - DIGUY_MERGE_FLAG_OVERWRITE_EXISTING
976  *a character - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
977  *a decision - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
978  *a formation - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
979  *a group - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
980  *a guide - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
981  *a info popup - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
982  *a library function - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
983  *a script - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
984  *a sensor region - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
985  *a signal - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
986  *a variables - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
987  *a camera settings - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
988  *a face exp - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
989  *a fog settings - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
990  *a light settings - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
991  *a particle system - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
992  *a path shape - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
993  *a scene object - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
994  *a scene object grid - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
995  *a sound - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
996  **
997  *i DIGUY_MERGE_INITIAL_SETTINGS_MERGE_NOTHING
998  **
999  *a scenario settings - DIGUY_MERGE_FLAG_DONT_MERGE
1000  *a current view settings - DIGUY_MERGE_FLAG_DONT_MERGE
1001  *a character - DIGUY_MERGE_FLAG_DONT_MERGE
1002  *a decision - DIGUY_MERGE_FLAG_DONT_MERGE
1003  *a formation - DIGUY_MERGE_FLAG_DONT_MERGE
1004  *a group - DIGUY_MERGE_FLAG_DONT_MERGE
1005  *a guide - DIGUY_MERGE_FLAG_DONT_MERGE
1006  *a info popup - DIGUY_MERGE_FLAG_DONT_MERGE
1007  *a library function - DIGUY_MERGE_FLAG_DONT_MERGE
1008  *a script - DIGUY_MERGE_FLAG_DONT_MERGE
1009  *a sensor region - DIGUY_MERGE_FLAG_DONT_MERGE
1010  *a signal - DIGUY_MERGE_FLAG_DONT_MERGE
1011  *a variables - DIGUY_MERGE_FLAG_DONT_MERGE
1012  *a camera settings - DIGUY_MERGE_FLAG_DONT_MERGE
1013  *a face exp - DIGUY_MERGE_FLAG_DONT_MERGE
1014  *a fog settings - DIGUY_MERGE_FLAG_DONT_MERGE
1015  *a light settings - DIGUY_MERGE_FLAG_DONT_MERGE
1016  *a particle system - DIGUY_MERGE_FLAG_DONT_MERGE
1017  *a path shape - DIGUY_MERGE_FLAG_DONT_MERGE
1018  *a scene object - DIGUY_MERGE_FLAG_DONT_MERGE
1019  *a scene object grid - DIGUY_MERGE_FLAG_DONT_MERGE
1020  *a sound - DIGUY_MERGE_FLAG_DONT_MERGE
1021  **
1022  *i DIGUY_MERGE_INITIAL_SETTINGS_DIGUY6_COMPATIBLE
1023  **
1024  *a scenario settings - DIGUY_MERGE_FLAG_OVERWRITE_EXISTING
1025  *a current view settings - DIGUY_MERGE_FLAG_OVERWRITE_EXISTING
1026  *a character - DIGUY_MERGE_FLAG_RENAME_MERGED_AND_WARN
1027  *a decision - DIGUY_MERGE_FLAG_KEEP_BOTH
1028  *a formation - DIGUY_MERGE_FLAG_KEEP_BOTH
1029  *a group - DIGUY_MERGE_FLAG_KEEP_BOTH
1030  *a guide - DIGUY_MERGE_FLAG_KEEP_BOTH
1031  *a info popup - DIGUY_MERGE_FLAG_KEEP_BOTH
1032  *a library function - DIGUY_MERGE_FLAG_KEEP_BOTH
1033  *a script - DIGUY_MERGE_FLAG_KEEP_BOTH
1034  *a sensor region - DIGUY_MERGE_FLAG_KEEP_BOTH
1035  *a signal - DIGUY_MERGE_FLAG_KEEP_BOTH
1036  *a variables - DIGUY_MERGE_FLAG_KEEP_BOTH
1037  *a camera settings - DIGUY_MERGE_FLAG_KEEP_BOTH
1038  *a face exp - DIGUY_MERGE_FLAG_KEEP_BOTH
1039  *a fog settings - DIGUY_MERGE_FLAG_KEEP_BOTH
1040  *a light settings - DIGUY_MERGE_FLAG_KEEP_BOTH
1041  *a particle system - DIGUY_MERGE_FLAG_KEEP_EXISTING_ONLY_AND_WARN
1042  *a path shape - DIGUY_MERGE_FLAG_KEEP_BOTH
1043  *a scene object - DIGUY_MERGE_FLAG_RENAME_MERGED_IF_NOT_EQUAL
1044  *a scene object grid - DIGUY_MERGE_FLAG_KEEP_BOTH
1045  *a sound - DIGUY_MERGE_FLAG_KEEP_BOTH
1046  **
1047  *b Returns:
1048  **
1049  ** object of type diguyScenarioMergeSettings
1050  */
1052 
1053  /*l
1054  *b Description:
1055  **
1056  ** This function destroys a merge settings object created by
1057  ** a call to create_merge_settings().
1058  */
1059  void destroy_merge_settings(diguyScenarioMergeSettings* merge_settings);
1060 
1061  /*l
1062  *b Description:
1063  **
1064  ** This function merges the specified scenario. Any previously loaded
1065  ** scenario elements will be retained, depending on settings in
1066  ** the merge_settings argument.
1067  **
1068  *b Arguments:
1069  **
1070  *a filename - filename of scenario to be merged
1071  *a merge_settings - object that controls how elements are merged;
1072  *a pass NULL for default merge handling
1073  **
1074  *b Returns:
1075  **
1076  ** 0 on success, -1 on failure
1077  */
1078  int merge(const char* filename,
1079  diguyScenarioMergeSettings* merge_settings = NULL);
1080 
1081  /*l
1082  *b Description:
1083  **
1084  * Documentation Pending
1085  **
1086  ** This function performs a "micro merge", allowing a scenario to
1087  ** merge in the contents of a text string representing a single
1088  ** object.
1089  **
1090  ** On example of use is for a Lua Package to contain a number of
1091  ** text strings representing particle systems or sounds that an agent
1092  ** need will need. When needed objects in text form can be merged
1093  ** into the scenario using this function.
1094  **
1095  ** The DI-Guy Scenario Particle System page has a "Display Object
1096  ** Text" button that can display the object text of a particle system
1097  ** that is appropriate for use by this function. Other object pages
1098  ** that have this button are Sound, Formation, and Crowd Profile.
1099  **
1100  ** Text can also be taken directly from .dss files.
1101  **
1102  ** See also the diguyCharacter::merge_object() function.
1103  **
1104  ** Note: the parser is very sensitive to tabs and formatting!
1105  */
1106  int merge_object(const char* string);
1107 
1108  /*l
1109  *b Description:
1110  **
1111  ** This function makes the objects in the specified library available
1112  ** for use in the scenario.
1113  **
1114  ** Object libraries allow new content to be created in one scenario
1115  ** and automatically shared to other scenarios. When including a
1116  ** library, objects that are already in the scenario are preserved.
1117  **
1118  ** A library with specified name must be available for inclusion.
1119  ** Object libraries are located in the
1120  ** $(DIGUY)/config/diguy/object_libraries and
1121  ** $(DIGUY)/custom/config/diguy/object_libraries directories. The
1122  ** filename for the library must be "library_[libname].cfg".
1123  **
1124  ** Available object libraries in these directories will automatically
1125  ** be detected by the scenario, but objects in the libraries will not
1126  ** be included in the scenario until this function is called.
1127  **
1128  ** For example, if the objects in the file "library_crowd_sounds.cfg"
1129  ** should be made available in the scenario, the library name
1130  ** "crowd_sounds" should be passed into this function.
1131  **
1132  ** Currently the following object types can be in libraries:
1133  **
1134  *- - particle system
1135  *- - formation
1136  *- - crowd profile
1137  *- - sound
1138  **
1139  *b Arguments:
1140  **
1141  *a library_name - name of library
1142  **
1143  *b Returns:
1144  **
1145  ** 0 on success, -1 on failure
1146  */
1147  int include_object_library(const char* library_name);
1148 
1149  /*l
1150  *b Description:
1151  **
1152  ** This function is the opposite of include_object_library().
1153  ** Objects in the named library are made unavailable to the scenario.
1154  **
1155  *b Arguments:
1156  **
1157  *a library_name - name of library
1158  **
1159  *b Returns:
1160  **
1161  ** 0 on success, -1 on failure
1162  */
1163  int uninclude_object_library(const char* library_name);
1164 
1165 
1166 /*****************************************************************************/
1176  /******************************************************
1177  **
1178  *4 Datetime Functions
1179  **
1180  */
1181 
1182  /*l
1183  *b Description:
1184  **
1185  ** This function will set what the current datetime will be when the
1186  ** scanario is reset.
1187  **
1188  ** Pass -1 for values that should be set based on current datetime.
1189  **
1190  ** Note that if set_base_datetime_default_to_now() and
1191  ** set_base_datetime_default_to_today() can override these values.
1192  */
1193  void set_base_datetime(int year = -1,
1194  int month = -1,
1195  int day = -1,
1196  int hour = -1,
1197  int minute = -1,
1198  int second = -1,
1199  int msec = -1);
1200 
1201  /*l
1202  *b Description:
1203  **
1204  ** Similar to set_base_datetime(), but datetime is stored in the
1205  ** passed string, formatted in the passed format string.
1206  */
1207  void set_base_datetime(const char* datetime_string,
1208  const char* format);
1209 
1210  /*l
1211  *b Description:
1212  **
1213  ** Retrieves the base datetime. Pass NULL for arguments that aren't
1214  ** needed.
1215  */
1216  void get_base_datetime(int* year = NULL,
1217  int* month = NULL,
1218  int* day = NULL,
1219  int* hour = NULL,
1220  int* minute = NULL,
1221  int* second = NULL,
1222  int* msec = NULL);
1223 
1224  /*l
1225  *b Description:
1226  **
1227  ** Setting this value to 1 will cause the time part of the datetime to
1228  ** be set to whatever "real" time it is when reset() is called,
1229  ** instead of the time stored in the base datetime as set by
1230  ** set_base_datetime(). For example, if it is 10:30 AM in "real time"
1231  ** when the scenario is reset, the current time will be set to
1232  ** 10:30:00:000 on reset.
1233  **
1234  ** Setting this value to 0 will restore the default behavior.
1235  */
1236  void set_base_datetime_default_to_now(int to_now);
1237 
1238  /*l
1239  *b Returns:
1240  **
1241  ** 1 if the current time will be set to the "real time" on reset,
1242  ** 0 is not
1243  */
1244  int get_base_datetime_default_to_now();
1245 
1246  /*l
1247  *b Description:
1248  **
1249  ** Similar to set_base_datetime_default_to_now(), but for the date
1250  ** part of the datetime.
1251  */
1252  void set_base_datetime_default_to_today(int to_today);
1253 
1254  /*l
1255  *b Returns:
1256  **
1257  ** 1 if the current date will be set to the "real date" on reset,
1258  ** 0 is not
1259  */
1260  int get_base_datetime_default_to_today();
1261 
1262  /*l
1263  *b Description:
1264  **
1265  ** Allows current datetime to be explicitly set. Note that in most
1266  ** cases the current datetime should be set by the base datetime plus
1267  ** how much time has advanced in the scenario.
1268  **
1269  ** This function can be useful if the datetime needs to be syncronized
1270  ** with that from another source, say, from network exercise data.
1271  */
1272  void set_current_datetime(int year = -1,
1273  int month = -1,
1274  int day = -1,
1275  int hour = -1,
1276  int minute = -1,
1277  int second = -1,
1278  int msec = -1);
1279 
1280  /*l
1281  *b Description:
1282  **
1283  ** Similar to set_current_datetime(), but datetime is stored in the
1284  ** passed string, formatted in the passed format string.
1285  */
1286  void set_current_datetime(const char* datetime_string,
1287  const char* format);
1288 
1289  /*l
1290  *b Description:
1291  **
1292  ** Retrieves the current datetime. Pass NULL for arguments that
1293  ** aren't needed.
1294  */
1295  void get_current_datetime(int* year = NULL,
1296  int* month = NULL,
1297  int* day = NULL,
1298  int* hour = NULL,
1299  int* minute = NULL,
1300  int* second = NULL,
1301  int* msec = NULL);
1302 
1303  /*l
1304  *b Description:
1305  **
1306  ** Retrieves the current datetime in string format.
1307  **
1308  *b Arguments:
1309  **
1310  *a format - format returned string should be in; pass NULL for default
1311  *a "M/d/yyyy h:mm:ss AP" format
1312  */
1313  const char* get_current_datetime_string(const char* format);
1314 
1315  /*l
1316  *b Description:
1317  **
1318  ** Pass 1 to specify that datetimes use UTC time, 0 to specify they
1319  ** are local time.
1320  */
1321  void set_datetimes_are_utc(int are_utc);
1322 
1323  /*l
1324  *b Returns:
1325  **
1326  ** 1 if datetimes use UTC time, 0 if not
1327  */
1328  int get_datetimes_are_utc();
1329 
1330  /*l
1331  *b Description:
1332  **
1333  ** If datetimes use UTC time, this function sets the offset hours
1334  ** of the current time from UTC.
1335  */
1336  void set_utc_offset_hours(float utc_offset_hours);
1337 
1338  /*l
1339  *b Returns:
1340  **
1341  ** offset in hours of datetimes from UTC
1342  */
1343  float get_utc_offset_hours();
1344 
1345  /*l
1346  *b Description:
1347  **
1348  ** Documentation Pending
1349  */
1350  void set_use_local_tz_utc_offset_hours(int use_local_tz);
1351 
1352  /*l
1353  *b Description:
1354  **
1355  ** Documentation Pending
1356  */
1357  int get_use_local_tz_utc_offset_hours();
1358 
1359  /*l
1360  *b Description:
1361  **
1362  ** Documentation Pending
1363  */
1364  void set_current_datetime_advance_method(diguyDatetimeAdvanceMethod advance_method);
1365 
1366  /*l
1367  *b Description:
1368  **
1369  ** Documentation Pending
1370  */
1371  diguyDatetimeAdvanceMethod get_current_datetime_advance_method();
1372 
1373  /*l
1374  *b Description:
1375  **
1376  ** Documentation Pending
1377  */
1378  void set_current_datetime_advance_factor(float advance_factor);
1379 
1380  /*l
1381  *b Description:
1382  **
1383  ** Documentation Pending
1384  */
1385  float get_current_datetime_advance_factor();
1386 
1387  /*l
1388  *b Description:
1389  **
1390  ** Documentation Pending
1391  */
1392  void get_network_datetime(int* year = NULL,
1393  int* month = NULL,
1394  int* day = NULL,
1395  int* hour = NULL,
1396  int* minute = NULL,
1397  int* second = NULL,
1398  int* msec = NULL);
1399 
1400 
1401  /******************************************************
1402  **
1403  *4 Simple Time Functions
1404  **
1405  */
1406 
1407  /*l
1408  *b Description:
1409  **
1410  ** This function sets the time of day which corresponds to scenario
1411  ** tin. It is a wall-clock time, and has no date content.
1412  **
1413  ** Note that if more detailed time and date information is needed
1414  ** refer to the "datetime" functions.
1415  **
1416  *b Arguments:
1417  **
1418  *a t - number of seconds after midnight; zero means
1419  *a midnight; 86399.0 means 11:59:59 pm
1420  **
1421  *b Returns:
1422  **
1423  ** 0 on success, -1 on failure
1424  */
1425  int set_tin_time_of_day(float t);
1426 
1427  /*l
1428  *b Description:
1429  **
1430  ** This function returns what time of day corresponds to scenario tin.
1431  ** It is a wall-clock time, and has no date content.
1432  **
1433  ** See set_tin_time_of_day().
1434  **
1435  ** Note that if more detailed time and date information is needed
1436  ** refer to the "datetime" functions.
1437  **
1438  *b Returns:
1439  **
1440  ** number of seconds after midnight
1441  */
1442  float get_tin_time_of_day();
1443 
1444  /*l
1445  *b Description:
1446  **
1447  ** This function returns what the simulated time of day is right now.
1448  ** It is computed by adding (scenario t - tin) to the value passed to
1449  ** set_tin_time_of_day();
1450  **
1451  ** See set_tin_time_of_day().
1452  **
1453  ** Note that if more detailed time and date information is needed
1454  ** refer to the "datetime" functions.
1455  **
1456  *b Returns:
1457  **
1458  ** number of seconds after midnight (simulated time of day)
1459  */
1460  float get_time_of_day();
1461 
1462 
1463 /*****************************************************************************/
1473 #ifdef CPLUSPLUS_ONLY
1474 
1475  /*l
1476  *b Description:
1477  **
1478  ** This function adds an appearance with the given name to the list of
1479  ** available appearances. If an appearance with the given name
1480  ** already exists the operation will fail and a message will be
1481  ** printed at debug level to the output log.
1482  **
1483  ** Internal copies are made of the passed strings.
1484  **
1485  *b Arguments:
1486  **
1487  *a appearance - name of the appearance
1488  *a equipment_list - NULL-terminated list of equipment that
1489  *a makes up the appearance
1490  *a character_types - NULL-terminated list of character types
1491  *a that this appearance will be available to
1492  *a actor - name of the actor this appearance fits
1493  **
1494  ** If NULL is passed for the actor argument the actor will
1495  ** be set to match the actor of the first character type
1496  ** in the character_types array.
1497  **
1498  *b Returns:
1499  **
1500  ** 0 on success, -1 on failure
1501  **
1502  *b Callable From:
1503  **
1504  *- - C++
1505  */
1506  int add_appearance(const char* appearance,
1507  char** equipment_list,
1508  char** character_types,
1509  const char* actor);
1510 
1511  /*l
1512  *b Description:
1513  **
1514  ** This function is similar to add_appearance(), but adds
1515  ** equipment_list shapes to an existing appearance.
1516  **
1517  ** The character types that the new appearance will be available to
1518  ** will match that of the specified existing appearance.
1519  **
1520  *b Arguments:
1521  **
1522  *a appearance - name of the new appearance
1523  *a existing_appearance - name of the existing appearance on which to
1524  *a base new appearance
1525  *a equipment_list - NULL-terminated list of equipment to add to
1526  ** the existing appearance
1527  **
1528  *b Returns:
1529  **
1530  ** 0 on success, -1 on failure
1531  **
1532  *b Callable From:
1533  **
1534  *- - C++
1535  */
1536  int add_appearance_based_on_existing_appearance(const char* appearance,
1537  const char* existing_appearance,
1538  char** equipment_list);
1539 
1540  /*l
1541  *b Description:
1542  **
1543  ** This function removes an appearance with the given name
1544  ** from the list of available appearances. If an appearance with
1545  ** the given name does not exist the operation will fail and
1546  ** a message will be printed at debug level to the output log.
1547  **
1548  *b NOTE:
1549  **
1550  ** Currently no check is made for whether the appearance is
1551  ** in use by a character. Removing an in-use appearance will
1552  ** result in undefined behavior.
1553  **
1554  *b Arguments:
1555  **
1556  *a appearance - name of the appearance
1557  **
1558  *b Returns:
1559  **
1560  ** 0 on success, -1 on failure
1561  **
1562  *b Callable From:
1563  **
1564  *- - C++
1565  */
1566  int remove_appearance(const char* appearance);
1567 
1568 #endif // CPLUSPLUS_ONLY
1569 
1570  /*l
1571  *b Description:
1572  **
1573  ** This function returns the number of character types associated with
1574  ** the given appearance, if any.
1575  **
1576  *b Arguments:
1577  **
1578  *a appearance - name of the appearance
1579  **
1580  *b Returns:
1581  **
1582  ** the number of character types, or 0
1583  */
1584  int get_num_character_types_with_appearance(const char* appearance_name);
1585 
1586  /*l
1587  *b Description:
1588  **
1589  ** This function returns one of the character types associated with
1590  ** the appearance, if any exists
1591  **
1592  *b Arguments:
1593  **
1594  *a appearance - name of the appearance
1595  *a index - which character type of the set to return
1596  **
1597  *b Returns:
1598  **
1599  ** a character type name on success, "none" on failure
1600  */
1601  const char *get_character_type_from_appearance(const char* appearance_name, int index = 0);
1602 
1603 
1604 /*****************************************************************************/
1614  /*l
1615  *b Description:
1616  **
1617  ** Gets the hand item class associated with a character type.
1618  **
1619  *b Arguments:
1620  **
1621  *a char_type_name - name of the char type
1622  *a appearance_name - optional appearance name, which might yield
1623  *a different results
1624  **
1625  *b Returns:
1626  **
1627  ** Name of hand item class on success, "none" on failure
1628  */
1629  const char *get_hand_item_class(const char *char_type_name, const char *appearance_name = NULL);
1630 
1631  /*l
1632  *b Description:
1633  **
1634  ** Gets the number of hand items in a particular hand item class.
1635  **
1636  *b Arguments:
1637  **
1638  *a hand_item_class - name of hand item class
1639  **
1640  *b Returns:
1641  **
1642  ** Number of hand items in class
1643  */
1644  int get_num_hand_items_in_class(const char *hand_item_class);
1645 
1646  /*l
1647  *b Description:
1648  **
1649  ** Gets the name of a hand item within the set associated with
1650  ** a hand item class.
1651  **
1652  *b Arguments:
1653  **
1654  *a hand_item_class - name of hand item class
1655  *a index - index within set
1656  **
1657  *b Returns:
1658  **
1659  ** Name of hand item, or "none"
1660  */
1661  const char *get_hand_item_from_class(const char *hand_item_class, int index);
1662 
1663 /*****************************************************************************/
1673  /*l
1674  *b Description:
1675  **
1676  ** This function preloads all base motions and the default
1677  ** appearance for the specified character type.
1678  **
1679  ** This can be done during initialization to preload characters that
1680  ** will be needed later in a scenario, to avoid a hitch in frame rate
1681  ** when the characters are loaded.
1682  **
1683  *b Arguments:
1684  **
1685  *a character_type - character type name, as returned by
1686  *a get_character_type_at_index(), for example
1687  **
1688  *b Returns:
1689  **
1690  ** 0 on success, -1 on failure
1691  */
1692  int preload_character_type(const char* character_type);
1693 
1694  /*l
1695  *b Description:
1696  **
1697  ** This function preloads all geometry for the specified appearance.
1698  ** This can be done during initialization to preload geometry that
1699  ** will be needed later in a scenario, to avoid a hitch in frame rate
1700  ** when the geometry is loaded.
1701  **
1702  *b Arguments:
1703  **
1704  *a appearance - name of the appearance whose geometry is to be
1705  *a preloaded
1706  **
1707  *b Returns:
1708  **
1709  ** 0 on success, -1 on failure
1710  */
1711  int preload_appearance(const char* appearance);
1712 
1713  /*l
1714  *b Description:
1715  **
1716  ** This function preloads all motions for the specified gesture
1717  ** for the specified character type.
1718  **
1719  ** This can be done during initialization to preload gestures that
1720  ** will be needed later in a scenario, to avoid a hitch in frame rate
1721  ** when the motions are loaded.
1722  **
1723  *b Arguments:
1724  **
1725  *a character_type - character's type
1726  *a gesture_name - name of the gesture to preload
1727  **
1728  *b Returns:
1729  **
1730  ** 0 on success, -1 on failure
1731  */
1732  int preload_gesture(const char* character_type, const char* gesture_name);
1733 
1734 
1735 /*****************************************************************************/
1750  /*l
1751  *b Description:
1752  **
1753  ** This function enables character culling.
1754  **
1755  ** This function works only in the OpenGL version when a valid render
1756  ** camera is set.
1757  */
1758  void set_character_culling_enabled(int character_culling);
1759 
1760  /*l
1761  *b Description:
1762  **
1763  ** This function gets the state of character culling.
1764  **
1765  ** This function works only in the OpenGL version when a valid render
1766  ** camera is set.
1767  **
1768  *b Returns:
1769  **
1770  ** 1 if enabled, 0 if disabled.
1771  */
1772  int get_character_culling_enabled();
1773 
1774  /*l
1775  *b Description:
1776  **
1777  ** This function enables scene object culling.
1778  **
1779  ** This function works only in the OpenGL version when a
1780  ** valid render camera is set.
1781  */
1782  void set_scene_object_culling_enabled(int object_culling);
1783 
1784  /*l
1785  *b Description:
1786  **
1787  ** This function get the state of scene object culling.
1788  **
1789  ** This function works only in the OpenGL version when a
1790  ** valid render camera is set.
1791  **
1792  *b Returns:
1793  **
1794  ** 1 if enabled, 0 if disabled
1795  */
1796  int get_scene_object_culling_enabled();
1797 
1798  /*l
1799  *b Description:
1800  **
1801  ** This function enables scene object sub object culling.
1802  **
1803  ** This function works only in the OpenGL version when a
1804  ** valid render camera is set.
1805  */
1806  void set_scene_object_sub_culling_enabled(int object_culling);
1807 
1808  /*l
1809  *b Description:
1810  **
1811  ** This function get the state of scene object sub culling.
1812  **
1813  ** This function works only in the OpenGL version when a
1814  ** valid render camera is set.
1815  **
1816  *b Returns:
1817  **
1818  ** 1 if enabled, 0 if disabled
1819  */
1820  int get_scene_object_sub_culling_enabled();
1821 
1822  /*l
1823  *b Description:
1824  **
1825  ** This function enables visualizing a character's bounding
1826  ** volume.
1827  **
1828  ** This function works only in the OpenGL version when a
1829  ** valid render camera is set.
1830  */
1831  void set_character_visualize_bounds_enabled(int visualize_bounds);
1832 
1833  /*l
1834  *b Description:
1835  **
1836  ** This function get the state of character bounding volume
1837  ** visualization.
1838  **
1839  ** This function works only in the OpenGL version when a
1840  ** valid render camera is set.
1841  **
1842  *b Returns:
1843  **
1844  ** 1 if enabled, 0 if disabled
1845  */
1846  int get_character_visualize_bounds_enabled();
1847 
1848  /*l
1849  *b Description:
1850  **
1851  ** This function enables visualizing a scene object's bounding
1852  ** volume.
1853  **
1854  ** This function works only in the OpenGL version when a
1855  ** valid render camera is set.
1856  */
1857  void set_scene_object_visualize_bounds_enabled(int val);
1858 
1859  /*l
1860  *b Description:
1861  **
1862  ** This function gets the state of scene objects bounding volume
1863  ** visualization.
1864  **
1865  ** This function works only in the OpenGL version when a
1866  ** valid render camera is set.
1867  **
1868  *b Returns:
1869  **
1870  ** 1 if enabled, 0 if disabled
1871  */
1872  int get_scene_object_visualize_bounds_enabled();
1873 
1874 
1875 /*****************************************************************************/
1934  /*l
1935  *b Returns:
1936  **
1937  ** number of available character types
1938  */
1939  int get_num_character_types();
1940 
1941  /*l
1942  *b Returns:
1943  **
1944  ** the string identifying the character type at the given index
1945  **
1946  *b Arguments:
1947  **
1948  *a index - index of the character type; indices start at 0
1949  */
1950  const char* get_character_type_at_index(int index);
1951 
1952  /*l
1953  *b Returns:
1954  **
1955  ** abbreviation of the given character type, when a shorter
1956  ** identifier is needed
1957  **
1958  *b Arguments:
1959  **
1960  *a character_type - character type name, as returned by
1961  *a get_character_type_at_index(), for example
1962  */
1963  const char* get_character_type_abbreviation(const char* character_type);
1964 
1965  /*l
1966  *b Description:
1967  **
1968  ** This function returns the version at which the specified
1969  ** character type was deprecated.
1970  **
1971  ** If the character type has not been deprecated, the empty string
1972  ** ("") is returned.
1973  **
1974  *b Arguments:
1975  **
1976  *a character_type - character type name, as returned by
1977  *a get_character_type_at_index(), for example
1978  **
1979  *b Returns:
1980  **
1981  ** version at which character became deprecated; empty string ("")
1982  ** if it hasn't been
1983  **
1984  *b C++ Example:
1985  **
1986  *e const char* version = scenario->get_character_type_deprecated_at_version();
1987  *e if (strlen(version) > 0)
1988  *e {
1989  *e // do something
1990  *e }
1991  */
1992  const char* get_character_type_deprecated_at_version(const char* character_type);
1993 
1994  /*l
1995  *b Description:
1996  **
1997  ** This function returns the suggested character type(s) that are
1998  ** recommended for deprecated character types.
1999  **
2000  ** If the character type has not been deprecated, the empty string
2001  ** ("") is returned.
2002  **
2003  ** If there is more than one suggested alternative, they will be
2004  ** separated by spaces.
2005  **
2006  *b Arguments:
2007  **
2008  *a character_type - character type name, as returned by
2009  *a get_character_type_at_index(), for example
2010  **
2011  *b Returns:
2012  **
2013  ** suggested replacement character type(s)
2014  **
2015  *b C++ Example:
2016  **
2017  *e const char* alternatives = scenario->get_character_type_deprecated_suggested_alternatives();
2018  *e if (strlen(version) > 0)
2019  *e {
2020  *e // do something
2021  *e }
2022  */
2023  const char* get_character_type_deprecated_suggested_alternatives(const char* character_type);
2024 
2025  /*l
2026  *b Description:
2027  **
2028  ** As the number of character types DI-Guy provides has grown,
2029  ** newer character types tend to be better than older ones.
2030  ** This can be because of a greater selection of actions, better
2031  ** quality motions, and other factors.
2032  **
2033  ** This function returns a value representing a qualitative "bias"
2034  ** of this character they relative to other character types.
2035  ** The higher the bias, the more recommended the character type is.
2036  ** A bias of 1 means strongly not recommended, 5 means average,
2037  ** 10 means highly recommended.
2038  **
2039  *b Returns:
2040  **
2041  ** quality bias, a unitless value from 1 to 10
2042  **
2043  *b Arguments:
2044  **
2045  *a character_type - character type name, as returned by
2046  *a get_character_type_at_index(), for example
2047  */
2048  int get_character_type_quality_bias(const char* character_type);
2049 
2050  /*l
2051  *b Description:
2052  **
2053  ** This function returns the type map of the specified character
2054  ** type. See the documentation for diguyCharacterTypeMap for what
2055  ** this information means.
2056  **
2057  ** Only the character type fields will have useful information; the
2058  ** appearance fields will contain default wildcard values.
2059  **
2060  *b Arguments:
2061  **
2062  *a character_type - character type name, as returned by
2063  *a get_character_type_at_index(), for example
2064  **
2065  *b Returns:
2066  **
2067  ** pointer to type diguyCharacterTypeMap; will never be NULL
2068  */
2069  diguyCharacterTypeMap* get_character_type_map(const char* character_type);
2070 
2071  /*l
2072  *b Returns:
2073  **
2074  ** default appearance of the specified character type
2075  **
2076  *b Arguments:
2077  **
2078  *a character_type - character type name, as returned by
2079  *a get_character_type_at_index(), for example
2080  */
2081  const char* get_character_type_default_appearance(const char* character_type);
2082 
2083  /*l
2084  *b Returns:
2085  **
2086  ** default skinned appearance of the specified character type
2087  **
2088  *b Arguments:
2089  **
2090  *a character_type - character type name, as returned by
2091  *a get_character_type_at_index(), for example
2092  */
2093  const char* get_character_type_default_skinned_appearance(const char* character_type);
2094 
2095  /*l
2096  *b Returns:
2097  **
2098  ** number of available appearances for the given character type
2099  **
2100  *b Arguments:
2101  **
2102  *a character_type - character type name, as returned by
2103  *a get_character_type_at_index(), for example
2104  */
2105  int get_character_type_num_appearances(const char* character_type);
2106 
2107  /*l
2108  *b Returns:
2109  **
2110  ** the string identifying the appearance at the given index for
2111  ** the specified character type
2112  **
2113  *b Arguments:
2114  **
2115  *a character_type - character type name, as returned by
2116  *a get_character_type_at_index(), for example
2117  *a index - index of the appearance; indices start at 0
2118  */
2119  const char* get_character_type_appearance_at_index(const char* character_type,
2120  int index);
2121 
2122  /*l
2123  *b Returns:
2124  **
2125  ** number of available actions for the given character type
2126  **
2127  *b Arguments:
2128  **
2129  *a character_type - character type name, as returned by
2130  *a get_character_type_at_index(), for example
2131  */
2132  int get_character_type_num_actions(const char* character_type);
2133 
2134  /*l
2135  *b Returns:
2136  **
2137  ** the string identifying the action at the given index for
2138  ** the specified character type
2139  **
2140  *b Arguments:
2141  **
2142  *a character_type - character type name, as returned by
2143  *a get_character_type_at_index(), for example
2144  *a index - index of the action name; indices start at 0
2145  */
2146  const char* get_character_type_action_at_index(const char* character_type,
2147  int index);
2148 
2149  /*l
2150  *b Returns:
2151  **
2152  ** the average speed of the specified action for
2153  ** the specified character type
2154  **
2155  *b Arguments:
2156  **
2157  *a character_type - character type name, as returned by
2158  *a get_character_type_at_index(), for example
2159  *a action_name - the action to query
2160  */
2161  float get_character_type_action_speed(const char* character_type,
2162  const char* action_name);
2163 
2164  /*l
2165  *b Returns:
2166  **
2167  ** the duration of one rep of the specified action for
2168  ** the specified character type
2169  **
2170  *b Arguments:
2171  **
2172  *a character_type - character type name, as returned by
2173  *a get_character_type_at_index(), for example
2174  *a action_name - the action to query
2175  */
2176  float get_character_type_action_duration(const char* character_type,
2177  const char* action_name);
2178 
2179  /*l
2180  *b Returns:
2181  **
2182  ** the distance covered by one rep of the specified action for
2183  ** the specified character type
2184  **
2185  *b Arguments:
2186  **
2187  *a character_type - character type name, as returned by
2188  *a get_character_type_at_index(), for example
2189  *a action_name - the action to query
2190  */
2191  float get_character_type_action_distance(const char* character_type,
2192  const char* action_name);
2193 
2194  /*l
2195  *b Returns:
2196  **
2197  ** the diguyMotionDirection identifying the direction of travel of the
2198  ** specified action for the specified character type
2199  **
2200  *b Arguments:
2201  **
2202  *a character_type - character type name, as returned by
2203  *a get_character_type_at_index(), for example
2204  *a action_name - the action to query
2205  */
2206  diguyMotionDirection get_character_type_action_direction(
2207  const char* character_type,
2208  const char* action_name);
2209 
2210  /*l
2211  *b Returns:
2212  **
2213  ** the facing angle at the start of each repetition of the
2214  ** specified action for the specified character type, in degrees
2215  **
2216  *b Arguments:
2217  **
2218  *a character_type - character type name, as returned by
2219  *a get_character_type_at_index(), for example
2220  *a action_name - the action to query
2221  */
2222  float get_character_type_action_facing_angle_in(const char* character_type,
2223  const char* action_name);
2224 
2225  /*l
2226  *b Returns:
2227  **
2228  ** the facing angle at the end of each repetition of the
2229  ** specified action for the specified character type, in degrees
2230  **
2231  *b Arguments:
2232  **
2233  *a character_type - character type name, as returned by
2234  *a get_character_type_at_index(), for example
2235  *a action_name - the action to query
2236  */
2237  float get_character_type_action_facing_angle_out(const char* character_type,
2238  const char* action_name);
2239 
2240  /*l
2241  *b Returns:
2242  **
2243  ** the number of gestures available to
2244  ** the specified character type
2245  **
2246  *b Arguments:
2247  **
2248  *a character_type - character type name, as returned by
2249  *a get_character_type_at_index(), for example;
2250  *a pass "all" to get all gestures available,
2251  *a regardless of character type
2252  */
2253  int get_character_type_num_gestures(const char* character_type);
2254 
2255  /*l
2256  *b Returns:
2257  **
2258  ** the name of the gesture available to the specified
2259  ** character type at the specified index
2260  **
2261  *b Arguments:
2262  **
2263  *a character_type - character type name, as returned by
2264  *a get_character_type_at_index(), for example;
2265  *a pass "all" to get all gestures available,
2266  *a regardless of character type
2267  *a index - index of the gesture; indices start at 0
2268  */
2269  const char* get_character_type_gesture_at_index(const char* character_type,
2270  int index);
2271 
2272 
2273 /*****************************************************************************/
2283  /*l
2284  *b Description:
2285  **
2286  ** This function creates a new character and returns a
2287  ** pointer to it.
2288  **
2289  ** The function preload_character_type() should be called
2290  ** at the beginning of a scenario in which this call will
2291  ** be made to avoid a hitch in frame rate.
2292  **
2293  ** See also retrieve_character_from_recycle_bin() for a
2294  ** potentially faster way of creating a character.
2295  **
2296  *b Arguments:
2297  **
2298  *a name - name of the new character
2299  *a character_type - character's type
2300  *a appearance - base appearance of character; pass
2301  *a NULL to use default appearance
2302  *a hand_item - hand item appearance; pass
2303  *a NULL to use default appearance
2304  **
2305  *b Returns:
2306  **
2307  ** pointer of type diguyCharacter; NULL if creation failed
2308  */
2309  diguyCharacter* create_character(const char* name,
2310  const char* character_type,
2311  const char* appearance = NULL,
2312  const char* head_appearance = NULL,
2313  const char* hand_item = NULL);
2314 
2315  /*l
2316  *b Description:
2317  **
2318  ** This function is very similar to create_character(), but the
2319  ** character created is temporary.
2320  **
2321  ** Temporary characters will be destroyed automatically when the
2322  ** scenario is reset, and are not saved in .dss files. They are
2323  ** commonly used for projectiles, effects, and other objects that can
2324  ** come and go multiple times.
2325  **
2326  ** Temporary characters can be destroyed before scenario reset by
2327  ** calling destroy_character(), and can be sent to the character
2328  ** recycle bin by calling send_character_to_recycle_bin().
2329  **
2330  *b Arguments:
2331  **
2332  *a name - name of the new character
2333  *a character_type - character's type
2334  *a appearance - base appearance of character; pass
2335  *a NULL to use default appearance
2336  **
2337  *b Returns:
2338  **
2339  ** pointer of type diguyCharacter; NULL if creation failed
2340  */
2341  diguyCharacter* create_temporary_character(const char* name,
2342  const char* character_type,
2343  const char* appearance = NULL);
2344 
2345  /*l
2346  *b Description:
2347  **
2348  ** This function destroys a character.
2349  **
2350  ** If a character of the same character type and appearance may be
2351  ** needed later in the scenario, consider using
2352  ** send_character_to_recycle_bin() instead. Characters can be
2353  ** retrieved from the recycle bin more quickly than creating them
2354  ** "from scratch" with create_character().
2355  **
2356  *b Arguments:
2357  **
2358  *a character - pointer to a diguyCharacter
2359  **
2360  *b Returns:
2361  **
2362  ** 0 on success, -1 on failure
2363  **
2364  *b DI-Guy Networking Notes:
2365  **
2366  ** This function should not be called on characters that are reflected
2367  ** network characters. Such characters are destroyed automatically by
2368  ** DI-Guy Networking.
2369  */
2370  int destroy_character(diguyCharacter* character);
2371 
2372  /*l
2373  *b Description
2374  **
2375  ** This function is an alternative way of removing a character from
2376  ** the scenario. When a character is recycled it is removed from the
2377  ** scenario's list of active characters, but the memory associated
2378  ** with it is not freed. Instead, the character is placed in a
2379  ** "character recycle bin" from which it may be later retrieved with a
2380  ** call to retrieve_character_from_recycle_bin().
2381  **
2382  ** For an application that is creating and destroying a lot of
2383  ** characters with the same character types and appearances, this can
2384  ** avoid performance hiccups that happen when memory is allocated for
2385  ** new characters.
2386  **
2387  ** If it is known ahead of time what types and appearances of
2388  ** characters will be needed in the future, the recycle bin can be
2389  ** "pre-stocked" at scenario load time by first creating and then
2390  ** recycling a large number of characters all at once.
2391  **
2392  *b Returns:
2393  **
2394  ** 0 on success, -1 on failure
2395  */
2396  int send_character_to_recycle_bin(diguyCharacter* character);
2397 
2398  /*l
2399  *b Description
2400  **
2401  ** This function is an alternative way of creating a character. The
2402  ** character recycle bin is checked for a recycled character whose
2403  ** character type and appearance match that requested by this call.
2404  ** Characters are sent to the recycle bin by a call to
2405  ** send_character_to_recycle_bin().
2406  **
2407  ** If a match is found the recycled character will be removed from
2408  ** the recycle bin, given the passed name, and placed in the
2409  ** scenario's list of characters, for the most part just as if the
2410  ** character had been created by a call to create_character(). Some
2411  ** things such as position, current action, etc., may need to be
2412  ** immediately set.
2413  **
2414  ** If a match is not found, this function returns NULL and a call to
2415  ** create_character() must be made instead.
2416  **
2417  *b Arguments:
2418  **
2419  *a name - new name for the character retrieved from bin
2420  *a character_type - the character type to retrieve from the bin
2421  *a appearance - the appearance to retrieve from the bin, pass NULL
2422  *a or "default" to retrieve the default appearance
2423  *a make_character_temporary - pass 1 to make character temporary,
2424  *a 0 to leave permanent
2425  **
2426  *b Returns:
2427  **
2428  ** 0 on success, -1 on failure
2429  */
2430  diguyCharacter* retrieve_character_from_recycle_bin(const char* name,
2431  const char* character_type,
2432  const char* appearance,
2433  int make_character_temporary = 0);
2434 
2435  /*l
2436  *b Returns:
2437  **
2438  ** number of characters in the scenario
2439  */
2440  int get_num_characters();
2441 
2442  /*l
2443  *b Returns:
2444  **
2445  ** pointer of type diguyCharacter; NULL if no character at the
2446  ** specified index
2447  **
2448  *b Arguments:
2449  **
2450  *a index - index of the character; indices start at 0
2451  */
2452  diguyCharacter* get_character_at_index(int index);
2453 
2454  /*l
2455  *b Description:
2456  **
2457  ** This function returns a pointer to the specified character.
2458  **
2459  *b Arguments:
2460  **
2461  *a name - name of character to be found
2462  **
2463  *b Returns:
2464  **
2465  ** pointer of type diguyCharacter; NULL if not found
2466  */
2467  diguyCharacter* find_character(const char* name);
2468 
2469  /*l
2470  *b Description:
2471  **
2472  ** This function changes the scenario camera's position
2473  ** and fix point so it will be looking at the specified
2474  ** character.
2475  */
2476  void look_at_character(diguyCharacter* character);
2477 
2478  /*l
2479  *b Description:
2480  **
2481  ** This function returns a pointer to the target character
2482  ** of an event bead.
2483  **
2484  *b Returns:
2485  **
2486  ** pointer of type diguyCharacter; NULL if no current character
2487  */
2488  diguyCharacter* this_character();
2489 
2490  /*l
2491  *b Description:
2492  **
2493  ** This function returns a pointer to the current event bead.
2494  **
2495  *b Returns:
2496  **
2497  ** pointer of type diguyCharacterPathEvent; NULL if no current event
2498  ** bead
2499  */
2500  diguyCharacterPathEvent* this_event_bead();
2501 
2502 
2503 /*****************************************************************************/
2513  /*l
2514  *b Returns:
2515  **
2516  ** number of path shapes in the scenario
2517  */
2518  int get_num_path_shapes();
2519 
2520  /*l
2521  *b Returns:
2522  **
2523  ** pointer of type diguyPathShape; NULL if no
2524  ** path shape at the specified index
2525  **
2526  *b Arguments:
2527  **
2528  *a index - index of the path shape; indices start at 0
2529  */
2530  diguyPathShape* get_path_shape_at_index(int index);
2531 
2532  /*l
2533  *b Returns:
2534  **
2535  ** pointer of type diguyPathShape; NULL if no
2536  ** path shape at the specified index
2537  */
2538  diguyPathShape* get_current_path_shape();
2539 
2540  /*l
2541  *b Description:
2542  **
2543  ** This function returns a pointer to the specified path shape.
2544  **
2545  *b Arguments:
2546  **
2547  *a name - name of path shape to be found
2548  **
2549  *b Returns:
2550  **
2551  ** pointer of type diguyPathShape; NULL if not found
2552  */
2553  diguyPathShape* find_path_shape(const char* name);
2554 
2555  /*l
2556  *b Description:
2557  **
2558  ** This function creates a new path shape and returns a
2559  ** pointer to it.
2560  **
2561  *b Arguments:
2562  **
2563  *a name - name of the new path shape
2564  **
2565  *b Returns:
2566  **
2567  ** pointer of type diguyPathShape; NULL if creation failed
2568  */
2569  diguyPathShape* create_path_shape(const char* name);
2570 
2571  /*l
2572  *b Description:
2573  **
2574  ** This function creates a new path shape based on an
2575  ** existing path shape and returns a pointer to it.
2576  **
2577  *b Arguments:
2578  **
2579  *a existing_path_shape - pointer to diguyPathShape to be copied
2580  *a name - name of the new path shape
2581  **
2582  *b Returns:
2583  **
2584  ** pointer of type diguyPathShape; NULL if creation failed
2585  */
2586  diguyPathShape* copy_path_shape(diguyPathShape* existing_path_shape,
2587  const char* name);
2588 
2589  /*l
2590  *b Description:
2591  **
2592  ** This function destroys a path shape.
2593  **
2594  *b Arguments:
2595  **
2596  *a path_shape - pointer to a diguyPathShape
2597  **
2598  *b Returns:
2599  **
2600  ** 0 on success, -1 on failure
2601  */
2602  int destroy_path_shape(diguyPathShape* path_shape);
2603 
2604 
2605 /*****************************************************************************/
2610  /*l
2611  *b Description:
2612  **
2613  ** This function creates a new waypoint that can be used for creating
2614  ** new paths and path shapes.
2615  **
2616  ** The returned pointer must be destroyed using destroy_waypoint().
2617  ** The scenario keeps no record of waypoints created with this
2618  ** function.
2619  **
2620  ** The weights of the waypoint control how long the "control handles"
2621  ** of the waypoint are, in meters. The longer the control handle,
2622  ** the more the path will be stretched in the direction of the
2623  ** waypoint's orientation.
2624  **
2625  ** Unless otherwise specified, callable from:
2626  **
2627  *- - C++
2628  *- - Script
2629  **
2630  *b Arguments:
2631  **
2632  *a tx, ty, tz - position in meters from the origin
2633  *a rz, rx, ry - orientations in degrees counter-clockwise
2634  *a from the positive X axis
2635  *a weight_in - how much influence this waypoint exerts
2636  *a over the path curve entering this waypoint
2637  *a weight_out - how much influence this waypoint exerts
2638  *a over the path curve leaving this waypoint
2639  **
2640  ** By default, weight_in will be set to 1, and weight_out will be
2641  ** coupled to weight_in so that changes to one will affect the
2642  ** other. See diguyWaypoint::set_weight_in(). If a non-default
2643  ** value is passed for weight_out the weights of the waypoint will
2644  ** not be coupled.
2645  **
2646  *b Returns:
2647  **
2648  ** pointer to type diguyWaypoint
2649  */
2650  diguyWaypoint* create_waypoint(float x = 0.0f, float y = 0.0f, float z = 0.0f,
2651  float yaw = 0.0f, float roll = 0.0f, float pitch = 0.0f,
2652  float weight_in = DIGUY_DEFAULT_FLOAT,
2653  float weight_out = DIGUY_DEFAULT_FLOAT);
2654 
2655  /*l
2656  *b Description:
2657  **
2658  ** This function destroys a waypoint created by create_waypoint().
2659  ** Path shapes created using this waypoint will not be affected;
2660  ** they make internal copies of the waypoints that are used to
2661  ** create them.
2662  **
2663  ** Do *not* call this function on waypoints not created by
2664  ** create_waypoint()! e.g., a waypoint returned by a call to
2665  ** diguyCharacterPath::get_waypoint_at_index().
2666  **
2667  *b Arguments:
2668  **
2669  *a waypoint - waypoint to destroy
2670  **
2671  *b Returns:
2672  **
2673  ** 0 on success, -1 on failure
2674  */
2675  int destroy_waypoint(diguyWaypoint* waypoint);
2676 
2677 
2678 /*****************************************************************************/
2694  /*l
2695  *b Description:
2696  **
2697  ** This function searches DI-Guy's available character types and
2698  ** appearances for the closest match to the specified fields and
2699  ** values. See the documentation for diguyCharacterTypeMap for
2700  ** information on what fields are available, and what values they
2701  ** may take.
2702  **
2703  *b Arguments:
2704  **
2705  *a field1 - field in type map to check
2706  *a field1_value - value to check for
2707  *a field1_alternate_value - acceptable alternate value
2708  **
2709  ** (Arguments for fields 2 through 8 are the same.)
2710  **
2711  *b Returns:
2712  **
2713  ** pointer to type diguyCharacterTypeMap
2714  */
2715  diguyCharacterTypeMap* get_nearest_character_type_map(
2716  diguyCharacterTypeMapField field1, const char* field1_value, const char* field1_alternate_value,
2717  diguyCharacterTypeMapField field2 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field2_value = NULL, const char* field2_alternate_value = NULL,
2718  diguyCharacterTypeMapField field3 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field3_value = NULL, const char* field3_alternate_value = NULL,
2719  diguyCharacterTypeMapField field4 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field4_value = NULL, const char* field4_alternate_value = NULL,
2720  diguyCharacterTypeMapField field5 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field5_value = NULL, const char* field5_alternate_value = NULL,
2721  diguyCharacterTypeMapField field6 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field6_value = NULL, const char* field6_alternate_value = NULL,
2722  diguyCharacterTypeMapField field7 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field7_value = NULL, const char* field7_alternate_value = NULL,
2723  diguyCharacterTypeMapField field8 = DIGUY_CHARACTER_TYPE_MAP_FIELD_UNKNOWN, const char* field8_value = NULL, const char* field8_alternate_value = NULL);
2724 
2725  /*l
2726  *b Description:
2727  **
2728  ** Same as above, but fields to check are specified by string name
2729  ** instead of enumeration value.
2730  */
2731  diguyCharacterTypeMap* get_nearest_character_type_map_using_field_strings(
2732  const char* field1_string, const char* field1_value, const char* field1_alternate_value,
2733  const char* field2_string = NULL, const char* field2_value = NULL, const char* field2_alternate_value = NULL,
2734  const char* field3_string = NULL, const char* field3_value = NULL, const char* field3_alternate_value = NULL,
2735  const char* field4_string = NULL, const char* field4_value = NULL, const char* field4_alternate_value = NULL,
2736  const char* field5_string = NULL, const char* field5_value = NULL, const char* field5_alternate_value = NULL,
2737  const char* field6_string = NULL, const char* field6_value = NULL, const char* field6_alternate_value = NULL,
2738  const char* field7_string = NULL, const char* field7_value = NULL, const char* field7_alternate_value = NULL,
2739  const char* field8_string = NULL, const char* field8_value = NULL, const char* field8_alternate_value = NULL);
2740 
2741  /*l
2742  *b Description:
2743  **
2744  ** Same as above, but field values to match against are specified
2745  ** by the given type map id. No alternate values can be provided,
2746  ** though wildcards can be used by putting a "*" in for a field.
2747  */
2748  diguyCharacterTypeMap* get_nearest_character_type_map_id_match(const char* type_map_id);
2749 
2750  /*l
2751  *b Description:
2752  **
2753  ** This function returns the total number of type map entries that
2754  ** are in DI-Guy. It is against these entries that matches will be
2755  ** made.
2756  **
2757  ** This function, along with get_character_type_map_entry_at_index(),
2758  ** enables all type map information to be queried.
2759  **
2760  *b Returns:
2761  **
2762  ** number of total type map entries against which matches will be
2763  ** made
2764  */
2765  int get_num_character_type_map_entries();
2766 
2767  /*l
2768  *b Returns:
2769  **
2770  ** type map entry at specified index; see
2771  ** get_num_character_type_map_entries()
2772  */
2773  diguyCharacterTypeMap* get_character_type_map_entry_at_index(int index);
2774 
2775  /*l
2776  *b Description:
2777  **
2778  ** This function returns the total number of values that may
2779  ** be specified or returned in the character class field.
2780  **
2781  ** This function, along with get_type_map_character_class_at_index(),
2782  ** enables all available character classes to be queried.
2783  **
2784  *b Returns:
2785  **
2786  ** number of character classes
2787  */
2788  int get_num_type_map_character_classes();
2789 
2790  /*l
2791  *b Returns:
2792  **
2793  ** character class field value at specified index; see
2794  ** get_num_type_map_character_classes()
2795  */
2796  const char* get_type_map_character_class_at_index(int index);
2797 
2798  /*l
2799  *b Description:
2800  **
2801  ** This function returns the total number of values that may
2802  ** be specified or returned in the category field of a type
2803  ** map with the given character class.
2804  **
2805  ** This function, along with get_type_map_category_at_index(),
2806  ** enables all available categories available to each character
2807  ** class to be queried.
2808  **
2809  *b Returns:
2810  **
2811  ** number of categories
2812  */
2813  int get_num_type_map_categories(const char* character_class);
2814 
2815  /*l
2816  *b Returns:
2817  **
2818  ** category field value at specified index; see
2819  ** get_num_type_map_categories()
2820  */
2821  const char* get_type_map_category_at_index(const char* character_class,
2822  int index);
2823 
2824  /*l
2825  *b Description:
2826  **
2827  ** This function returns the total number of values that may
2828  ** be specified or returned in the subcategory field of a type
2829  ** map with the given character class and category.
2830  **
2831  ** This function, along with get_type_map_subcategory_at_index(),
2832  ** enables all available subcategories available to each character
2833  ** class and category to be queried.
2834  **
2835  *b Returns:
2836  **
2837  ** number of subcategories
2838  */
2839  int get_num_type_map_subcategories(const char* character_class,
2840  const char* category);
2841 
2842  /*l
2843  *b Returns:
2844  **
2845  ** subcategory field value at specified index; see
2846  ** get_num_type_map_subcategories()
2847  */
2848  const char* get_type_map_subcategory_at_index(const char* character_class,
2849  const char* category,
2850  int index);
2851 
2852 
2853 /*****************************************************************************/
2863  /*l
2864  *b Returns:
2865  **
2866  ** number of signals in the scenario
2867  */
2868  int get_num_signals();
2869 
2870  /*l
2871  *b Returns:
2872  **
2873  ** pointer of type diguySignal; NULL if no
2874  ** signal at the specified index
2875  **
2876  *b Arguments:
2877  **
2878  *a index - index of the signal; indices start at 0
2879  */
2880  diguySignal* get_signal_at_index(int index);
2881 
2882  /*l
2883  *b Description:
2884  **
2885  ** This function returns a pointer to the specified signal.
2886  **
2887  *b Arguments:
2888  **
2889  *a name - name of signal to be found
2890  **
2891  *b Returns:
2892  **
2893  ** pointer of type diguySignal; NULL if not found
2894  */
2895  diguySignal* find_signal(const char* name);
2896 
2897  /*l
2898  *b Description:
2899  **
2900  ** This function creates a new signal and returns a
2901  ** pointer to it.
2902  **
2903  *b Arguments:
2904  **
2905  *a name - name of the new signal
2906  **
2907  *b Returns:
2908  **
2909  ** pointer of type diguySignal
2910  */
2911  diguySignal* create_signal(const char* name);
2912 
2913  /*l
2914  *b Description:
2915  **
2916  ** This function destroys a signal.
2917  **
2918  *b Arguments:
2919  **
2920  *a signal - pointer to a diguySignal
2921  **
2922  *b Returns:
2923  **
2924  ** 0 on success, -1 on failure
2925  */
2926  int destroy_signal(diguySignal* signal);
2927 
2928  /*l
2929  *b Description:
2930  **
2931  ** This function resets all signals in the scenario.
2932  */
2933  void reset_signals();
2934 
2935 
2936  /*l
2937  *b Description:
2938  **
2939  ** This function hides all signals in the signal palette.
2940  **
2941  *b Arguments:
2942  **
2943  *a filter - optional filter, will only hide signals tagged with
2944  *a info_text equaling filter
2945  */
2946  int signal_palette_hide_all(const char* filter = NULL);
2947 
2948  /*l
2949  *b Description:
2950  **
2951  ** This function shows all signals in the signal palette.
2952  **
2953  *b Arguments:
2954  **
2955  *a filter - optional filter, will only show signals tagged with
2956  *a info_text filter
2957  */
2958  int signal_palette_show_all(const char* filter = NULL);
2959 
2960 
2961 /*****************************************************************************/
2975  /*l
2976  *b Returns:
2977  **
2978  ** number of sounds in the scenario
2979  */
2980  int get_num_sounds();
2981 
2982  /*l
2983  *b Returns:
2984  **
2985  ** pointer of type diguySound; NULL if no sound at the specified
2986  ** index
2987  **
2988  *b Arguments:
2989  **
2990  *a index - index of the sound; indices start at 0
2991  */
2992  diguySound* get_sound_at_index(int index);
2993 
2994  /*l
2995  *b Description:
2996  **
2997  ** This function returns a pointer to the specified sound.
2998  **
2999  *b Arguments:
3000  **
3001  *a name - name of sound to be found
3002  **
3003  *b Returns:
3004  **
3005  ** pointer of type diguySound; NULL if not found
3006  */
3007  diguySound* find_sound(const char* name);
3008 
3009  /*l
3010  *b Description:
3011  **
3012  ** This function creates a new sound and returns a pointer to it.
3013  **
3014  ** Note that sounds are not played directly. Instead they are used as
3015  ** templates for sound instances. See diguyCharacter::play_sound()
3016  ** and diguyCharacter::create_sound_instance().
3017  **
3018  *b Arguments:
3019  **
3020  *a name - name of the new sound
3021  *a sound_filename - filename of the sound
3022  **
3023  ** Note that name isn't the filename of the sound; it is the
3024  ** descriptive name that will show up in the UI and used in
3025  ** diguyCharacter calls that play sounds.
3026  **
3027  ** Pass the filename in the sound_filename argument or use the
3028  ** function diguySound::set_sound_filename() to set the filename of
3029  ** the sound.
3030  **
3031  ** See diguyCharacter::set_current_voice_actor() for information
3032  ** about naming sounds for different voice actors.
3033  **
3034  *b Returns:
3035  **
3036  ** pointer of type diguySound
3037  */
3038  diguySound* create_sound(const char* name,
3039  const char* sound_filename = NULL);
3040 
3041  /*l
3042  *b Description:
3043  **
3044  ** This function destroys a sound.
3045  **
3046  *b Arguments:
3047  **
3048  *a sound - pointer to diguySound to be destroyed
3049  **
3050  *b Returns:
3051  **
3052  ** 0 on success, -1 on failure
3053  */
3054  int destroy_sound(diguySound* sound);
3055 
3056  /*l
3057  *b Description:
3058  **
3059  ** This function preloads data for the sound.
3060  **
3061  *b Arguments:
3062  **
3063  *a sound - pointer to diguySound
3064  **
3065  *b Returns:
3066  **
3067  ** 0 on success, -1 on failure
3068  */
3069  int preload_sound(diguySound* sound);
3070 
3071  /*l
3072  **
3073  *b Description:
3074  **
3075  ** This function stops all sounds playing within the scenario.
3076  **
3077  *b Arguments:
3078  **
3079  *a rampdown_time - how long to allow the sounds to fade out
3080  **
3081  *b Returns:
3082  **
3083  ** 0 on success, -1 on failure
3084  */
3085  int stop_all_sounds(float rampdown_time = 0.0f);
3086 
3087  /*l
3088  **
3089  *b Description:
3090  **
3091  ** This function plays a non looping sound.
3092  **
3093  *b Arguments:
3094  **
3095  *a name - name of the sound
3096  *a x, y, z - location in the world the sound comes from
3097  *a gain - a volume multiplier
3098  *a save_event - if review data should record the creation of this
3099  *a sound
3100  **
3101  *b Returns:
3102  **
3103  ** 0 on success, -1 on failure
3104  */
3105  int play_3d_sound(const char* name,
3106  float x, float y, float z,
3107  float gain,
3108  int save_event);
3109 
3110 
3111 /*****************************************************************************/
3121  /*l
3122  *b Returns:
3123  **
3124  ** number of groups in the scenario
3125  */
3126  int get_num_groups();
3127 
3128  /*l
3129  *b Returns:
3130  **
3131  ** pointer of type diguyCharacterGroup; NULL if no
3132  ** group at the specified index
3133  **
3134  *b Arguments:
3135  **
3136  *a index - index of the group; indices start at 0
3137  */
3138  diguyCharacterGroup* get_group_at_index(int index);
3139 
3140  /*l
3141  *b Description:
3142  **
3143  ** This function returns a pointer to the specified group.
3144  **
3145  *b Arguments:
3146  **
3147  *a name - name of group to be found
3148  **
3149  *b Returns:
3150  **
3151  ** pointer of type diguyCharacterGroup; NULL if not found
3152  */
3153  diguyCharacterGroup* find_group(const char* name);
3154 
3155  /*l
3156  *b Description:
3157  **
3158  ** This function creates a new group and returns a
3159  ** pointer to it.
3160  **
3161  *b Arguments:
3162  **
3163  *a name - name of the new group
3164  **
3165  *b Returns:
3166  **
3167  ** pointer of type diguyCharacterGroup
3168  */
3169  diguyCharacterGroup* create_group(const char* name);
3170 
3171 
3172  /*l
3173  *b Description:
3174  **
3175  ** This function finds the group with the given name or
3176  ** creates it if it doesn't exist.
3177  **
3178  *b Arguments:
3179  **
3180  *a name - name of the group to find or create
3181  **
3182  *b Returns:
3183  **
3184  ** pointer of type diguyGroup; should never be NULL
3185  */
3186  diguyCharacterGroup* find_or_create_group(const char* name);
3187 
3188 
3189  /*l
3190  *b Description:
3191  **
3192  ** This function destroys a group.
3193  **
3194  *b Arguments:
3195  **
3196  *a group - pointer to a diguyCharacterGroup
3197  **
3198  *b Returns:
3199  **
3200  ** 0 on success, -1 on failure
3201  */
3202  int destroy_group(diguyCharacterGroup* group);
3203 
3204 
3205 /*****************************************************************************/
3215  /*l
3216  *b Returns:
3217  **
3218  ** number of sensor regions in the scenario
3219  */
3220  int get_num_sensor_regions();
3221 
3222  /*l
3223  *b Returns:
3224  **
3225  ** pointer of type diguySensorRegion; NULL if no
3226  ** sensor region at the specified index
3227  **
3228  *b Arguments:
3229  **
3230  *a index - index of the sensor region; indices start at 0
3231  */
3232  diguySensorRegion* get_sensor_region_at_index(int index);
3233 
3234  /*l
3235  *b Description:
3236  **
3237  ** This function returns a pointer to the specified sensor region.
3238  **
3239  *b Arguments:
3240  **
3241  *a name - name of sensor region to be found
3242  **
3243  *b Returns:
3244  **
3245  ** pointer of type diguySensorRegion; NULL if not found
3246  */
3247  diguySensorRegion* find_sensor_region(const char* name);
3248 
3249 
3250 /*****************************************************************************/
3260  /*l
3261  *b Returns:
3262  **
3263  ** number of scene objects in the scenario
3264  */
3265  int get_num_scene_objects();
3266 
3267  /*l
3268  *b Returns:
3269  **
3270  ** pointer of type diguySceneObject; NULL if no
3271  ** scene object at the specified index
3272  **
3273  *b Arguments:
3274  **
3275  *a index - index of the scene object; indices start at 0
3276  */
3277  diguySceneObject* get_scene_object_at_index(int index);
3278 
3279  /*l
3280  *b Returns:
3281  **
3282  ** pointer of type diguySceneObject; NULL if no
3283  ** scene object with specified name
3284  */
3285  diguySceneObject* find_scene_object(const char* name);
3286 
3287  /*l
3288  *b Description:
3289  **
3290  ** This function sets whether scene objects defined in the
3291  ** scenario are enabled, and therefore potentially visible.
3292  **
3293  ** Scene objects are *not* enabled by default.
3294  **
3295  *b Arguments:
3296  **
3297  *a scene_objects_enabled - flag determining whether scene
3298  *a objects are enabled; 1 for enabled,
3299  *a 0 for disabled
3300  */
3301  void set_scene_objects_enabled(int scene_objects_enabled);
3302 
3303  /*l
3304  *b Returns:
3305  **
3306  ** the most recent setting made by a call to
3307  ** set_scene_objects_enabled()
3308  */
3309  int get_scene_objects_enabled();
3310 
3311  /*l
3312  *b Description:
3313  **
3314  ** This function creates a new scene object and returns a
3315  ** pointer to it.
3316  **
3317  *b Arguments:
3318  **
3319  *a name - name of the new scene object
3320  *a filename - file the scene object should use
3321  **
3322  *b Returns:
3323  **
3324  ** pointer of type diguySceneObject; NULL if creation failed
3325  */
3326  diguySceneObject* create_scene_object(const char* name,
3327  const char* filename);
3328 
3329  /*l
3330  *b Description:
3331  **
3332  ** This function creates a new user defined scene object and returns a
3333  ** pointer to it.
3334  **
3335  *b Arguments:
3336  **
3337  *a name - name of the new scene object
3338  **
3339  *b Returns:
3340  **
3341  ** pointer of type diguySceneObject; NULL if creation failed
3342  */
3343  diguySceneObject* create_user_defined_scene_object(const char* name);
3344 
3345  /*l
3346  *b Description:
3347  **
3348  ** This function destroys a scene object.
3349  **
3350  *b Arguments:
3351  **
3352  *a scene_object - pointer to a diguySceneObject
3353  **
3354  *b Returns:
3355  **
3356  ** 0 on success, -1 on failure
3357  */
3358  int destroy_scene_object(diguySceneObject* scene_object);
3359 
3360 
3361 /*****************************************************************************/
3371  /*l
3372  *b Returns:
3373  **
3374  ** pointer to the scenario's primary view; there is one
3375  ** and only one primary view in the scenario
3376  */
3377  diguyView* get_primary_view();
3378 
3379  /*l
3380  *b Returns:
3381  **
3382  ** number of secondary views in the scenario
3383  */
3384  int get_num_secondary_views();
3385 
3386  /*l
3387  *b Returns:
3388  **
3389  ** pointer of type diguyView; NULL if no
3390  ** secondary view at the specified index
3391  **
3392  *b Arguments:
3393  **
3394  *a index - index of the secondary view; indices start at 0
3395  */
3396  diguyView* get_secondary_view_at_index(int index);
3397 
3398  /*l
3399  *b Description:
3400  **
3401  ** This function returns a pointer to the view with
3402  ** the given name. The primary view and all of the
3403  ** secondary views are checked for a name match.
3404  **
3405  *b Returns:
3406  **
3407  ** pointer of type diguyView; NULL if not found
3408  */
3409  diguyView* find_view(const char* name);
3410 
3411 
3412 /*****************************************************************************/
3422  /*l
3423  *b Description:
3424  **
3425  ** This function returns a pointer to the primary view's camera.
3426  ** This is equivalent to:
3427  **
3428  *e diguyView* v = scenario->get_primary_view();
3429  *e return v->get_camera();
3430  **
3431  *b Returns:
3432  **
3433  ** pointer of type diguyViewCamera; should never be NULL
3434  */
3435  diguyViewCamera* get_scenario_camera();
3436 
3437  /*l
3438  *b Description:
3439  **
3440  ** This function returns a pointer to the camera with
3441  ** the given name. The primary view's camera and all of the
3442  ** secondary views' cameras are checked for a name match.
3443  **
3444  *b Returns:
3445  **
3446  ** pointer of type diguyViewCamera; NULL if not found
3447  */
3448  diguyViewCamera* find_camera(const char* name);
3449 
3450  /*l
3451  *b Description:
3452  **
3453  ** This function sets a flag that determines whether script
3454  ** calls can set the primary view's camera settings.
3455  ** Specifically, if flag is 0, calls to diguyViewCamera::load()
3456  ** will have no effect; the camera should remain completely under
3457  ** user control.
3458  **
3459  *b Arguments:
3460  **
3461  *a flag - 1 to enable, 0 to disable
3462  */
3463  void set_scenario_camera_affected_by_script_events(int flag);
3464 
3465  /*l
3466  *b Returns:
3467  **
3468  ** the most recent setting made by
3469  ** set_scenario_camera_affected_by_script_events()
3470  */
3471  int get_scenario_camera_affected_by_script_events();
3472 
3473  /*l
3474  *b Description:
3475  **
3476  ** This function, like
3477  ** set_scenario_camera_affected_by_script_events(), determines
3478  ** whether script calls can set the primary view's camera settings,
3479  ** but only disables camera changes if there is an active I-Guy
3480  ** character as set by the set_iguy_character() call.
3481  **
3482  ** If set_scenario_camera_affected_by_script_events() has been called
3483  ** with a value of 0, then this function has no effect.
3484  **
3485  *b Arguments:
3486  **
3487  *a flag - 1 to enable, 0 to disable
3488  */
3489  void set_scenario_camera_affected_by_script_events_when_iguy_active(int flag);
3490 
3491  /*l
3492  *b Returns:
3493  **
3494  ** the most recent setting made by
3495  ** set_scenario_camera_affected_by_script_events()
3496  */
3497  int get_scenario_camera_affected_by_script_events_when_iguy_active();
3498 
3499  /*l
3500  *b Returns:
3501  **
3502  ** number of camera settings saved in the scenario
3503  */
3504  int get_num_camera_settings();
3505 
3506  /*l
3507  *b Returns:
3508  **
3509  ** pointer of type diguyViewCameraSettings; NULL if no
3510  ** camera settings at the specified index
3511  **
3512  *b Arguments:
3513  **
3514  *a index - index of the camera settings; indices start at 0
3515  */
3516  diguyViewCameraSettings* get_camera_settings_at_index(int index);
3517 
3518  /*l
3519  *b Description:
3520  **
3521  ** This function returns a pointer to the specified camera settings.
3522  **
3523  *b Arguments:
3524  **
3525  *a settings_name - name of camera settings to be found
3526  **
3527  *b Returns:
3528  **
3529  ** pointer of type diguyViewCamera; NULL if not found
3530  */
3531  diguyViewCameraSettings* find_camera_settings(const char* settings_name);
3532 
3533  /*l
3534  *b Description:
3535  **
3536  ** This function loads the specified camera settings into
3537  ** the primary view's camera.
3538  **
3539  *b Arguments:
3540  **
3541  *a settings_name - name of camera settings to be loaded
3542  *a update_current_camera - whether the current camera should be
3543  *a updated; defaults to 1
3544  **
3545  ** Not updating the current camera will cause the camera history
3546  ** to be lost.
3547  **
3548  *b Returns:
3549  **
3550  ** 0 on success, -1 on failure
3551  */
3552  int load_camera_settings(const char* settings_name, int update_current_camera = 1);
3553 
3554  /*l
3555  *b Description:
3556  **
3557  ** This function sets camera that will be used for down-stream
3558  ** camera-related operations. This includes:
3559  **
3560  *- - far position rendering in the OpenGL renderer
3561  *- - various culling operations (e.g.
3562  *- set_character_culling_enabled())
3563  *- - graphics LOD range scaling; see
3564  *- set_scale_graphics_lod_ranges_from_view_settings()
3565  **
3566  ** Typically the passed camera should be the primary view's camera.
3567  **
3568  ** A render camera does not always need to be set. If one is not
3569  ** set, the above camera-related operations will not be performed.
3570  **
3571  ** If a render camera is set the actual rendering environment
3572  ** camera settings (e.g. as set by gluLookAt() in OpenGL)
3573  ** should match the settings in the render camera, or there
3574  ** may be unexpected visual results.
3575  **
3576  *b Arguments:
3577  **
3578  *a camera - camera to use for camera-related operations
3579  */
3580  void set_render_camera(diguyViewCamera* camera);
3581 
3582 
3583 /*****************************************************************************/
3593  /*l
3594  *b Description:
3595  **
3596  ** This function returns a pointer to the scenario fog.
3597  ** This is the fog of the primary view.
3598  **
3599  *b Returns:
3600  **
3601  ** pointer of type diguyViewFog; should never be NULL
3602  */
3603  diguyViewFog* get_scenario_fog();
3604 
3605  /*l
3606  *b Description:
3607  **
3608  ** This function returns a pointer to the fog with
3609  ** the given name. The primary view's fog and all of the
3610  ** secondary views' fogs are checked for a name match.
3611  **
3612  *b Returns:
3613  **
3614  ** pointer of type diguyViewFog; NULL if not found
3615  */
3616  diguyViewFog* find_fog(const char* name);
3617 
3618  /*l
3619  *b Description:
3620  **
3621  ** This function returns the fog object with the given name, or
3622  ** creates one if not found.
3623  **
3624  *b Returns:
3625  **
3626  ** pointer of type diguyViewFog
3627  **
3628  *b Arguments:
3629  **
3630  *a name
3631  */
3632  diguyViewFog* find_or_create_fog(const char* name);
3633 
3634  /*l
3635  *b Description:
3636  **
3637  ** This function loads the named fog settings the currently active
3638  ** one.
3639  **
3640  *b Arguments:
3641  **
3642  *a name
3643  */
3644  void load_current_fog(const char* name);
3645 
3646  /*l
3647  *b Returns:
3648  **
3649  ** number of fog settings in the scenario
3650  */
3651  int get_num_fog_settings();
3652 
3653  /*l
3654  *b Returns:
3655  **
3656  ** pointer of type diguyViewFogSettings; NULL if no
3657  ** fog at the specified index
3658  **
3659  *b Arguments:
3660  **
3661  *a index - index of the fog settings; indices start at 0
3662  */
3663  diguyViewFogSettings* get_fog_settings_at_index(int index);
3664 
3665  /*l
3666  *b Description:
3667  **
3668  ** This function returns a pointer to the specified fog settings.
3669  **
3670  *b Arguments:
3671  **
3672  *a settings_name - name of fog settings to be found
3673  **
3674  *b Returns:
3675  **
3676  ** pointer of type diguyViewFogSettings; NULL if not found
3677  */
3678  diguyViewFogSettings* find_fog_settings(const char* settings_name);
3679 
3680  /*l
3681  *b Description:
3682  **
3683  ** This function loads the specified fog settings into
3684  ** the scenario fog.
3685  **
3686  *b Arguments:
3687  **
3688  *a settings_name - name of fog settings to be loaded
3689  **
3690  *b Returns:
3691  **
3692  ** pointer of type diguyViewFog; NULL if not found
3693  */
3694  int load_fog_settings(const char* settings_name);
3695 
3696 
3697 /*****************************************************************************/
3707  /*l
3708  *b Description:
3709  **
3710  ** This function returns a pointer to the scenario light.
3711  ** These are the lights of the primary view.
3712  **
3713  *b Arguments:
3714  **
3715  *a number - number of light to be found
3716  **
3717  *b Returns:
3718  **
3719  ** pointer of type diguyViewLight; can be null if asked for a
3720  ** non-existent light
3721  */
3722  diguyViewLight* get_scenario_light(int i = 0);
3723 
3724  /*l
3725  *b Description:
3726  **
3727  ** This function returns a pointer to the light with
3728  ** the given name. The primary view's light and all of the
3729  ** secondary views' lights are checked for a name match.
3730  **
3731  *b Returns:
3732  **
3733  ** pointer of type diguyViewLight; NULL if not found
3734  */
3735  diguyViewLight* find_light(const char* name);
3736 
3737  /*l
3738  *b Returns:
3739  **
3740  ** number of light settings in the scenario
3741  */
3742  int get_num_light_settings();
3743 
3744  /*l
3745  *b Returns:
3746  **
3747  ** pointer of type diguyViewLightSettings; NULL if no
3748  ** light settings at the specified index
3749  **
3750  *b Arguments:
3751  **
3752  *a index - index of the light settings; indices start at 0
3753  */
3754  diguyViewLightSettings* get_light_settings_at_index(int index);
3755 
3756  /*l
3757  *b Description:
3758  **
3759  ** This function returns a pointer to the specified light settings.
3760  **
3761  *b Arguments:
3762  **
3763  *a name - name of light settings to be found
3764  **
3765  *b Returns:
3766  **
3767  ** pointer of type diguyViewLightSettings; NULL if not found
3768  */
3769  diguyViewLightSettings* find_light_settings(const char* settings_name);
3770 
3771  /*l
3772  *b Description:
3773  **
3774  ** This function loads the specified light settings into
3775  ** the scenario light.
3776  **
3777  *b Arguments:
3778  **
3779  *a settings_name - name of light settings to be loaded
3780  *a light_num - which light to load into
3781  **
3782  *b Returns:
3783  **
3784  ** pointer of type diguyViewLight; NULL if not found
3785  */
3786  int load_light_settings(const char* settings_name, int light_num = 0);
3787 
3788 
3789 /*****************************************************************************/
3799  /*l
3800  *b Returns:
3801  **
3802  ** number of info popups in the scenario
3803  */
3804  int get_num_info_popups();
3805 
3806  /*l
3807  *b Returns:
3808  **
3809  ** pointer of type diguyInfoPopup; NULL if no
3810  ** info popup at the specified index
3811  **
3812  *b Arguments:
3813  **
3814  *a index - index of the info popup; indices start at 0
3815  */
3816  diguyInfoPopup* get_info_popup_at_index(int index);
3817 
3818  /*l
3819  *b Description:
3820  **
3821  ** This function returns a pointer to the specified info popup.
3822  **
3823  *b Arguments:
3824  **
3825  *a name - name of info popup to be found
3826  **
3827  *b Returns:
3828  **
3829  ** pointer of type diguyInfoPopup; NULL if not found
3830  */
3831  diguyInfoPopup* find_info_popup(const char* name);
3832 
3833  /*l
3834  *b Description:
3835  **
3836  ** This function sets the default encoding for info popups
3837  ** that do not have an encoding specified.
3838  **
3839  *b Arguments:
3840  **
3841  *a info_popup_default_encoding - new default encoding
3842  **
3843  *b Returns:
3844  **
3845  ** 0 on success, -1 on failure
3846  */
3847  int set_info_popup_default_encoding(const char* info_popup_default_encoding);
3848 
3849  /*l
3850  *b Description:
3851  **
3852  ** This function returns the default encoding of info popups.
3853  **
3854  *b Returns:
3855  **
3856  ** default encoding; value will never be NULL, but may be
3857  ** the empty string ("") if no default encoding has been
3858  ** specified
3859  */
3860  const char* get_info_popup_default_encoding();
3861 
3862 
3863 /*****************************************************************************/
3873  /*l
3874  *b Returns:
3875  **
3876  ** number of variables in the scenario
3877  */
3878  int get_num_variables();
3879 
3880  /*l
3881  *b Returns:
3882  **
3883  ** pointer of type diguyVariable; NULL if no
3884  ** variable at the specified index
3885  **
3886  *b Arguments:
3887  **
3888  *a index - index of the variable; indices start at 0
3889  */
3890  diguyVariable* get_variable_at_index(int index);
3891 
3892  /*l
3893  *b Description:
3894  **
3895  ** This function returns a pointer to the specified variable.
3896  **
3897  *b Arguments:
3898  **
3899  *a name - name of variable to be found
3900  **
3901  *b Returns:
3902  **
3903  ** pointer of type diguyVariable; NULL if not found
3904  */
3905  diguyVariable* find_variable(const char* name);
3906 
3907  /*l
3908  *b Description:
3909  **
3910  ** This function finds the variable with the given name or
3911  ** creates it if it doesn't exist.
3912  **
3913  *b Arguments:
3914  **
3915  *a name - name of the variable to find or create
3916  **
3917  *b Returns:
3918  **
3919  ** pointer of type diguyVariable; should never be NULL
3920  */
3921  diguyVariable* find_or_create_variable(const char* name);
3922 
3923  /*l
3924  *b Description:
3925  **
3926  ** This function destroys the passed variable.
3927  **
3928  *b Arguments:
3929  **
3930  *a variable - pointer to a diguyVariable
3931  **
3932  *b Returns:
3933  **
3934  ** 0 on success, -1 on failure
3935  */
3936  int destroy_variable(diguyVariable* variable);
3937 
3938 
3939 /*****************************************************************************/
3949  /*l
3950  *b Returns:
3951  **
3952  ** number of face_expressions in the scenario
3953  */
3954  int get_num_face_expressions();
3955 
3956  /*l
3957  *b Returns:
3958  **
3959  ** pointer of type diguyCharacterFaceExpression; NULL if no
3960  ** info popup at the specified index
3961  **
3962  *b Arguments:
3963  **
3964  *a index - index of the face_expression; indices start at 0
3965  */
3966  diguyCharacterFaceExpression* get_face_expression_at_index(int index);
3968  /*l
3969  *b Description:
3970  **
3971  ** This function returns a pointer to the specified face expression.
3972  **
3973  *b Arguments:
3974  **
3975  *a name - name of face_expression to be found
3976  **
3977  *b Returns:
3978  **
3979  ** pointer of type diguyCharacterFaceExpression; NULL if not found
3980  */
3981  diguyCharacterFaceExpression* find_face_expression(const char* name);
3983  /*l
3984  *b Description:
3985  **
3986  ** This function creates a new face expression with the given name.
3987  **
3988  *b Arguments:
3989  **
3990  *a name - name of the new face expression
3991  *a target_actor - name of the actor to use as template; defaults to
3992  *a "exface" for backwards compatiblity
3993  **
3994  *b Returns:
3995  **
3996  ** pointer of type diguyCharacterFaceExpression
3997  */
3998  diguyCharacterFaceExpression* create_face_expression(const char* name,
3999  const char* target_actor = "exface");
4000 
4001  /*l
4002  *b Description:
4003  **
4004  ** This function destroys the passed face expression.
4005  **
4006  *b Arguments:
4007  **
4008  *a face_expression - pointer to a diguyCharacterFaceExpression
4009  **
4010  *b Returns:
4011  **
4012  ** 0 on success, -1 on failure
4013  */
4014  int destroy_face_expression(diguyCharacterFaceExpression* face_expression);
4015 
4016 
4017 /*****************************************************************************/
4027  /*l
4028  *b Returns:
4029  **
4030  ** number of chain settings in the scenario
4031  */
4032  int get_num_chain_settings();
4033 
4034  /*l
4035  *b Returns:
4036  **
4037  ** pointer of type diguyChainSettings; NULL if no
4038  ** chain settings at the specified index
4039  **
4040  *b Arguments:
4041  **
4042  *a index - index of the chain settings; indices start at 0
4043  */
4044  diguyChainSettings* get_chain_settings_at_index(int index);
4045 
4046  /*l
4047  *b Description:
4048  **
4049  ** This function returns a pointer to the specified chain settings.
4050  **
4051  *b Arguments:
4052  **
4053  *a name - name of chain settings to be found
4054  **
4055  *b Returns:
4056  **
4057  ** pointer of type diguyChainSettings; NULL if not found
4058  */
4059  diguyChainSettings* find_chain_settings(const char* name);
4060 
4061  /*l
4062  *b Description:
4063  **
4064  ** This function creates a new chain settings and returns a
4065  ** pointer to it.
4066  **
4067  *b Arguments:
4068  **
4069  *a name - name of the new chain settings
4070  **
4071  *b Returns:
4072  **
4073  ** pointer of type diguyChainSettings
4074  */
4075  diguyChainSettings* create_chain_settings(const char* name);
4076 
4077  /*l
4078  *b Description:
4079  **
4080  ** This function destroys a chain settings.
4081  **
4082  *b Arguments:
4083  **
4084  *a chain settings - pointer to a diguyChainSettings
4085  **
4086  *b Returns:
4087  **
4088  ** 0 on success, -1 on failure
4089  */
4090  int destroy_chain_settings(diguyChainSettings* chain_settings);
4091 
4092 
4093 /*****************************************************************************/
4103  /*l
4104  *b Description:
4105  **
4106  ** This is an enumeration of the different callbacks
4107  ** that can be registered with add_callback() and
4108  ** add_callback_script().
4109  **
4110  ** Callbacks return a value of type diguyCallbackReturn,
4111  ** which will be DIGUY_CALLBACK_STOP or DIGUY_CALLBACK_CONTINUE.
4112  ** If the callback returns DIGUY_CALLBACK_STOP, the default handler
4113  ** of the function will not be called; the callback is asserting
4114  ** that it has done everything necessary for the function call.
4115  ** If the callback returns DIGUY_CALLBACK_CONTINUE, the default
4116  ** handler for the function will be called after the callback.
4117  **
4118  *************************************************************************
4119  *4 Callback Enums:
4120  **
4121  *i CALLBACK_ID_CREATE
4122  **
4123  ** This callback will be called when a new scenario is created.
4124  ** It should only be used by
4125  ** diguyApp::add_default_scenario_callback(). Using it in
4126  ** set_callback() will have no effect, as by that time the
4127  ** scenario has already been created.
4128  **
4129  *i CALLBACK_ID_RESET
4130  **
4131  ** This callback will be called when the scenario is reset.
4132  **
4133  *i CALLBACK_ID_WAIT_CURSOR_SHOW
4134  **
4135  ** This callback will be called when a diguy operation
4136  ** is likely to take some time, allowing an application to
4137  ** display a wait cursor.
4138  **
4139  *i CALLBACK_ID_WAIT_CURSOR_HIDE
4140  **
4141  ** This callback will be called when a diguy operation
4142  ** that caused a wait cursor to be shown has completed,
4143  ** allowing an application to hide the wait cursor.
4144  **
4145  *i CALLBACK_ID_LOAD
4146  **
4147  ** This callback will be called when a scenario is loaded, thereby
4148  ** giving a chance for custom code to read extra elements from the
4149  ** loaded file.
4150  **
4151  *i CALLBACK_ID_SAVE
4152  **
4153  ** This callback will be called when a scenario is saved, thereby
4154  ** giving a chance for custom code to insert extra elements into the
4155  ** saved file.
4156  **
4157  *i CALLBACK_ID_LOAD_SCENARIO_FILE
4158  **
4159  ** This callback will be called just before a scenario loads
4160  ** a new file.
4161  **
4162  *i CALLBACK_ID_SAVE_SCENARIO_FILE
4163  **
4164  ** This callback will be called just after a scenario saves
4165  ** a new file. With a char * pointer to the file name.
4166  **
4167  *i CALLBACK_ID_MANUALLY_INVOKED
4168  **
4169  ** This callback id will be supplied to event handlers invoked
4170  ** by a call to manually_invoke_event_handler().
4171  **
4172  ** The user's returned diguyCallbackReturn value will be ignored.
4173  **
4174  *i CALLBACK_ID_POST_DRAW
4175  **
4176  ** This callback will be called just after a scenario finishes it's
4177  ** draw commands. The diguyViewPainter class can be used to issue
4178  ** abstract draw commands in DI-Guy Scenario.
4179  **
4180  *i Lua Example:
4181  **
4182  *e local painter = this_app:get_view_painter();
4183  *e painter:set_pen_color(1,1,0);
4184  *e painter:draw_line(0,0,0, 1,1,1);
4185  **
4186  *i CALLBACK_ID_PLAYBACK_MODE_CHANGED
4187  **
4188  ** This callback will be called when the playback mode of the
4189  ** scenario has changed. For example, the Play or Stop buttons are
4190  ** pressed in DI-Guy Scenario, or set_playback_mode() is called.
4191  **
4192  ** The user's returned diguyCallbackReturn value will be ignored.
4193  **
4194  *i CALLBACK_ID_INPUT_MODE_CHANGED
4195  **
4196  ** This callback will be called when the input mode of the
4197  ** scenario has changed. For example, when an Input Mode button is
4198  ** pressed in DI-Guy Scenario, or diguyApp::set_base_input_mode()
4199  ** is called.
4200  **
4201  ** The user's returned diguyCallbackReturn value will be ignored.
4202  **
4203  *i CALLBACK_ID_RENDER_MODE_CHANGED
4204  **
4205  ** This callback will be called if the render mode of the scenario
4206  ** changes, typically due to a set_current_render_mode().
4207  **
4208  ** The user's returned diguyCallbackReturn value will be ignored.
4209  **
4210  *i CALLBACK_ID_POST_LOAD_CHECKPOINT
4211  **
4212  ** This callback will be called just after a scenario finishes
4213  ** loading a checkpoint file.
4214  */
4215  enum {
4216  CALLBACK_ID_CREATE = 1,
4217  CALLBACK_ID_DESTROY,
4218  CALLBACK_ID_RESET,
4219  CALLBACK_ID_WAIT_CURSOR_SHOW,
4220  CALLBACK_ID_WAIT_CURSOR_HIDE,
4221  CALLBACK_ID_LOAD,
4222  CALLBACK_ID_SAVE,
4223  CALLBACK_ID_LOAD_SCENARIO_FILE,
4224  CALLBACK_ID_SAVE_SCENARIO_FILE,
4225  CALLBACK_ID_SCENE_OBJECT_IMPACT,
4226  CALLBACK_ID_TIMED_EVENT,
4227  CALLBACK_ID_MANUALLY_INVOKED,
4228  CALLBACK_ID_POST_DRAW,
4229  CALLBACK_ID_PLAYBACK_MODE_CHANGED,
4230  CALLBACK_ID_INPUT_MODE_CHANGED,
4231  CALLBACK_ID_RENDER_MODE_CHANGED,
4232  CALLBACK_ID_PRE_REINITIALIZE,
4233  CALLBACK_ID_POST_REINITIALIZE,
4234  CALLBACK_ID_POST_LOAD_CHECKPOINT
4235  };
4236 
4237 #ifdef CPLUSPLUS_ONLY
4238 
4239  /*l
4240  *b Description:
4241  **
4242  ** This function adds a scenario callback.
4243  **
4244  *b Arguments:
4245  **
4246  *a callback - pointer to function with prototype
4247  *a diguyScenarioCallback (typedefed above)
4248  *a callback_id - integer id of when this callback is to be called
4249  *a callback_params - not currently used; pass NULL
4250  *a callback_user_data - pointer for user's own use; DI-Guy will
4251  *a do nothing to the contents of this pointer
4252  *a beyond passing it back when the callback is
4253  *a invoked
4254  *a remove_on_scenario_load - pass 1 to remove the callback on a
4255  *a scenario load, 0 to not
4256  **
4257  *b Returns:
4258  **
4259  ** 0 on success, -1 on failure
4260  **
4261  *b Callable From:
4262  **
4263  *- - C++
4264  */
4265  int add_callback(int callback_id,
4266  diguyScenarioCallback* callback,
4267  void* callback_params = 0,
4268  void* callback_user_data = 0,
4269  int remove_on_scenario_load = 1);
4270 
4271  /*l
4272  *b Description:
4273  **
4274  ** This function removes a user callback. All callbacks matching
4275  ** the specified callback_id and callback function will be removed.
4276  **
4277  *b Arguments:
4278  **
4279  *a callback_id - integer id of callback
4280  *a callback - pointer to function with prototype
4281  *a diguyCharacterCallback (typedefed above)
4282  **
4283  *b Returns:
4284  **
4285  ** 0 on success, -1 on failure
4286  **
4287  *b Callable From:
4288  **
4289  *- - C++
4290  */
4291  int remove_callback(int callback_id,
4292  diguyScenarioCallback* callback);
4293 
4294  /*l
4295  *b Description:
4296  **
4297  ** This function removes a user callback. All callbacks matching
4298  ** the specified callback_id and callback_user_data pointer will
4299  ** be removed.
4300  **
4301  *b Arguments:
4302  **
4303  *a callback_id - integer id of callback
4304  *a callback_user_data - pointer for user's own use
4305  **
4306  *b Returns:
4307  **
4308  ** 0 on success, -1 on failure
4309  **
4310  *b Callable From:
4311  **
4312  *- - C++
4313  */
4314  int remove_callback_with_user_data(int callback_id,
4315  void* callback_user_data);
4316 
4317  /*l
4318  *b Description:
4319  **
4320  ** This function sets a default user callback that will be added to
4321  ** all new characters. See diguyCharacter::add_callback() for
4322  ** details.
4323  **
4324  *b Callable From:
4325  **
4326  *- - C++
4327  */
4328  int add_default_character_callback(int callback_id,
4329  diguyCharacterCallback* callback,
4330  void* callback_params,
4331  void* callback_user_data,
4332  int add_to_existing_objects_flag = 0,
4333  int remove_on_scenario_load = 1);
4334 
4335  /*l
4336  *b Description:
4337  **
4338  ** This function removes a user callback. All default character
4339  ** callbacks matching the specified callback_id and callback function
4340  ** will be removed.
4341  **
4342  *b Arguments:
4343  **
4344  *a callback_id - integer id of callback
4345  *a callback - pointer to function with prototype
4346  *a diguyCharacterCallback (typedefed above)
4347  **
4348  *b Callable From:
4349  **
4350  *- - C++
4351  */
4352  int remove_default_character_callback(int callback_id,
4353  diguyCharacterCallback* callback);
4354 
4355  /*l
4356  *b Description:
4357  **
4358  ** This function removes a default user callback previously added by
4359  ** add_default_character_callback(). See
4360  ** diguyCharacter::remove_callback_with_user_data() for details.
4361  **
4362  *b Callable From:
4363  **
4364  *- - C++
4365  */
4366  int remove_default_character_callback_with_user_data(int callback_id,
4367  void* callback_user_data);
4368 
4369 
4370  /*l
4371  *b Description:
4372  **
4373  ** This function sets a default user callback that will be added
4374  ** to all new sensor regions. See
4375  ** diguySensorRegion::add_callback() for details.
4376  **
4377  *b Callable From:
4378  **
4379  *- - C++
4380  */
4381  int add_default_sensor_region_callback(int callback_id,
4382  diguySensorRegionCallback* callback,
4383  void* callback_params,
4384  void* callback_user_data,
4385  int add_to_existing_objects_flag = 0,
4386  int remove_on_scenario_load = 1);
4387 
4388  /*l
4389  *b Description:
4390  **
4391  ** This function removes a user callback. All default sensor region
4392  ** callbacks matching the specified callback_id and callback function
4393  ** will be removed.
4394  **
4395  *b Arguments:
4396  **
4397  *a callback_id - integer id of callback
4398  *a callback - pointer to function with prototype
4399  *a diguyCharacterCallback (typedefed above)
4400  **
4401  *b Callable From:
4402  **
4403  *- - C++
4404  */
4405  int remove_default_sensor_region_callback(int callback_id,
4406  diguySensorRegionCallback* callback);
4407 
4408  /*l
4409  *b Description:
4410  **
4411  ** This function removes a default user callback. All default sensor
4412  ** region callbacks matching the specified callback_id and
4413  ** callback_user_data pointer will be removed.
4414  **
4415  *b Arguments:
4416  **
4417  *a callback_id - integer id of callback
4418  *a callback_user_data - pointer for user's own use
4419  **
4420  *b Callable From:
4421  **
4422  *- - C++
4423  */
4424  int remove_default_sensor_region_callback_with_user_data(int callback_id,
4425  void* callback_user_data);
4426 
4427  /*l
4428  *b Description:
4429  **
4430  ** This function adds a default user callback that will be added
4431  ** to all new signals.
4432  **
4433  *b Callable From:
4434  **
4435  *- - C++
4436  */
4437  int add_default_signal_callback(int callback_id,
4438  diguySignalCallback* callback,
4439  void* callback_params,
4440  void* callback_user_data,
4441  int add_to_existing_objects_flag = 0,
4442  int remove_on_scenario_load = 1);
4443 
4444  /*l
4445  *b Description:
4446  **
4447  ** This function removes a user callback. All default signal
4448  ** callbacks matching the specified callback_id and callback function
4449  ** will be removed.
4450  **
4451  *b Arguments:
4452  **
4453  *a callback_id - integer id of callback
4454  *a callback - pointer to function with prototype
4455  *a diguyCharacterCallback (typedefed above)
4456  **
4457  *b Callable From:
4458  **
4459  *- - C++
4460  */
4461  int remove_default_signal_callback(int callback_id,
4462  diguySignalCallback* callback);
4463 
4464  /*l
4465  *b Description:
4466  **
4467  ** This function removes a default user callback. All default signal
4468  ** callbacks matching the specified callback_id and callback_user_data
4469  ** pointer will be removed.
4470  **
4471  *b Arguments:
4472  **
4473  *a callback_id - integer id of callback
4474  *a callback_user_data - pointer for user's own use
4475  **
4476  *b Callable From:
4477  **
4478  *- - C++
4479  */
4480  int remove_default_signal_callback_with_user_data(int callback_id,
4481  void* callback_user_data);
4482 
4483  /*l
4484  *b Description:
4485  **
4486  ** This function adds a default user callback that will be added
4487  ** to all new variables.
4488  **
4489  *b Callable From:
4490  **
4491  *- - C++
4492  */
4493  int add_default_variable_callback(int callback_id,
4494  diguyVariableCallback* callback,
4495  void* callback_params,
4496  void* callback_user_data,
4497  int add_to_existing_objects_flag = 0,
4498  int remove_on_scenario_load = 1);
4499 
4500  /*l
4501  *b Description:
4502  **
4503  ** This function removes a user callback. All default variable
4504  ** callbacks matching the specified callback_id and callback function
4505  ** will be removed.
4506  **
4507  *b Arguments:
4508  **
4509  *a callback_id - integer id of callback
4510  *a callback - pointer to function with prototype
4511  *a diguyCharacterCallback (typedefed above)
4512  **
4513  *b Callable From:
4514  **
4515  *- - C++
4516  */
4517  int remove_default_variable_callback(int callback_id,
4518  diguyVariableCallback* callback);
4519 
4520  /*l
4521  *b Description:
4522  **
4523  ** This function removes a default user callback. All default
4524  ** variable callbacks matching the specified callback_id and
4525  ** callback_user_data pointer will be removed.
4526  **
4527  *b Arguments:
4528  **
4529  *a callback_id - integer id of callback
4530  *a callback_user_data - pointer for user's own use
4531  **
4532  *b Callable From:
4533  **
4534  *- - C++
4535  */
4536  int remove_default_variable_callback_with_user_data(int callback_id,
4537  void* callback_user_data);
4538 
4539  /*l
4540  *b Description:
4541  **
4542  ** This function adds a default user callback that will be added
4543  ** to all new views.
4544  **
4545  ** Note that unlike most of the other add default callback
4546  ** functions, this one's add_to_existing_objects_flag argument
4547  ** defaults to a value of 1, since views in scenarios always
4548  ** exist and are neither created nor destroyed.
4549  **
4550  *b Callable From:
4551  **
4552  *- - C++
4553  */
4554  int add_default_view_callback(int callback_id,
4555  diguyViewCallback* callback,
4556  void* callback_params,
4557  void* callback_user_data,
4558  int add_to_existing_objects_flag = 1,
4559  int remove_on_scenario_load = 1);
4560 
4561  /*l
4562  *b Description:
4563  **
4564  ** This function removes a user callback. All default view
4565  ** callbacks matching the specified callback_id and callback function
4566  ** will be removed.
4567  **
4568  *b Arguments:
4569  **
4570  *a callback_id - integer id of callback
4571  *a callback - pointer to function with prototype
4572  *a diguyCharacterCallback (typedefed above)
4573  **
4574  *b Callable From:
4575  **
4576  *- - C++
4577  */
4578  int remove_default_view_callback(int callback_id,
4579  diguyViewCallback* callback);
4580 
4581  /*l
4582  *b Description:
4583  **
4584  ** This function removes a default user callback. All default view
4585  ** callbacks matching the specified callback_id and callback_user_data
4586  ** pointer will be removed.
4587  **
4588  *b Arguments:
4589  **
4590  *a callback_id - integer id of callback
4591  *a callback_user_data - pointer for user's own use
4592  **
4593  *b Callable From:
4594  **
4595  *- - C++
4596  */
4597  int remove_default_view_callback_with_user_data(int callback_id,
4598  void* callback_user_data);
4599 
4600  /*l
4601  *b Description:
4602  **
4603  ** This function adds a default user callback that will be added
4604  ** to all cameras.
4605  **
4606  *b Callable From:
4607  **
4608  *- - C++
4609  */
4610  int add_default_camera_callback(int callback_id,
4611  diguyViewCameraCallback* callback,
4612  void* callback_params,
4613  void* callback_user_data,
4614  int add_to_existing_objects_flag = 0,
4615  int remove_on_scenario_load = 1);
4616 
4617  /*l
4618  *b Description:
4619  **
4620  ** This function removes a user callback. All default camera
4621  ** callbacks matching the specified callback_id and callback function
4622  ** will be removed.
4623  **
4624  *b Arguments:
4625  **
4626  *a callback_id - integer id of callback
4627  *a callback - pointer to function with prototype
4628  *a diguyCharacterCallback (typedefed above)
4629  **
4630  *b Callable From:
4631  **
4632  *- - C++
4633  */
4634  int remove_default_camera_callback(int callback_id,
4635  diguyViewCameraCallback* callback);
4636 
4637  /*l
4638  *b Description:
4639  **
4640  ** This function removes a default user callback. All default camera
4641  ** callbacks matching the specified callback_id and callback_user_data
4642  ** pointer will be removed.
4643  **
4644  *b Arguments:
4645  **
4646  *a callback_id - integer id of callback
4647  *a callback_user_data - pointer for user's own use
4648  **
4649  *b Callable From:
4650  **
4651  *- - C++
4652  */
4653  int remove_default_camera_callback_with_user_data(int callback_id,
4654  void* callback_user_data);
4655 
4656  /*l
4657  *b Description:
4658  **
4659  ** This function adds a default user callback that will be added
4660  ** to all new fogs.
4661  **
4662  *b Callable From:
4663  **
4664  *- - C++
4665  */
4666  int add_default_fog_callback(int callback_id,
4667  diguyViewFogCallback* callback,
4668  void* callback_params,
4669  void* callback_user_data,
4670  int add_to_existing_objects_flag = 0,
4671  int remove_on_scenario_load = 1);
4672 
4673  /*l
4674  *b Description:
4675  **
4676  ** This function removes a user callback. All default fog
4677  ** callbacks matching the specified callback_id and callback function
4678  ** will be removed.
4679  **
4680  *b Arguments:
4681  **
4682  *a callback_id - integer id of callback
4683  *a callback - pointer to function with prototype
4684  *a diguyCharacterCallback (typedefed above)
4685  **
4686  *b Callable From:
4687  **
4688  *- - C++
4689  */
4690  int remove_default_fog_callback(int callback_id,
4691  diguyViewFogCallback* callback);
4692 
4693  /*l
4694  *b Description:
4695  **
4696  ** This function removes a default user callback. All default fog
4697  ** callbacks matching the specified callback_id and callback_user_data
4698  ** pointer will be removed.
4699  **
4700  *b Arguments:
4701  **
4702  *a callback_id - integer id of callback
4703  *a callback_user_data - pointer for user's own use
4704  **
4705  *b Callable From:
4706  **
4707  *- - C++
4708  */
4709  int remove_default_fog_callback_with_user_data(int callback_id,
4710  void* callback_user_data);
4711 
4712  /*l
4713  *b Description:
4714  **
4715  ** This function adds a default user callback that will be added
4716  ** to all new lights.
4717  **
4718  *b Callable From:
4719  **
4720  *- - C++
4721  */
4722  int add_default_light_callback(int callback_id,
4723  diguyViewLightCallback* callback,
4724  void* callback_params,
4725  void* callback_user_data,
4726  int add_to_existing_objects_flag = 0,
4727  int remove_on_scenario_load = 1);
4728 
4729  /*l
4730  *b Description:
4731  **
4732  ** This function removes a user callback. All default light
4733  ** callbacks matching the specified callback_id and callback function
4734  ** will be removed.
4735  **
4736  *b Arguments:
4737  **
4738  *a callback_id - integer id of callback
4739  *a callback - pointer to function with prototype
4740  *a diguyCharacterCallback (typedefed above)
4741  **
4742  *b Callable From:
4743  **
4744  *- - C++
4745  */
4746  int remove_default_light_callback(int callback_id,
4747  diguyViewLightCallback* callback);
4748 
4749  /*l
4750  *b Description:
4751  **
4752  ** This function removes a default user callback. All default light
4753  ** callbacks matching the specified callback_id and callback_user_data
4754  ** pointer will be removed.
4755  **
4756  *b Arguments:
4757  **
4758  *a callback_id - integer id of callback
4759  *a callback_user_data - pointer for user's own use
4760  **
4761  *b Callable From:
4762  **
4763  *- - C++
4764  */
4765  int remove_default_light_callback_with_user_data(int callback_id,
4766  void* callback_user_data);
4767 
4768 #endif
4769 
4770  /*l
4771  *b Description:
4772  **
4773  ** This function causes all of the scenario callbacks with the given
4774  ** callback_id to be called now.
4775  **
4776  *b Arguments:
4777  **
4778  *a callback_id - integer id of callback
4779  */
4780  void manually_invoke_callbacks_now(int callback_id);
4781 
4782  /*l
4783  *b Description:
4784  **
4785  ** This function adds a user callback script. Callback scripts can
4786  ** be removed with remove_callback_script().
4787  **
4788  ** See diguyCharacter::add_callback_script() for an example
4789  ** of use.
4790  **
4791  *b Arguments:
4792  **
4793  *a callback_id - integer id of the callback
4794  *a callback_script - Script text of callback to be added
4795  *a callback_script_type - the type of script contained in
4796  *a callback_script
4797  *a remove_on_scenario_load - if the callback is removed when a new
4798  *a scenario is loaded
4799  **
4800  ** If NULL is passed for callback_script_type, a default script type
4801  ** will be derived based on the default script interpreter of the
4802  ** scenario.
4803  **
4804  *i Lua specific:
4805  **
4806  ** When the script is called, the object for which it is being called
4807  ** will be in the callback_object global.
4808  **
4809  ** To pass NULL when calling from a lua script, use nil.
4810  **
4811  *b Returns:
4812  **
4813  ** 0 on success, -1 on failure
4814  */
4815  int add_callback_script(int callback_id,
4816  const char* callback_script,
4817  const char* callback_script_type = NULL,
4818  int remove_on_scenario_load = 1);
4819 
4820  /*l
4821  *b Description:
4822  **
4823  ** This function removes a user callback script previously added with
4824  ** add_callback_script().
4825  **
4826  ** See diguyCharacter::remove_callback_script() for an example
4827  ** of use.
4828  **
4829  *b Arguments:
4830  **
4831  *a callback_id - integer id of the callback
4832  *a callback_script - Script text of callback previously added
4833  *a callback_script_type - the type of script contained in
4834  *a callback_script
4835  **
4836  ** If NULL is passed for callback_script, all callback
4837  ** scripts whose ids match callback_id and whose types match
4838  ** callback_script_type will be removed.
4839  **
4840  ** If NULL is passed for callback_script_type, a default script type
4841  ** will be derived based on the default script interpreter of the
4842  ** scenario.
4843  **
4844  *i Lua specific:
4845  **
4846  ** To pass NULL when calling from a lua script, use nil.
4847  **
4848  *b Returns:
4849  **
4850  ** 0 on success, -1 on failure
4851  */
4852  int remove_callback_script(int callback_id,
4853  const char* callback_script,
4854  const char* callback_script_type = NULL);
4855 
4856  /*l
4857  *b Description:
4858  **
4859  ** This function adds a default character callback script.
4860  ** The callback script will be added to all new characters.
4861  ** See diguyCharacter::add_callback_script() for
4862  ** more details.
4863  **
4864  *b Returns:
4865  **
4866  ** 0 on success, -1 on failure
4867  */
4868  int add_default_character_callback_script(int callback_id,
4869  const char* callback_script,
4870  const char* callback_script_type = NULL,
4871  int add_to_existing_objects_flag = 0,
4872  int remove_on_scenario_load = 1);
4873 
4874  /*l
4875  *b Description:
4876  **
4877  ** This function removes a default character callback script.
4878  ** See diguyCharacter::remove_callback_script() for
4879  ** more details.
4880  **
4881  *b Returns:
4882  **
4883  ** 0 on success, -1 on failure
4884  */
4885  int remove_default_character_callback_script(int callback_id,
4886  const char* callback_script,
4887  const char* callback_script_type = NULL);
4888 
4889  /*l
4890  *b Description:
4891  **
4892  ** This function adds a default sensor region callback script.
4893  ** The callback script will be added to all new sensor regions.
4894  ** See diguySensorRegion::add_callback_script() for
4895  ** more details.
4896  **
4897  *b Returns:
4898  **
4899  ** 0 on success, -1 on failure
4900  */
4901  int add_default_sensor_region_callback_script(int callback_id,
4902  const char* callback_script,
4903  const char* callback_script_type = NULL,
4904  int add_to_existing_objects_flag = 0,
4905  int remove_on_scenario_load = 1);
4906 
4907  /*l
4908  *b Description:
4909  **
4910  ** This function removes a default sensor region callback script.
4911  ** See diguySensorRegion::remove_callback_script() for
4912  ** more details.
4913  **
4914  *b Returns:
4915  **
4916  ** 0 on success, -1 on failure
4917  */
4918  int remove_default_sensor_region_callback_script(int callback_id,
4919  const char* callback_script,
4920  const char* callback_script_type = NULL);
4921 
4922  /*l
4923  *b Description:
4924  **
4925  ** This function adds a default signal callback script.
4926  ** The callback script will be added to all new signals.
4927  ** See diguySignal::add_callback_script() for
4928  ** more details.
4929  **
4930  *b Returns:
4931  **
4932  ** 0 on success, -1 on failure
4933  */
4934  int add_default_signal_callback_script(int callback_id,
4935  const char* callback_script,
4936  const char* callback_script_type = NULL,
4937  int add_to_existing_objects_flag = 0,
4938  int remove_on_scenario_load = 1);
4939 
4940  /*l
4941  *b Description:
4942  **
4943  ** This function removes a default signal callback script.
4944  ** See diguySignal::remove_callback_script() for
4945  ** more details.
4946  **
4947  *b Returns:
4948  **
4949  ** 0 on success, -1 on failure
4950  */
4951  int remove_default_signal_callback_script(int callback_id,
4952  const char* callback_script,
4953  const char* callback_script_type = NULL);
4954 
4955  /*l
4956  *b Description:
4957  **
4958  ** This function adds a default variable callback script.
4959  ** The callback script will be added to all new variables.
4960  ** See diguySignal::add_callback_script() for
4961  ** more details.
4962  **
4963  *b Returns:
4964  **
4965  ** 0 on success, -1 on failure
4966  */
4967  int add_default_variable_callback_script(int callback_id,
4968  const char* callback_script,
4969  const char* callback_script_type = NULL,
4970  int add_to_existing_objects_flag = 0,
4971  int remove_on_scenario_load = 1);
4972 
4973  /*l
4974  *b Description:
4975  **
4976  ** This function removes a default variable callback script.
4977  ** See diguySignal::remove_callback_script() for
4978  ** more details.
4979  **
4980  *b Returns:
4981  **
4982  ** 0 on success, -1 on failure
4983  */
4984  int remove_default_variable_callback_script(int callback_id,
4985  const char* callback_script,
4986  const char* callback_script_type = NULL);
4987 
4988  /*l
4989  *b Description:
4990  **
4991  ** This function adds a default view callback script.
4992  ** The callback script will be added to all new views.
4993  ** See diguyView::add_callback_script() for
4994  ** more details.
4995  **
4996  *b Returns:
4997  **
4998  ** 0 on success, -1 on failure
4999  */
5000  int add_default_view_callback_script(int callback_id,
5001  const char* callback_script,
5002  const char* callback_script_type = NULL,
5003  int add_to_existing_objects_flag = 0,
5004  int remove_on_scenario_load = 1);
5005 
5006  /*l
5007  *b Description:
5008  **
5009  ** This function removes a default character view script.
5010  ** See diguyView::remove_callback_script() for
5011  ** more details.
5012  **
5013  *b Returns:
5014  **
5015  ** 0 on success, -1 on failure
5016  */
5017  int remove_default_view_callback_script(int callback_id,
5018  const char* callback_script,
5019  const char* callback_script_type = NULL);
5020 
5021  /*l
5022  *b Description:
5023  **
5024  ** This function adds a default camera callback script.
5025  ** The callback script will be added to all new cameras.
5026  ** See diguyViewCamera::add_callback_script() for
5027  ** more details.
5028  **
5029  *b Returns:
5030  **
5031  ** 0 on success, -1 on failure
5032  */
5033  int add_default_camera_callback_script(int callback_id,
5034  const char* callback_script,
5035  const char* callback_script_type = NULL,
5036  int add_to_existing_objects_flag = 0,
5037  int remove_on_scenario_load = 1);
5038 
5039  /*l
5040  *b Description:
5041  **
5042  ** This function removes a default camera callback script.
5043  ** See diguyViewCamera::remove_callback_script() for
5044  ** more details.
5045  **
5046  *b Returns:
5047  **
5048  ** 0 on success, -1 on failure
5049  */
5050  int remove_default_camera_callback_script(int callback_id,
5051  const char* callback_script,
5052  const char* callback_script_type = NULL);
5053 
5054  /*l
5055  *b Description:
5056  **
5057  ** This function adds a default fog callback script.
5058  ** The callback script will be added to all new fogs.
5059  ** See diguyViewFog::add_callback_script() for
5060  ** more details.
5061  **
5062  *b Returns:
5063  **
5064  ** 0 on success, -1 on failure
5065  */
5066  int add_default_fog_callback_script(int callback_id,
5067  const char* callback_script,
5068  const char* callback_script_type = NULL,
5069  int add_to_existing_objects_flag = 0,
5070  int remove_on_scenario_load = 1);
5071 
5072  /*l
5073  *b Description:
5074  **
5075  ** This function removes a default fog callback script.
5076  ** See diguyViewFog::remove_callback_script() for
5077  ** more details.
5078  **
5079  *b Returns:
5080  **
5081  ** 0 on success, -1 on failure
5082  */
5083  int remove_default_fog_callback_script(int callback_id,
5084  const char* callback_script,
5085  const char* callback_script_type = NULL);
5086 
5087  /*l
5088  *b Description:
5089  **
5090  ** This function adds a default light callback script.
5091  ** The callback script will be added to all new lights.
5092  ** See diguyViewLight::add_callback_script() for
5093  ** more details.
5094  **
5095  *b Returns:
5096  **
5097  ** 0 on success, -1 on failure
5098  */
5099  int add_default_light_callback_script(int callback_id,
5100  const char* callback_script,
5101  const char* callback_script_type = NULL,
5102  int add_to_existing_objects_flag = 0,
5103  int remove_on_scenario_load = 1);
5104 
5105  /*l
5106  *b Description:
5107  **
5108  ** This function removes a default light callback script.
5109  ** See diguyViewLight::remove_callback_script() for
5110  ** more details.
5111  **
5112  *b Returns:
5113  **
5114  ** 0 on success, -1 on failure
5115  */
5116  int remove_default_light_callback_script(int callback_id,
5117  const char* callback_script,
5118  const char* callback_script_type = NULL);
5119 
5120 
5121 /*****************************************************************************/
5137  /*l
5138  *b Description:
5139  **
5140  ** This function maps the event handler with the given name
5141  ** to a callback id. This mapping will be saved in the .dss
5142  ** file and restored when the .dss file is loaded.
5143  **
5144  ** Mappings can also be made via the DI-Guy Scenario UI.
5145  **
5146  ** The event handler is one of the following:
5147  **
5148  *- - a scenario callback function registered by
5149  *- diguyApp::register_scenario_event_handler() or
5150  *- diguyApp::register_scenario_event_handler_from_library()
5151  *- - a script registered by
5152  *- diguyApp::register_scenario_event_handler_script()
5153  *- - a Script, Decision, or Library Function in the scenario
5154  *- whose "Event Type" is "Scenario"
5155  **
5156  *b Arguments:
5157  **
5158  *a callback_id - integer id of callback
5159  *a handler_name - name of the event handler to map
5160  **
5161  *b Returns:
5162  **
5163  ** 0 on success, -1 on failure
5164  */
5165  int map_event_handler_to_callback_id(int callback_id,
5166  const char* handler_name);
5167 
5168  /*l
5169  *b Description:
5170  **
5171  ** This function unmaps the event handler with the given name
5172  ** from a callback id.
5173  **
5174  *b Arguments:
5175  **
5176  *a callback_id - integer id of callback
5177  *a handler_name - name of the event handler to map
5178  *a unmap_all_matches - pass 0 to unmap only the first match,
5179  *a pass 1 to unmap all matches
5180  **
5181  *b Returns:
5182  **
5183  ** 0 on success, -1 on failure
5184  */
5185  int unmap_event_handler_from_callback_id(int callback_id,
5186  const char* handler_name,
5187  int unmap_all_matches = 0);
5188 
5189  /*l
5190  *b Description:
5191  **
5192  ** This function manually invokes the named scenario event handler.
5193  ** The callback_id that will be passed to the event handler will
5194  ** be CALLBACK_ID_MANUALLY_INVOKED.
5195  **
5196  ** Note that care should be taken not to end up in an infinite loop
5197  ** of event calls. In general an event handler should not end up
5198  ** directly or indirectly invoking itself.
5199  **
5200  ** The event handler is one of the following:
5201  **
5202  *- - a scenario callback function registered by
5203  *- diguyApp::register_scenario_event_handler() or
5204  *- diguyApp::register_scenario_event_handler_from_library()
5205  *- - a script registered by
5206  *- diguyApp::register_scenario_event_handler_script()
5207  *- - a Script, Decision, or Library Function in the scenario
5208  *- whose "Event Type" is "Scenario"
5209  **
5210  *b Arguments:
5211  **
5212  *a handler_name - name of the event handler to invoke
5213  **
5214  *b Returns:
5215  **
5216  ** DIGUY_CALLBACK_CONTINUE or DIGUY_CALLBACK_STOP
5217  **
5218  *b Callable From:
5219  **
5220  *- - C++
5221  *- - Script
5222  *- - Decision
5223  */
5224  diguyCallbackReturn manually_invoke_event_handler(const char* handler_name);
5225 
5226 #ifdef CPLUSPLUS_ONLY
5227 
5228  /*l
5229  *b Description:
5230  **
5231  ** This function registers a character event handler
5232  ** function that can later be mapped via a call to
5233  ** diguyCharacter::map_event_handler_to_callback_id().
5234  **
5235  ** Call unregister_character_event_handler() to
5236  ** unregister the function.
5237  **
5238  *b Arguments:
5239  **
5240  *a handler_name - name of the event handler
5241  *a callback - pointer to handler function
5242  *a callback_user_data - pointer for user's own use; DI-Guy will
5243  *a do nothing to the contents of this pointer
5244  *a beyond passing it back when the handler
5245  *a function is called
5246  **
5247  *b Returns:
5248  **
5249  ** 0 on success, -1 on failure
5250  **
5251  *b Callable From:
5252  **
5253  *- - C++
5254  */
5255  int register_character_event_handler(const char* handler_name,
5256  diguyCharacterCallback* callback,
5257  void* callback_user_data = 0);
5258 
5259 #endif
5260 
5261  /*l
5262  *b Description:
5263  **
5264  ** This function registers a character event handler
5265  ** function that can later be mapped via a call to
5266  ** diguyCharacter::map_event_handler_to_callback_id().
5267  **
5268  ** Unlike register_character_event_handler(), which directly
5269  ** passes a function pointer, this function looks up the
5270  ** function pointer from a shared library (a .dll under
5271  ** Windows, a .so under Unix).
5272  **
5273  ** The passed library_name should not include the
5274  ** .dll or .so extension; these will be added automatically.
5275  ** This allows for cross-platform scenarios that don't
5276  ** have differing dynamic library extensions built into
5277  ** them.
5278  **
5279  ** Call unregister_character_event_handler() to
5280  ** unregister the function.
5281  **
5282  *b Arguments:
5283  **
5284  *a handler_name - name of the event handler
5285  *a library_name - pointer to handler function
5286  *a function_name - pointer to handler function
5287  *a callback_user_data - pointer for user's own use; DI-Guy will
5288  *a do nothing to the contents of this pointer
5289  *a beyond passing it back when the handler
5290  *a function is called
5291  **
5292  *b Returns:
5293  **
5294  ** 0 on success, -1 on failure
5295  */
5296  int register_character_event_handler_from_library(const char* handler_name,
5297  const char* library_name,
5298  const char* function_name,
5299  void* callback_user_data = 0);
5300 
5301  /*l
5302  *b Description:
5303  **
5304  ** This function registers a character event handler
5305  ** script that can later be mapped via a call to
5306  ** diguyCharacter::map_event_handler_to_callback_id().
5307  **
5308  ** Call unregister_character_event_handler() to
5309  ** unregister the script.
5310  **
5311  *b Arguments:
5312  **
5313  *a handler_name - name of the event handler
5314  *a handler_script - Script text
5315  *a handler_script_type - type of script; pass NULL
5316  *a for scenario to use the default
5317  *a script interpreter
5318  **
5319  *b Returns:
5320  **
5321  ** 0 on success, -1 on failure
5322  */
5323  int register_character_event_handler_script(const char* handler_name,
5324  const char* handler_script,
5325  const char* handler_script_type = 0);
5326 
5327  /*l
5328  *b Returns:
5329  **
5330  ** 1 if there is a character event handler with the given
5331  ** name, 0 if not
5332  **
5333  *b Arguments:
5334  **
5335  *a handler_name - name of the event handler
5336  */
5337  int has_registered_character_event_handler(const char* handler_name);
5338 
5339  /*l
5340  *b Description:
5341  **
5342  ** This function unregisters a character event handler.
5343  ** This will unmap the event handler from any mappings
5344  ** it is a part of.
5345  **
5346  *b Arguments:
5347  **
5348  *a handler_name - name of the event handler
5349  **
5350  *b Returns:
5351  **
5352  ** 0 on success, -1 on failure
5353  */
5354  int unregister_character_event_handler(const char* handler_name);
5355 
5356 #ifdef CPLUSPLUS_ONLY
5357 
5358  /*l
5359  *b Description:
5360  **
5361  ** This function is analogous to the
5362  ** register_character_event_handler() function,
5363  ** but is for signals rather than characters.
5364  **
5365  *b Callable From:
5366  **
5367  *- - C++
5368  */
5369  int register_signal_event_handler(const char* handler_name,
5370  diguySignalCallback* callback,
5371  void* callback_user_data = 0);
5372 
5373 #endif
5374 
5375  /*l
5376  *b Description:
5377  **
5378  ** This function is analogous to the
5379  ** register_character_event_handler_from_library() function,
5380  ** but is for signals rather than characters.
5381  */
5382  int register_signal_event_handler_from_library(const char* handler_name,
5383  const char* library_name,
5384  const char* function_name,
5385  void* callback_user_data = 0);
5386 
5387  /*l
5388  *b Description:
5389  **
5390  ** This function is analogous to the
5391  ** register_character_event_handler_script() function,
5392  ** but is for signals rather than characters.
5393  */
5394  int register_signal_event_handler_script(const char* handler_name,
5395  const char* handler_script,
5396  const char* handler_script_type = 0);
5397 
5398  /*l
5399  *b Description:
5400  **
5401  ** This function is analogous to the
5402  ** has_registered_character_event_handler() function,
5403  ** but is for signals rather than characters.
5404  */
5405  int has_registered_signal_event_handler(const char* handler_name);
5406 
5407  /*l
5408  *b Description:
5409  **
5410  ** This function is analogous to the
5411  ** unregister_character_event_handler() function,
5412  ** but is for signals rather than characters.
5413  */
5414  int unregister_signal_event_handler(const char* handler_name);
5415 
5416 #ifdef CPLUSPLUS_ONLY
5417 
5418  /*l
5419  *b Description:
5420  **
5421  ** This function is analogous to the
5422  ** register_character_event_handler() function,
5423  ** but is for sensor regions rather than characters.
5424  **
5425  *b Callable From:
5426  **
5427  *- - C++
5428  */
5429  int register_sensor_region_event_handler(const char* handler_name,
5430  diguySensorRegionCallback* callback,
5431  void* callback_user_data = 0);
5432 
5433 #endif
5434 
5435  /*l
5436  *b Description:
5437  **
5438  ** This function is analogous to the
5439  ** register_character_event_handler_from_library() function,
5440  ** but is for sensor regions rather than characters.
5441  */
5442  int register_sensor_region_event_handler_from_library(const char* handler_name,
5443  const char* library_name,
5444  const char* function_name,
5445  void* callback_user_data = 0);
5446 
5447  /*l
5448  *b Description:
5449  **
5450  ** This function is analogous to the
5451  ** register_character_event_handler_script() function,
5452  ** but is for sensor regions rather than characters.
5453  */
5454  int register_sensor_region_event_handler_script(const char* handler_name,
5455  const char* handler_script,
5456  const char* handler_script_type = 0);
5457 
5458  /*l
5459  *b Description:
5460  **
5461  ** This function is analogous to the
5462  ** has_registered_character_event_handler() function,
5463  ** but is for sensor regions rather than characters.
5464  */
5465  int has_registered_sensor_region_event_handler(const char* handler_name);
5466 
5467  /*l
5468  *b Description:
5469  **
5470  ** This function is analogous to the
5471  ** unregister_character_event_handler() function,
5472  ** but is for sensor regions rather than characters.
5473  */
5474  int unregister_sensor_region_event_handler(const char* handler_name);
5475 
5476 #ifdef CPLUSPLUS_ONLY
5477 
5478  /*l
5479  *b Description:
5480  **
5481  ** This function is analogous to the
5482  ** register_character_event_handler() function,
5483  ** but is for variables rather than characters.
5484  **
5485  *b Callable From:
5486  **
5487  *- - C++
5488  */
5489  int register_variable_event_handler(const char* handler_name,
5490  diguyVariableCallback* callback,
5491  void* callback_user_data = 0);
5492 
5493 #endif
5494 
5495  /*l
5496  *b Description:
5497  **
5498  ** This function is analogous to the
5499  ** register_character_event_handler_from_library() function,
5500  ** but is for variables rather than characters.
5501  */
5502  int register_variable_event_handler_from_library(const char* handler_name,
5503  const char* library_name,
5504  const char* function_name,
5505  void* callback_user_data = 0);
5506 
5507  /*l
5508  *b Description:
5509  **
5510  ** This function is analogous to the
5511  ** register_character_event_handler_script() function,
5512  ** but is for variables rather than characters.
5513  */
5514  int register_variable_event_handler_script(const char* handler_name,
5515  const char* handler_script,
5516  const char* handler_script_type = 0);
5517 
5518  /*l
5519  *b Description:
5520  **
5521  ** This function is analogous to the
5522  ** has_registered_character_event_handler() function,
5523  ** but is for variables rather than characters.
5524  */
5525  int has_registered_variable_event_handler(const char* handler_name);
5526 
5527  /*l
5528  *b Description:
5529  **
5530  ** This function is analogous to the
5531  ** unregister_character_event_handler() function,
5532  ** but is for variables rather than characters.
5533  */
5534  int unregister_variable_event_handler(const char* handler_name);
5535 
5536 
5537 
5538 /*****************************************************************************/
5548  /*l
5549  *b Description:
5550  **
5551  ** This function saves the current run of the scenario to the
5552  ** specified file, and other files whose names are derived from
5553  ** the passed filename. The passed filename should end with the
5554  ** extension ".dsr" (DI-Guy Review).
5555  **
5556  ** The review data can be reloaded later by calling the load()
5557  ** function, and passing the same filename.
5558  **
5559  ** The following is saved for later review:
5560  **
5561  *- - all character positions and poses
5562  *- - sounds played by characters due to play_sound() and
5563  ** fire_weapon_n_times() calls
5564  **
5565  ** Note that Paths, Waypoints, and Event Beads per se are *not* saved,
5566  ** but rather their effects on the characters' positions and poses.
5567  **
5568  *b Arguments:
5569  **
5570  *a filename - file in which to save review data
5571  **
5572  *b Returns:
5573  **
5574  ** 0 on success, -1 on failure
5575  *b C++ Example:
5576  **
5577  *e // when shutting down the current run:
5578  *e scenario->save_review_data("review0.dsr");
5579  *e
5580  *e // when after action review is needed:
5581  *e scenario->load("review0.dsr");
5582  */
5583  int save_review_data(const char* filename);
5584 
5585  /*l
5586  *b Returns:
5587  **
5588  ** 1 if scenario was loaded from review data (from a .dsr file);
5589  ** 0 if not (from a .dss file)
5590  */
5591  int get_loaded_from_review_data();
5592 
5593  /*l
5594  *b Description:
5595  **
5596  ** This function sets what type of "history" will be kept for the
5597  ** scenario.
5598  **
5599  ** If time is run backwards in a scenario with history,
5600  ** the following will be "remembered" and replayed:
5601  **
5602  *- - camera settings currently in the primary view's camera
5603  *- - signal trigger counts
5604  *- - enabled/disabled status of scene objects
5605  *- - sounds
5606  **
5607  ** The default is DIGUY_HISTORY_TYPE_NONE for scenarios created
5608  ** using the DI-Guy API, and DIGUY_HISTORY_TYPE_COMPLETE for scenarios
5609  ** created using the DI-Guy Scenario editor.
5610  **
5611  *b Arguments:
5612  **
5613  *a history_type - history type to be used for the scenario
5614  **
5615  ** history_type should be one of the following values:
5616  **
5617  *i DIGUY_HISTORY_TYPE_NONE
5618  **
5619  ** This history type saves no history.
5620  **
5621  *i DIGUY_HISTORY_TYPE_COMPLETE
5622  **
5623  ** This history type saves a complete history.
5624  **
5625  ** DIGUY_HISTORY_TYPE_LAST and DIGUY_HISTORY_TYPE_FIRST are not
5626  ** supported for scenario history.
5627  **
5628  *b Returns:
5629  **
5630  ** 0 on success, -1 on failure
5631  */
5632  int set_history_type(diguyHistoryType history_type);
5633 
5634  /*l
5635  *b Returns:
5636  **
5637  ** the current history type of the scenario; see
5638  ** set_history_type()
5639  */
5640  diguyHistoryType get_history_type();
5641 
5642  /*l
5643  *b Description:
5644  **
5645  ** This function sets the history type for this scenario, as well as
5646  ** the history types of all characters.
5647  **
5648  ** See also diguyScenario::set_history_type() and
5649  ** diguyCharacter::set_history_type().
5650  **
5651  *b Arguments:
5652  **
5653  *a history_type - history type to be used for the scenario and all
5654  *a characters
5655  */
5656  void set_overall_history_type(diguyHistoryType overall_history_type);
5657 
5658  /*l
5659  *b Description:
5660  **
5661  ** This function returns the overall history type of the scenario.
5662  **
5663  ** The return value will be:
5664  **
5665  *- - DIGUY_HISTORY_TYPE_COMPLETE if history is enabled for the
5666  *- scenario and *all* characters
5667  *- - DIGUY_HISTORY_TYPE_PARTIAL if history is enabled for at least
5668  *- one of the scenario or any character, but not all
5669  *- - DIGUY_HISTORY_TYPE_NONE if history is not enabled for the
5670  *- scenario or any character
5671  **
5672  ** See also diguyScenario::get_history_type() and
5673  ** diguyCharacter::get_history_type().
5674  */
5675  diguyHistoryType get_overall_history_type();
5676 
5677  /*l
5678  *b Returns:
5679  **
5680  ** whether the scenario is playing back stored history
5681  */
5682  int get_replaying_history();
5683 
5684  /*l
5685  *b Description:
5686  **
5687  ** This function sets how many sound instances are kept in memory when
5688  ** history is enabled. By keeping them in memory, users can "scrub"
5689  ** backwards in time and hear sounds that were started earlier in time
5690  ** and will be resumed at the proper offset into the sound. This
5691  ** function lets users balance that need with memory management.
5692  **
5693  *b Arguments:
5694  **
5695  *a num_sound_instances - override system default of 100
5696  **
5697  *b Returns:
5698  **
5699  ** none
5700  */
5701  void set_history_max_sound_instances(int num_sound_instances);
5702 
5703 
5704 /*****************************************************************************/
5714  /*l
5715  *b Description:
5716  **
5717  ** This function sets whether automatic graphics LOD switching
5718  ** should be enabled for certain graphics environments (see below).
5719  **
5720  ** By default it is enabled in DI-Guy Scenario, and disabled in a
5721  ** DI-Guy API application.
5722  **
5723  ** There are two ways that DI-Guy calculates the proper
5724  ** graphics LOD. For some graphics environments the calculation
5725  ** is done "manually", using data from a diguyViewCamera.
5726  ** In other environments the calculation is done by the graphics
5727  ** environment itself. The method used in each graphics
5728  ** environment is noted below.
5729  **
5730  *i OpenGL Version:
5731  **
5732  ** This function enables or disables automatic LOD switching.
5733  ** In this graphics environment LOD calculations are done by
5734  ** the renderer; information from the diguyViewCamera is not
5735  ** used.
5736  **
5737  *i DI-Guy Graphics API Version:
5738  **
5739  ** This function enables or disables automatic LOD switching.
5740  ** In this graphics environment LOD calculations are done by
5741  ** the renderer; information from the diguyViewCamera is not
5742  ** used.
5743  */
5744  void set_automatic_graphics_lod_switching(int enable_graphics_lod_switching);
5745 
5747  int get_automatic_graphics_lod_switching();
5748 
5749  /*l
5750  *b Description:
5751  **
5752  ** Turns on skinned instancing system can yield much fast rendering, this value is initially
5753  ** set by use_shader_instancing in the diguy graphics init structures.
5754  */
5755  void set_instancing_enabled(int val);
5756 
5758  int get_instancing_enabled() const;
5759 
5760  /*l
5761  *b Description:
5762  **
5763  ** Sets the minimum LOD that instancing activates for this defaults to LOD 7.
5764  */
5765  void set_instancing_min_lod(int val);
5766 
5768  int get_instancing_min_lod() const;
5769 
5770 #ifdef CPLUSPLUS_ONLY
5771 
5772  /*l
5773  *b Description:
5774  **
5775  ** Sets the distances at which level of detail switching occurs
5776  ** for characters of the specified type. Existing characters
5777  ** are not affected; only newly created characters will have the
5778  ** specified LOD switching ranges.
5779  **
5780  ** Characters will display with the highest level of detail when
5781  ** viewed from a distance between ranges[0] and ranges[1].
5782  ** Characters will not display at all when viewed from further
5783  ** away than the highest switching range.
5784  **
5785  ** Note: ranges[0] should almost always be 0.0.
5786  **
5787  *b Arguments:
5788  **
5789  *a character_type - character type name, as returned by
5790  *a get_character_type_at_index()
5791  *a ranges - an array of 8 non-negative floating point numbers,
5792  *a each larger than the one before, specifying the
5793  *a LOD switching ranges in meters
5794  **
5795  ** Pass "all" for character_type to set the default ranges of all
5796  ** character types.
5797  **
5798  ** The table below indicates the number of polygons for one of the
5799  ** default soldier models in each level of detail, and the LOD
5800  ** switching ranges in effect before this function is called.
5801  **
5802  *e lod polys min max
5803  *e --------------------------
5804  *e 1 2300 0 5
5805  *e 2 900 5 10
5806  *e 3 550 10 20
5807  *e 4 280 20 40
5808  *e 5 130 40 70
5809  *e 6 60 70 100
5810  *e 7 40 100 1000
5811  **
5812  *b Callable From:
5813  **
5814  *- - C++
5815  */
5816  void set_default_lod_ranges(const char* character_type, float* ranges);
5817 
5818 #endif
5819 
5820  /*l
5821  *b Description:
5822  **
5823  ** This function sets whether view and camera settings such as
5824  ** field-of-view (FOV) and window size should be taken into account
5825  ** when determining the graphics LOD from a character's LOD ranges.
5826  **
5827  ** The camera settings that are used are taken from the current
5828  ** render camera, as set by set_render_camera(). This happens
5829  ** automatically in DI-Guy Scenario, but must be set manually
5830  ** in the DI-Guy SDK.
5831  **
5832  ** DI-Guy graphics LODs are distance-based, but this approach can
5833  ** be problematic if the current camera's FOV is very narrow; a
5834  ** narrow FOV essentially acts like a telephoto lens. In this case
5835  ** a character that is far away, and would therefore be rendered
5836  ** with few polygons, can actually be quite large in the 3D view.
5837  **
5838  ** Setting this flag to 1 will cause the FOV to be taken into account
5839  ** when calculating the effective distance of a character from the
5840  ** camera.
5841  **
5842  ** Many DI-Guy LOD distances assume that the vertical FOV of the
5843  ** view is around 40. Smaller FOVs will scale the distances larger
5844  ** so that LOD changes happen further out. Likewise larger FOVs
5845  ** will scale the distances smaller; in this case even nearby
5846  ** characters will appear small and therefore need less resolution.
5847  **
5848  *b Arguments:
5849  **
5850  ** do_scale - pass 1 to enable scaling, 0 to disable
5851  */
5852  void set_scale_graphics_lod_ranges_from_view_settings(int do_scale);
5853 
5854  /*l
5855  *b Returns:
5856  **
5857  ** most recent setting of
5858  ** set_scale_graphics_lod_ranges_from_view_settings()
5859  */
5860  int get_scale_graphics_lod_ranges_from_view_settings();
5861 
5862  /*l
5863  *b Description:
5864  **
5865  ** This function sets whether automatic motion LOD switching
5866  ** should be enabled.
5867  **
5868  ** By default it is enabled in DI-Guy Scenario, and disabled in a
5869  ** DI-Guy API application.
5870  **
5871  ** When running in a user application that uses the DI-Guy
5872  ** API, the primary view's camera's position and orientation
5873  ** must be kept consistent with the application's perception
5874  ** of current camera settings. A pointer to the primary view's
5875  ** camera can be obtained by calling get_scenario_camera().
5876  **
5877  ** The following describes the algorithm used by automatic motion
5878  ** LOD switching:
5879  **
5880  *- - if a character is in front of the primary view's camera,
5881  *- the motion LOD is set to 1 (animate all joints)
5882  *- - else set motion LOD to 5 (stop animating everything but
5883  *- base position)
5884  **
5885  ** Note that if there are multiple views open on the scenario,
5886  ** the character must be behind *all* cameras for the motion
5887  ** LOD to be set to 5.
5888  **
5889  ** Also, if the history type of the character (as set by
5890  ** diguyCharacter::set_history_type()) is anything but
5891  ** DIGUY_HISTORY_TYPE_NONE, motion LOD 1 will be used since
5892  ** during scenario playback the character might be in front
5893  ** of any camera.
5894  */
5895  void set_automatic_motion_lod_switching(int enable_motion_lod_switching);
5896 
5897  /*l
5898  *b Description:
5899  **
5900  ** This function returns whether automatic motion LOD switching
5901  ** is be enabled for characters in the scenario, as set by
5902  ** set_automatic_motion_lod_switching().
5903  **
5904  *b Returns:
5905  **
5906  ** 1 if LODs enabled; 0 if not
5907  */
5908  int get_automatic_motion_lod_switching();
5909 
5910 
5911 /*****************************************************************************/
5921  /*l
5922  *b Description:
5923  **
5924  ** This function sends the passed string through the script
5925  ** interpreter.
5926  **
5927  *b Arguments:
5928  **
5929  *a script_text - string to be evaluated
5930  *a save_as_transient - flag stating whether script_text should
5931  *a be remembered as a transient event at
5932  *a the current scenario t; see
5933  *a push_transient_script_event()
5934  *a script_type - type of script contained in script_text; pass
5935  *a NULL to use scenario's default interpreter
5936  *a script_source - string identifying the 'source' of the script;
5937  *a will be printed in error output if there are
5938  *a syntax errors in the script
5939  **
5940  *b Returns:
5941  **
5942  ** 0 on success, -1 on failure
5943  **
5944  *b C++ Example:
5945  **
5946  *e scenario->eval_script("signal1:trigger();",
5947  *e 0,
5948  *e "lua",
5949  *e "User Script");
5950  */
5951  int eval_script(const char* script_text,
5952  int save_as_transient = 0,
5953  const char* script_type = NULL,
5954  const char* script_source = NULL);
5955 
5956  /*l
5957  *b Description:
5958  **
5959  ** This function sends the contents of the specified file through
5960  ** the script interpreter.
5961  **
5962  *b Arguments:
5963  **
5964  *a filename - filename of script to be evaluated
5965  *a script_type - type of script contained in file; pass NULL
5966  *a to use the scenario's default interpreter
5967  **
5968  *b Returns:
5969  **
5970  ** 0 on success, -1 on failure
5971  **
5972  *b C++ Example:
5973  **
5974  *e scenario->eval_script_file("my_scripts.pl");
5975  */
5976  int eval_script_file(const char* filename,
5977  const char* script_type = NULL);
5978 
5979  /*l
5980  *b Description:
5981  **
5982  ** This function manually triggers a script.
5983  **
5984  *b Arguments:
5985  **
5986  *a script_name - name of the script to be triggered
5987  **
5988  *b Returns:
5989  **
5990  ** return result of script; 0 if script not found
5991  **
5992  *b Callable From:
5993  **
5994  *- - C++
5995  *- - Script
5996  *- - Decision
5997  */
5998  int trigger_script(const char* script_name);
5999 
6000  /*l
6001  *b Description:
6002  **
6003  ** This function is similar to trigger_script(), but delays the
6004  ** trigger by the specified time.
6005  **
6006  *b Arguments:
6007  **
6008  *a script_name - name of the script to be triggered
6009  *a t_delay - how many seconds to delay trigger
6010  **
6011  *b Callable From:
6012  **
6013  *- - C++
6014  *- - Script
6015  *- - Decision
6016  */
6017  void trigger_script_delayed(const char* script_name, float t_delay);
6018 
6019  /*l
6020  *b Description:
6021  **
6022  ** This function manually triggers a decision.
6023  **
6024  *b Arguments:
6025  **
6026  *a decision_name - name of the decision to be triggered
6027  **
6028  *b Returns:
6029  **
6030  ** return result of decision; 0 if decision not found
6031  **
6032  *b Callable From:
6033  **
6034  *- - C++
6035  *- - Script
6036  *- - Decision
6037  */
6038  int trigger_decision(const char* decision_name);
6039 
6040  /*l
6041  *b Description:
6042  **
6043  ** This function is similar to trigger_decision(), but delays the
6044  ** trigger by the specified time.
6045  **
6046  *b Arguments:
6047  **
6048  *a decision_name - name of the decision to be triggered
6049  *a t_delay - how many seconds to delay trigger
6050  **
6051  *b Callable From:
6052  **
6053  *- - C++
6054  *- - Script
6055  *- - Decision
6056  */
6057  void trigger_decision_delayed(const char* decision_name, float t_delay);
6058 
6059  /*l
6060  *b Description:
6061  **
6062  ** This function places the passed script text on a list of scripts
6063  ** that should be re-evaluated when the scenario is replayed from
6064  ** review data.
6065  **
6066  ** Note that the script is *not* evaluated at this time. This can be
6067  ** done by calling eval_script() and passing 1 for the
6068  ** save_as_transient argument.
6069  **
6070  ** If the scenario is reset (as in a call to reset()), all transient
6071  ** scripts will be deleted. The transient script events can be saved
6072  ** and restored by calling save_transient_script_events() and
6073  ** load_transient_script_events(), respectively.
6074  **
6075  *b Arguments:
6076  **
6077  *a t - time at which script should be re-evaluated
6078  *a during scenario playback
6079  *a script_text - Script to be evaluated
6080  *a script_type - Scripting language to use (lua)
6081  **
6082  ** A copy of the passed script text is made.
6083  **
6084  *b Returns:
6085  **
6086  ** 0 on success, -1 on failure
6087  */
6088  void push_transient_script_event(float t, const char* script_text, const char* script_type);
6089 
6090  /*l
6091  *b Description:
6092  **
6093  ** This function deletes all transient script events.
6094  */
6095  void clear_transient_script_events();
6096 
6097  /*l
6098  *b Description:
6099  **
6100  ** This function saves the transient script events to the specified
6101  ** file. They can be restored by calling
6102  ** load_transient_script_events() with the same filename.
6103  **
6104  *b Arguments:
6105  **
6106  *a filename - file in which transient script events should be saved
6107  **
6108  *b Returns:
6109  **
6110  ** 0 on success, -1 on failure
6111  */
6112  int save_transient_script_events(const char* filename);
6113 
6114  /*l
6115  *b Description:
6116  **
6117  ** This function loads transient script events saved by a call to
6118  ** save_transient_script_events().
6119  **
6120  *b Arguments:
6121  **
6122  *a filename - file from which transient script events should be
6123  *a loaded
6124  **
6125  *b Returns:
6126  **
6127  ** 0 on success, -1 on failure
6128  */
6129  int load_transient_script_events(const char* filename);
6130 
6131  /*l
6132  *b Description:
6133  **
6134  ** This function creates a package object that points to an external
6135  ** file. If the language is not specified it will be determined based
6136  ** on the filename's extension. DI-Guy will attempt to derive an
6137  ** appropriate name for the package. In DI-Guy Scenario package
6138  ** dependencies are also extracted and loaded; currently this must be
6139  ** done manually in the SDK.
6140  */
6141  int load_package(const char* filename,
6142  const char* language = NULL,
6143  int warn_if_not_found = 1);
6144 
6145  /*l
6146  *b Description:
6147  **
6148  ** Documentation Pending
6149  */
6150  int load_package_with_dependancy(const char* filename,
6151  const char* depends_on_package,
6152  const char* language = NULL,
6153  int warn_if_not_found = 1);
6154 
6155 
6156 /*****************************************************************************/
6166  /*l
6167  *b Description:
6168  **
6169  ** This function returns the number of postures the specified
6170  ** character type's actions support.
6171  **
6172  ** Use this function along with get_character_type_posture_at_index()
6173  ** to enumerate the character's postures.
6174  **
6175  *b Arguments:
6176  **
6177  *a character_type - character type name, as returned by
6178  *a get_character_type_at_index(), for example
6179  **
6180  *b Returns:
6181  **
6182  ** the number of postures the specified character type's actions
6183  ** support
6184  */
6185  int get_character_type_num_postures(const char* character_type);
6186 
6187  /*l
6188  *b Description:
6189  **
6190  ** This function returns the posture at the specified index.
6191  **
6192  ** Use this function along with get_character_type_num_postures()
6193  ** to enumerate the character's postures.
6194  **
6195  *b Arguments:
6196  **
6197  *a character_type - character type name, as returned by
6198  *a get_character_type_at_index(), for example
6199  *a index - index of the posture; indices start at 0
6200  **
6201  *b Returns:
6202  **
6203  ** the posture at the specified index
6204  */
6205  diguyMotionPosture get_character_type_posture_at_index(const char* character_type,
6206  int index);
6207 
6208  /*l
6209  *b Description:
6210  **
6211  ** This function returns the overall posture of the specified action.
6212  **
6213  ** The results of this function call can be useful in calls to the
6214  ** diguyCharacter::get_action_from_description() function, if
6215  ** for example an action with the same posture but a faster speed
6216  ** is desired.
6217  **
6218  *b Arguments:
6219  **
6220  *a character_type - character type name, as returned by
6221  *a get_character_type_at_index(), for example
6222  *a action_name - the action to query
6223  **
6224  *b Returns:
6225  **
6226  ** the overall posture of the specified action
6227  */
6228  diguyMotionPosture get_character_type_action_posture(const char* character_type,
6229  const char* action_name);
6230 
6231  /*l
6232  *b Description:
6233  **
6234  ** This function returns the number of variants the specified
6235  ** character type's actions support.
6236  **
6237  ** Use this function along with get_character_type_variant_at_index()
6238  ** to enumerate the character's variants.
6239  **
6240  ** This function differs from
6241  ** get_character_type_action_num_variants() in that this function
6242  ** returns the number of variants of *all* actions of the
6243  ** character. The other function returns the number of variants
6244  ** of a single action.
6245  **
6246  *b Arguments:
6247  **
6248  *a character_type - character type name, as returned by
6249  *a get_character_type_at_index(), for example
6250  **
6251  *b Returns:
6252  **
6253  ** the number of variants the specified character type's actions
6254  ** support
6255  */
6256  int get_character_type_num_variants(const char* character_type);
6257 
6258  /*l
6259  *b Description:
6260  **
6261  ** This function returns the variant at the specified index.
6262  **
6263  ** Use this function along with get_character_type_num_variants()
6264  ** to enumerate the character's variants.
6265  **
6266  ** This function differs from
6267  ** get_character_type_action_variant_at_index() in that this function
6268  ** returns one of the variants of *all* actions of the
6269  ** character. The other function returns one of the variants
6270  ** of a single action.
6271  **
6272  *b Arguments:
6273  **
6274  *a character_type - character type name, as returned by
6275  *a get_character_type_at_index(), for example
6276  *a index - index of the posture; indices start at 0
6277  **
6278  *b Returns:
6279  **
6280  ** the variant at the specified index
6281  */
6282  diguyMotionVariant get_character_type_variant_at_index(const char* character_type,
6283  int index);
6284 
6285  /*l
6286  *b Description:
6287  **
6288  ** This function returns the primary variant of the specified action.
6289  **
6290  *b Arguments:
6291  **
6292  *a character_type - character type name, as returned by
6293  *a get_character_type_at_index(), for example
6294  *a action_name - the action to query
6295  **
6296  *b Returns:
6297  **
6298  ** the overall variant of the specified action
6299  */
6300  diguyMotionVariant get_character_type_action_primary_variant(const char* character_type,
6301  const char* action_name);
6302 
6303  /*l
6304  *b Description:
6305  **
6306  ** This function returns the number of variants the specified
6307  ** action of the specified character type has.
6308  **
6309  ** Use this function along with
6310  ** get_character_type_action_variant_at_index()
6311  ** to enumerate the character's variants.
6312  **
6313  ** This function differs from
6314  ** get_character_type_num_variants() in that this function
6315  ** returns the number of variants of a single action of the
6316  ** character. The other function returns the number of variants
6317  ** of *all* actions.
6318  **
6319  *b Arguments:
6320  **
6321  *a character_type - character type name, as returned by
6322  *a get_character_type_at_index(), for example
6323  *a action_name - the action to query
6324  **
6325  *b Returns:
6326  **
6327  ** the number of variants of the specified action of the specified
6328  ** character type
6329  */
6330  int get_character_type_action_num_variants(const char* character_type,
6331  const char* action_name);
6332 
6333  /*l
6334  *b Description:
6335  **
6336  ** This function returns the variant at the specified index.
6337  **
6338  ** Use this function along with
6339  ** get_character_type_action_num_variants()
6340  ** to enumerate the character's variants.
6341  **
6342  ** This function differs from
6343  ** get_character_type_variant_at_index() in that this function
6344  ** returns one of the variants of a single action of the
6345  ** character. The other function returns one of the variants
6346  ** of *all* actions.
6347  **
6348  *b Arguments:
6349  **
6350  *a character_type - character type name, as returned by
6351  *a get_character_type_at_index(), for example
6352  *a index - index of the posture; indices start at 0
6353  **
6354  *b Returns:
6355  **
6356  ** the variant at the specified index
6357  */
6358  diguyMotionVariant get_character_type_action_variant_at_index(const char* character_type,
6359  const char* action_name,
6360  int index);
6361 
6362  /*l
6363  *b Description:
6364  **
6365  ** This function returns the number of directions the specified
6366  ** character type's actions can move.
6367  **
6368  ** Use the get_character_type_direction_at_index() function to
6369  ** enumerate the directions available to a character.
6370  **
6371  ** The results of this function call can be useful in calls to the
6372  ** diguyCharacter::get_action_from_description() function.
6373  **
6374  *b Arguments:
6375  **
6376  *a character_type - character type name, as returned by
6377  *a get_character_type_at_index(), for example
6378  **
6379  *b Returns:
6380  **
6381  ** the number of directions the specified character type's actions
6382  ** can move
6383  */
6384  int get_character_type_num_directions(const char* character_type);
6385 
6386  /*l
6387  *b Description:
6388  **
6389  ** Use the get_character_type_num_directions() function to
6390  ** get the number of directions available to a character.
6391  **
6392  ** The results of this function call can be useful in calls to the
6393  ** diguyCharacter::get_action_from_description() function.
6394  **
6395  *b Arguments:
6396  **
6397  *a character_type - character type name, as returned by
6398  *a get_character_type_at_index(), for example
6399  *a index - index of the direction; indices start at 0
6400  **
6401  *b Returns:
6402  **
6403  ** the direction at the specified index
6404  */
6405  diguyMotionDirection get_character_type_direction_at_index(const char* character_type,
6406  int index);
6407 
6408 
6409 /*****************************************************************************/
6435  /*l
6436  *b Returns:
6437  **
6438  ** number of interaction machines in the scenario
6439  */
6440  int get_num_interaction_machines();
6441 
6442  /*l
6443  *b Description:
6444  **
6445  ** This function creates a new interaction machine and returns a
6446  ** pointer to it.
6447  **
6448  ** Note that there is a shared interaction machine that always
6449  ** exists; a pointer to it can be obtained by calling
6450  ** get_shared_interaction_machine(). See that function for more
6451  ** details.
6452  **
6453  *b Arguments:
6454  **
6455  *a name - name of the new interaction machine
6456  **
6457  *b Returns:
6458  **
6459  ** pointer of type diguyInteractionMachine; NULL if creation failed
6460  */
6461  diguyInteractionMachine* create_interaction_machine(const char* name);
6462 
6463  /*l
6464  *b Description:
6465  **
6466  ** This function destroys the passed interaction machine.
6467  **
6468  ** NOTE: This function should not be called on the shared
6469  ** interaction machine returned by get_shared_interaction_machine().
6470  **
6471  *b Arguments:
6472  **
6473  *a interaction_machine - pointer to a diguyInteractionMachine
6474  *a to be destroyed
6475  */
6476  void destroy_interaction_machine(diguyInteractionMachine* interaction_machine);
6477 
6478  /*l
6479  *b Returns:
6480  **
6481  ** pointer of type diguyInteractionMachine; NULL if no interaction
6482  ** machine at the specified index
6483  **
6484  *b Arguments:
6485  **
6486  *a index - index of the interaction machine; indices start at 0
6487  */
6488  diguyInteractionMachine* get_interaction_machine_at_index(int index);
6489 
6490  /*l
6491  *b Description:
6492  **
6493  ** This function returns a pointer to the specified interaction
6494  ** machine.
6495  **
6496  *b Arguments:
6497  **
6498  *a name - name of interaction machine to be found
6499  **
6500  *b Returns:
6501  **
6502  ** pointer of type diguyInteractionMachine; NULL if not found
6503  */
6504  diguyInteractionMachine* find_interaction_machine(const char* name);
6505 
6506  /*l
6507  *b Description:
6508  **
6509  ** This function returns a pointer to the "active" interaction
6510  ** machine. Only one interaction machine can be showing and
6511  ** accepting input at a time.
6512  **
6513  *b Returns:
6514  **
6515  ** pointer of type diguyInteractionMachine; NULL if no interaction
6516  ** machine is active.
6517  */
6518  diguyInteractionMachine* get_active_interaction_machine();
6519 
6520  /*l
6521  *b Description:
6522  **
6523  ** This function returns a pointer to the shared interaction machine
6524  ** that is always available.
6525  **
6526  ** This shared interaction machine is convenient for quick
6527  ** alerts, notifications, or questions. Because it is shared,
6528  ** however, most or all of its parameters need to be set each
6529  ** time it is to be shown.
6530  **
6531  ** Do not call destroy_interaction_machine() on the returned
6532  ** object. It is owned by the scenario.
6533  **
6534  *b Returns:
6535  **
6536  ** pointer of type diguyInteractionMachine; should never be NULL
6537  */
6538  diguyInteractionMachine* get_shared_interaction_machine();
6539 
6540  /*l
6541  *b Description:
6542  **
6543  ** This is a convenience function for using the shared interaction
6544  ** machine to show a notification to the user. It sets parameters
6545  ** of the shared interaction machine based on the passed info and
6546  ** shows/activates the machine.
6547  **
6548  *b Arguments:
6549  **
6550  *a heading - text that will be at the top of the dialog
6551  *a info - informational text
6552  *a pause_scenario - pass 1 to pause the scenario while the
6553  *a interaction machine is active, 0 to leave
6554  *a the scenario running if it was when this
6555  *a function was called
6556  *a input_text - text that user will have to click to dismiss
6557  *a the interaction machine; something like "Ok"
6558  *a is typical
6559  *a ui_appearance - the color theme of the interaction machine
6560  **
6561  ** See the diguyInteractionMachine documentation for more information
6562  ** on what the various parameters mean.
6563  **
6564  *b Returns:
6565  **
6566  ** 0 on success, -1 on failure
6567  **
6568  *b Lua Example:
6569  **
6570  *e this_scenario:show_notification_with_shared_interaction_machine(
6571  *e "WARNING!",
6572  *e "Moving any closer to the harmful gas is not advised.",
6573  *e 0,
6574  *e "Ok",
6575  *e diguyInteractionMachine_UI_APPEARANCE_NOTIFICATION);
6576  **
6577  */
6578  int show_notification_with_shared_interaction_machine(const char* heading,
6579  const char* info,
6580  int pause_scenario = 0,
6581  const char* input_text = NULL,
6583 
6584 
6585 /*****************************************************************************/
6595  /*l
6596  *b Description:
6597  **
6598  ** This function returns a pointer to the I-Guy controller object
6599  ** of the scenario.
6600  **
6601  *b Returns:
6602  **
6603  ** pointer of type diguyIGuyController; should never be NULL
6604  */
6605  diguyIGuyController* get_iguy_controller();
6606 
6607 
6608 /*****************************************************************************/
6618  /*l
6619  *b Description:
6620  **
6621  ** This function finds the diguyViewLabel with the given name or
6622  ** creates it if it doesn't exist.
6623  **
6624  *b Arguments:
6625  **
6626  *a name - name of the diguyViewLabel to find or create
6627  **
6628  *b Returns:
6629  **
6630  ** pointer of type diguyViewLabel; should never be NULL
6631  */
6632  diguyViewLabel* find_or_create_label(const char* name);
6633 
6634  /*l
6635  *b Description:
6636  **
6637  ** This function returns a pointer to the specified diguyViewLabel.
6638  **
6639  *b Arguments:
6640  **
6641  *a name - name of diguyViewLabel to be found
6642  **
6643  *b Returns:
6644  **
6645  ** pointer of type diguyViewLabel; NULL if not found
6646  */
6647  diguyViewLabel* find_label(const char* name);
6648 
6649  /*l
6650  *b Description:
6651  **
6652  ** This function destroys the passed in diguyViewLabel.
6653  **
6654  *b Arguments:
6655  **
6656  *a label - pointer to a diguyViewLabel
6657  **
6658  *b Returns:
6659  **
6660  ** 0 on success, -1 on failure
6661  */
6662  int destroy_label(diguyViewLabel* label);
6663 
6664  /*l
6665  *b Returns:
6666  **
6667  ** The number of diguyViewLabel objects in the scenario.
6668  */
6669  int get_num_labels();
6670 
6671  /*l
6672  *b Returns:
6673  **
6674  ** The diguyViewLabel at the given index.
6675  **
6676  *b Arguments:
6677  **
6678  *a index - index of the diguyViewLabel; indices start at 0
6679  */
6680  diguyViewLabel* get_label_at_index(int index);
6681 
6682  /*l
6683  *b Description:
6684  **
6685  ** This function removes all diguyViewLabels in the scenario.
6686  */
6687  void reset_labels();
6688 
6689  /*l
6690  *b Description:
6691  **
6692  ** This function moves the specified diguyViewLabel to the front of
6693  ** the drawing list. This is sometimes necessary if labels overlap.
6694  **
6695  *b Arguments:
6696  **
6697  *a label - pointer to diguyViewLabel to move
6698  */
6699  void send_label_to_front(diguyViewLabel* label);
6700 
6701  /*l
6702  *b Description:
6703  **
6704  ** This function moves the specified diguyViewLabel to the back of
6705  ** the drawing list. This is sometimes necessary if labels overlap.
6706  **
6707  *b Arguments:
6708  **
6709  *a label - pointer to diguyViewLabel to move
6710  */
6711  void send_label_to_back(diguyViewLabel* label);
6712 
6713  /*l
6714  *b Description:
6715  **
6716  ** Functions that allow the built-in OGL renderer to draw labels on screen for
6717  ** debugging use, update_character_labels must be called first.
6718  **
6719  *e scenario->update_character_labels();
6720  *e scenario->draw_character_labels();
6721  **
6722  *b Returns:
6723  **
6724  ** -1 if not possible to draw labels
6725  */
6726  int draw_character_labels();
6727 
6729  void update_character_labels();
6730 
6731 /*****************************************************************************/
6741  /*l
6742  *b Description:
6743  **
6744  ** This function finds the diguyViewButtonPanel with the given name or
6745  ** creates it if it doesn't exist.
6746  **
6747  *b Arguments:
6748  **
6749  *a name - name of the diguyViewButtonPanel to find or create
6750  **
6751  *b Returns:
6752  **
6753  ** pointer of type diguyViewButtonPanel; should never be NULL
6754  */
6755  diguyViewButtonPanel* find_or_create_panel(const char* name,
6756  int horizontal = 0,
6757  int title = 1);
6758 
6759  /*l
6760  *b Description:
6761  **
6762  ** This function returns a pointer to the specified
6763  ** diguyViewButtonPanel.
6764  **
6765  *b Arguments:
6766  **
6767  *a name - name of diguyViewButtonPanel to be found
6768  **
6769  *b Returns:
6770  **
6771  ** pointer of type diguyViewButtonPanel; NULL if not found
6772  */
6773  diguyViewButtonPanel* find_panel(const char* name);
6774 
6775  /*l
6776  *b Description:
6777  **
6778  ** This function destroys the passed in diguyViewButtonPanel.
6779  **
6780  *b Arguments:
6781  **
6782  *a panel - pointer to a diguyViewButtonPanel
6783  **
6784  *b Returns:
6785  **
6786  ** 0 on success, -1 on failure
6787  */
6788  int destroy_panel(diguyViewButtonPanel* panel);
6789 
6790  /*l
6791  *b Returns:
6792  **
6793  ** The number of diguyViewButtonPanel objects in the scenario.
6794  */
6795  int get_num_panels();
6796 
6797  /*l
6798  *b Returns:
6799  **
6800  ** The diguyViewButtonPanel at the given index.
6801  **
6802  *b Arguments:
6803  **
6804  *a index - index of the diguyViewButtonPanel; indices start at 0
6805  */
6806  diguyViewButtonPanel* get_panel_at_index(int index);
6807 
6808 
6809 /*****************************************************************************/
6822  /*l
6823  *b Description:
6824  **
6825  ** This function returns the number of AI minds that are available to
6826  ** AI agent characters.
6827  **
6828  *b Returns:
6829  **
6830  ** number of available minds
6831  */
6832  int get_num_minds();
6833 
6834  /*l
6835  *b Returns:
6836  **
6837  ** name of the AI mind at the specified index
6838  */
6839  const char* get_mind_name_at_index(int index);
6840 
6841  /*l
6842  *b Description:
6843  **
6844  ** This function tests if a diguyCharacter pointer is a valid pointer.
6845  ** This is done by comparing the passed address to those of all
6846  ** characters in the scenario. The function is not exceedingly fast
6847  ** but can be useful when building AI that functions in a networked
6848  ** environment.
6849  **
6850  *b Returns:
6851  **
6852  ** 0 if invalid, 1 if valid
6853  */
6854  int is_valid_character_pointer(diguyCharacter* character);
6855 
6856  /*l
6857  *b Description:
6858  **
6859  ** This function tests if a diguyCharacterGroup pointer is a valid
6860  ** pointer. This is done by comparing the passed address to those of
6861  ** all groups in the scenario. The function is not exceedingly fast
6862  ** but can be useful when building AI that functions in a networked
6863  ** environment.
6864  **
6865  *b Returns:
6866  **
6867  ** 0 if invalid, 1 if valid
6868  */
6869  int is_valid_character_group_pointer(diguyCharacterGroup* character_group);
6870 
6871 /*****************************************************************************/
6887  /*l
6888  *b Description:
6889  **
6890  ** This function creates a new crowd and returns a pointer to it.
6891  **
6892  ** A Lua object is also created that has a pointer to this crowd.
6893  ** This object can be retrieved by calling find_lua_crowd(crowd_name)
6894  ** or find_lua_crowd(diguyCrowd* pointer) in lua.
6895  **
6896  *b Arguments:
6897  **
6898  *a name - name of crowd to be created
6899  *a make_companion_of_all - pass 1 to make this crowd a companion
6900  *a of all existing crowds
6901  **
6902  *b Returns:
6903  **
6904  ** pointer of type diguyCrowd
6905  */
6906  diguyCrowd* create_crowd(const char* name,
6907  int make_companion_of_all = 1);
6908 
6909  /*l
6910  *b Description:
6911  **
6912  ** This function destroys a crowd. It can also optionally destroy the
6913  ** characters that are crowd members, and the path shape that is
6914  ** associated with the crowd.
6915  **
6916  *b Arguments:
6917  **
6918  *a crowd - pointer to a diguyCrowd
6919  *a also_destroy_crowd_members - pass 1 to also destroy crowd member
6920  *a characters
6921  *a also_destroy_path_shapes - pass 1 to also destroy crowd-
6922  *a associated path shapes
6923  *a delay_destruction - pass 1 to wait till the next update
6924  *a call to destroy the crowd; can avoid
6925  *a crashes when AI's receive destruction
6926  *a messages
6927  **
6928  *b Returns:
6929  **
6930  ** 0 on success, -1 on failure
6931  */
6932  int destroy_crowd(diguyCrowd* crowd,
6933  int also_destroy_crowd_members = 0,
6934  int also_destroy_path_shapes = 0,
6935  int delay_destruction = 0);
6936 
6937  /*l
6938  *b Returns:
6939  **
6940  ** the number of crowds in the scenario
6941  */
6942  int get_num_crowds();
6943 
6944  /*l
6945  *b Returns:
6946  **
6947  ** pointer of type diguyCrowd; NULL if no crowd at the specified index
6948  **
6949  *b Arguments:
6950  **
6951  *a index - index of the crowd; indices start at 0
6952  */
6953  diguyCrowd* get_crowd_at_index(int index);
6954 
6955  /*l
6956  *b Returns:
6957  **
6958  ** A unique name based on base_name, e.g. "my_crowd7" from "my_crowd".
6959  **
6960  *b Arguments:
6961  **
6962  *a base_name - base string from which to build a unique name
6963  */
6964  const char* get_unique_crowd_name(const char* base_name);
6965 
6966  /*l
6967  *b Description:
6968  **
6969  ** This function returns a pointer to the specified crowd.
6970  **
6971  *b Arguments:
6972  **
6973  *a name - name of crowd to be found
6974  **
6975  *b Returns:
6976  **
6977  ** pointer of type diguyCrowd; NULL if not found
6978  */
6979  diguyCrowd* find_crowd(const char* crowd_name);
6980 
6981  /*l
6982  *b Description:
6983  **
6984  ** This function returns a pointer to the crowd with the given
6985  ** name. A new crowd with the given name will be created if
6986  ** it doesn't already exist.
6987  **
6988  *b Arguments:
6989  **
6990  *a name - name of the crowd to find or create
6991  *a make_companion_of_all - pass 1 to make this crowd a companion
6992  *a of all existing crowds
6993  **
6994  *b Returns:
6995  **
6996  ** pointer of type diguyCrowd; should never be NULL
6997  */
6998  diguyCrowd* find_or_create_crowd(const char* crowd_name,
6999  int make_companion_of_all = 1);
7000 
7001  /*l
7002  *b Description:
7003  **
7004  ** This function sets whether crowds should be created for
7005  ** incoming network entities.
7006  **
7007  *b Arguments:
7008  **
7009  *a do_create - pass 1 to create network crowds; 0 to not
7010  */
7011  void set_create_network_crowds(int do_create);
7012 
7013  /*l
7014  *b Returns:
7015  **
7016  *a 1 if network crowds will be created; 0 if not
7017  **
7018  */
7019  int get_create_network_crowds();
7020 
7021 
7022 /*****************************************************************************/
7037  /*l
7038  *b Description:
7039  **
7040  ** This function creates a new crowd profile and returns a
7041  ** pointer to it.
7042  **
7043  *b Arguments:
7044  **
7045  *a name - name of crowd profile to be created
7046  **
7047  *b Returns:
7048  **
7049  ** pointer of type diguyCrowdProfile
7050  */
7051  diguyCrowdProfile* create_crowd_profile(const char* name);
7052 
7053  /*l
7054  *b Description:
7055  **
7056  ** This function destroys a crowd profile.
7057  **
7058  *b Arguments:
7059  **
7060  *a crowd_profile - pointer to a diguyCrowdProfile
7061  **
7062  *b Returns:
7063  **
7064  ** 0 on success, -1 on failure
7065  */
7066  int destroy_crowd_profile(diguyCrowdProfile* crowd_profile);
7067 
7068  /*l
7069  *b Returns:
7070  **
7071  ** The number of crowd profiles in the scenario.
7072  */
7073  int get_num_crowd_profiles();
7074 
7075  /*l
7076  *b Returns:
7077  **
7078  ** pointer of type diguyCrowdProfile; NULL if no crowd profile
7079  ** at the specified index
7080  **
7081  *b Arguments:
7082  **
7083  *a index - index of the crowd profile; indices start at 0
7084  */
7085  diguyCrowdProfile* get_crowd_profile_at_index(int index);
7086 
7087  /*l
7088  *b Description:
7089  **
7090  ** This function returns a pointer to the specified crowd profile.
7091  **
7092  *b Arguments:
7093  **
7094  *a name - name of crowd profile to be found
7095  **
7096  *b Returns:
7097  **
7098  ** pointer of type diguyCrowdProfile; NULL if not found
7099  */
7100  diguyCrowdProfile* find_crowd_profile(const char* name);
7101 
7102 
7103 /*****************************************************************************/
7113  /*l
7114  *b Returns:
7115  **
7116  ** pointer of type diguyLoadManager; this scenario's character
7117  ** load manager
7118  */
7119  diguyLoadManager* get_character_load_manager();
7120 
7121 
7122 /*****************************************************************************/
7132  /*l
7133  *b Description:
7134  **
7135  ** This function forces the octtree to rebuild if it's out of date.
7136  */
7137  int force_octtree_generation();
7138 
7139  /*l
7140  *b Description:
7141  **
7142  ** Documentation Pending
7143  */
7144  void add_character_to_octtree(diguyCharacter* character,
7145  int use_bounding_box_only = 0);
7146 
7147  /*l
7148  *b Description:
7149  **
7150  ** Documentation Pending
7151  */
7152  void remove_character_from_octtree(diguyCharacter* character);
7153 
7154  /*l
7155  *b Description:
7156  **
7157  ** Documentation Pending
7158  */
7159  int preload_octtree(const char* character_type, const char* appearance);
7160 
7161  /*l
7162  *b Description:
7163  **
7164  ** This function uses the octtree to check if the path between x1,
7165  ** y1, z1 and x2, y2, z2 has any static obstructions.
7166  **
7167  *b Returns:
7168  **
7169  ** 1 if the path is clear, 0 if static obstructions are present.
7170  */
7171  int check_visibility(float x1, float y1, float z1,
7172  float x2, float y2, float z2);
7173 
7174 
7175 /*****************************************************************************/
7185 #ifdef CPLUSPLUS_ONLY
7186 
7187  /*l
7188  *b Description:
7189  **
7190  ** This function sets a default altitude function that will be added
7191  ** to all new characters. It can be overridden on a per-character
7192  ** basis by a call to diguyCharacter::set_altitude_function(). See
7193  ** that function for details.
7194  **
7195  *b Callable From:
7196  **
7197  *- - C++
7198  */
7199  int set_default_character_altitude_function(diguyAltitudeFunction* altitude_function);
7200 
7201  /*l
7202  *b Description:
7203  **
7204  ** This function sets a generic altitude function for the scenario
7205  ** that is used for local path clamping and other operations that
7206  ** require the altitude at specific x, y coordinates to be calculated.
7207  **
7208  ** The ground_clamp() function can also optionally use the registered
7209  ** function.
7210  **
7211  ** DI-Guy Scenario has a default altitude function; replacing the
7212  ** default function is not recommended.
7213  **
7214  *b Callable From:
7215  **
7216  *- - C++
7217  */
7218  void set_altitude_function(diguyScenarioAltitudeFunction* altitude_function);
7219 
7220  /*l
7221  *b Returns:
7222  **
7223  ** the altitude function for the scenario as set by
7224  ** set_altitude_function()
7225  **
7226  *b Callable From:
7227  **
7228  *- - C++
7229  */
7230  diguyScenarioAltitudeFunction* get_altitude_function();
7231 
7232 #endif
7233 
7234  /*
7235  * Documentation Pending
7236  */
7237  void set_altitude_max_climb(float altitude_max_climb);
7238 
7239  /*
7240  * Documentation Pending
7241  */
7242  float get_altitude_max_climb();
7243 
7244  /*
7245  * Documentation Pending
7246  */
7247  void set_altitude_max_drop(float altitude_max_drop);
7248 
7249  /*
7250  * Documentation Pending
7251  */
7252  float get_altitude_max_drop();
7253 
7254 
7255 /*****************************************************************************/
7265  /*l
7266  *b Description:
7267  **
7268  ** Sets the default intersection function. This function will be used to determine
7269  ** whether there is an intersection between a specified ray and the world.
7270  */
7271  static void set_default_intersection_function(diguyScenarioIntersectionFunction* intersection_function);
7272  void set_intersection_function(diguyScenarioIntersectionFunction* intersection_function);
7273 
7274  /*l
7275  *b Description:
7276  **
7277  ** Creates a detonation using the specified munition name. If the
7278  ** DI-Guy networking module is enabled the detonation is broadcast
7279  ** over the network.
7280  **
7281  *b Arguments:
7282  **
7283  *a munition_name - name of the munition to detonate; this will
7284  *a potentially trigger special effects depending
7285  *a on the munition
7286  *a x, y, z - location of the detonation
7287  *a attacker_name - this MUST be specified if the detonation is being
7288  *a broadcast over the network
7289  *a radius_override - defaults to the data in the munition config file
7290  *a broadcast_on_network - pass 0 to not broadcast detonation on DIS
7291  *a network
7292  **
7293  ** Note: Overriding the detonation radius will NOT work on broadcast
7294  ** detonations since the override value is not transmitted.
7295  */
7296  int trigger_detonation(const char* munition_name,
7297  float x, float y, float z,
7298  const char* attacker_name = NULL,
7299  float radius_override = -1.0f,
7300  int broadcast_on_network = 1);
7301 
7302  /*l
7303  *b Description:
7304  **
7305  ** This function checks for intersection against characters in the
7306  ** specified view.
7307  **
7308  ** To check for intersections against both characters and scene
7309  ** objects, call get_intersection_at_screen_coords().
7310  **
7311  ** The returned diguyImpact pointer is owned by the scenario and
7312  ** should not be deleted. It will remain valid until the next call
7313  ** to any one of the following functions:
7314  **
7315  *- - find_character_at_screen_coords()
7316  *- - get_impact_at_screen_coords()
7317  *- - get_intersection_at_screen_coords()
7318  **
7319  *i This function should only be called from a DI-Guy Scenario Plugin.
7320  **
7321  *b Arguments:
7322  **
7323  *a view - view to check
7324  *a sx, sy - view coordinates to check
7325  **
7326  *b Returns:
7327  **
7328  ** pointer of type diguyImpact; NULL if no character intersected
7329  **
7330  *b Callable From:
7331  **
7332  *- - DI-Guy Scenario Plugin
7333  */
7334  diguyImpact* find_character_at_screen_coords(diguyView* view,
7335  float sx,
7336  float sy);
7337 
7338  /*l
7339  *b Description:
7340  **
7341  ** This function creates an impact object based on the sx and sy in
7342  ** the specified view. This function will trigger an impact callback
7343  ** on individuals who are touched, (it will not however kill
7344  ** characters who don't have impact callbacks.
7345  **
7346  ** The returned diguyImpact pointer is owned by the scenario and
7347  ** should not be deleted. It will remain valid until the next call
7348  ** to any one of the following functions:
7349  **
7350  *- - find_character_at_screen_coords()
7351  *- - get_impact_at_screen_coords()
7352  *- - get_intersection_at_screen_coords()
7353  **
7354  *i This function should only be called from a DI-Guy Scenario Plugin.
7355  **
7356  *b Arguments:
7357  **
7358  *a view - view to check
7359  *a sx, sy - view coordinates to check
7360  *a use_octtree - use the octtree; will not test against all
7361  *a characters unless they are explicitly added,
7362  *a but much faster
7363  **
7364  *b Returns:
7365  **
7366  ** pointer of type diguyImpact;
7367  **
7368  *b Callable From:
7369  **
7370  *- - DI-Guy Scenario Plugin
7371  */
7372  diguyImpact* get_impact_at_screen_coords(diguyView* view,
7373  float sx,
7374  float sy,
7375  int use_octtree = 0);
7376 
7377  /*l
7378  *b Description:
7379  **
7380  ** This function checks for intersection against the world *and*
7381  ** characters in the specified view. Unlike the function
7382  ** get_impact_at_screen_coords(), this function doesn't trigger
7383  ** callbacks; instead, it just fills out the impact info.
7384  **
7385  ** The returned diguyImpact pointer is owned by the scenario and
7386  ** should not be deleted. It will remain valid until the next call to
7387  ** any one of the following functions:
7388  **
7389  *- - find_character_at_screen_coords()
7390  *- - get_impact_at_screen_coords()
7391  *- - get_intersection_at_screen_coords()
7392  **
7393  *i This function should only be called from a DI-Guy Scenario Plugin.
7394  **
7395  *b Arguments:
7396  **
7397  *a view - view to check
7398  *a sx, sy - view coordinates to check
7399  *a use_octtree - use the octtree; will not test against all
7400  *a characters unless they are explicitly added,
7401  *a but much faster
7402  **
7403  *b Returns:
7404  **
7405  ** diguyImpact with the xyz location of the intersection; NULL if
7406  ** there was nothing to intersect there
7407  **
7408  *b Callable From:
7409  **
7410  *- - DI-Guy Scenario Plugin
7411  */
7412  diguyImpact* get_intersection_at_screen_coords(diguyView* view,
7413  float sx,
7414  float sy,
7415  int use_octtree = 0);
7416 
7417  /*l
7418  *b Description:
7419  **
7420  ** This function checks for intersection against the world and returns
7421  ** basic collision results.
7422  **
7423  ** This function will only return valid results in environments where
7424  ** the DI-Guy geometry octtree is available; currently that is when
7425  ** using OpenGL and the DI-Guy flight geometry loader. DI-Guy
7426  ** Scenario is such a case.
7427  **
7428  *b Arguments:
7429  **
7430  *a origin_x, origin_y, origin_z - starting location of the ray trace
7431  *a dir_x, dir_y, dir_z - direction of ray trace
7432  *a max_distance_to_test - max distance ray will travel;
7433  *a -1.0 will test an infinitely long ray
7434  *a intersection_x, _y, and _z - world location of intersection
7435  *a normal_x, normal_y, normal_z - normal of intersection surface
7436  **
7437  ** Smaller values for max_distance_to_test will result in better
7438  ** performance.
7439  **
7440  ** The location of the intersection point is returned in the
7441  ** intersection x, y, and z pointers.
7442  **
7443  ** The normal of the surface intersected is returned in the normal
7444  ** x, y, and z pointers.
7445  **
7446  *b Returns:
7447  **
7448  ** 1 if intersection occurred, 0 if not.
7449  */
7450  int intersect_static_geometry(
7451  float origin_x, float origin_y, float origin_z,
7452  float dir_x, float dir_y, float dir_z,
7453  float max_distance_to_test,
7454  float* intersection_x, float* intersection_y, float* intersection_z,
7455  float* normal_x = NULL, float* normal_y = NULL, float* normal_z = NULL,
7456  int use_callback = 1);
7457 
7458  /*l
7459  *b Description:
7460  **
7461  ** This function returns the z height, or altitude, under the passed
7462  ** x, y, z point.
7463  **
7464  ** Two methods can be used to determine the altitude: using the
7465  ** scenario altitude function or using the internal octtree calculated
7466  ** from terrain geometry.
7467  **
7468  ** See set_altitude_function() for information on the scenario
7469  ** altitude function. In DI-Guy Scenario it defaults to using the
7470  ** octtree when it's available, and falls back on using a screen
7471  ** render and Z-buffer check when it's not.
7472  **
7473  ** Note that the octtree is not always available. In general it is
7474  ** available only in DI-Guy Scenario, or when the built-in OpenGL
7475  ** renderer and DI-Guy flight geometry loader are in use.
7476  **
7477  *b Arguments:
7478  **
7479  *a x, y, z - world location to ground clamp
7480  *a valid - optional pointer to get an explicit result if anything
7481  *a was hit
7482  *a use_altitude_function - pass 1 to use scenario altitude function
7483  *a use_octtree - pass 1 to use internal octtree
7484  **
7485  *b Returns:
7486  **
7487  ** new_z if ground clamp was possible, original z if not
7488  */
7489  float ground_clamp(float x, float y, float z,
7490  int* valid = NULL,
7491  int use_altitude_function = 1,
7492  int use_octtree = 0);
7493 
7494 
7495 #ifdef CPLUSPLUS_ONLY
7496 
7497  /******************************************************
7498  **
7499  *4 Impact Callback Functions:
7500  **
7501  ** Unless otherwise specified, callable from:
7502  **
7503  *- - C++
7504  *- - Script
7505  */
7506 
7507  /*l
7508  *b Description:
7509  **
7510  ** The following prototype should be used for the impact
7511  ** function:
7512  **
7513  *e int impact_func(diguyImpact* impact,
7514  *e float from_x,
7515  *e float from_y,
7516  *e float from_z,
7517  *e float to_x,
7518  *e float to_y,
7519  *e float to_z,
7520  *e diguyScenario* s);
7521  **
7522  ** When a character fires their weapon, DI-Guy calls this function
7523  ** with a pointer to the diguyImpact that must be filled out, the x,
7524  ** y, z position of the shot, and the target x, y, z.
7525  **
7526  ** The impact function should then do an intersection test and return
7527  ** 1 if a hit occurred.
7528  **
7529  ** By default the impact should have both the attacker and the
7530  ** munition type already specified. The intersection function must at
7531  ** least call diguyImpact::set_valid_impact() for the system to
7532  ** consider the impact valid. See diguyImpact for a sample function.
7533  **
7534  *b Callable From:
7535  **
7536  *- - C++
7537  */
7538  int set_fire_weapon_intersection_function(diguyScenarioFindImpactOnLineFunction* impact_function);
7539 
7540  /*l
7541  *b Description:
7542  **
7543  ** This function sets an impact function that will be added to all new
7544  ** scenarios. It can be overridden by an explicit call to
7545  ** diguyScenario::set_fire_weapon_intersection_function(). See that
7546  ** function for details.
7547  **
7548  *b Callable From:
7549  **
7550  *- - C++
7551  */
7552  static void set_default_fire_weapon_intersection_function(diguyScenarioFindImpactOnLineFunction* impact_function);
7553 
7554 #endif
7555 
7556  /*l
7557  *b Description:
7558  **
7559  ** Most DI-Guy visual objects (e.g., characters, path shapes,
7560  ** waypoints) have a unique identified, or UID. In many cases these
7561  ** UID values can be coded into 24-bit color values. This can be
7562  ** useful for implementing some types of intersection detection
7563  ** functions, in which each visual object is rendered with a different
7564  ** color.
7565  **
7566  ** This function will take the passed color values and update internal
7567  ** DI-Guy state of which objects objects have been hit.
7568  **
7569  ** It will also return an impact record containing information a
7570  ** subset of that information.
7571  **
7572  ** This can include:
7573  **
7574  *- - the hit character, if one was hit
7575  *- - the hit link and shape of the character
7576  *- - the hit scene object, if one was hit
7577  **
7578  ** Note that the returned impact pointer is owned by DI-Guy and is
7579  ** temporary. The information you need from it should be immediately
7580  ** read, and the pointer should not be stored.
7581  */
7582  diguyImpact* map_color_to_impact(char r, char g, char b);
7583 
7584  /*l
7585  *b Description:
7586  **
7587  ** When the callback with id diguyScenario::CALLBACK_ID_SCENE_OBJECT_IMPACT
7588  ** is called, this function will return the impact object containing
7589  ** information about that impact.
7590  **
7591  ** There may be multiple impacts that result from some operations.
7592  ** In this case this function should be called multiple times, until
7593  ** it returns NULL. When processing of data from each successive
7594  ** impact is done, call set_last_impact_been_processed() to queue up
7595  ** the next impact object for processing.
7596  **
7597  ** The maximum number of unprocessed impacts is finite, and set by
7598  ** the function set_max_unprocessed_impacts().
7599  **
7600  ** Note that the returned impact pointers are owned by DI-Guy and are
7601  ** temporary. The information you need from them should be
7602  ** immediately read, and the pointers should not be stored.
7603  */
7604  diguyImpact* get_last_env_impact_info();
7605 
7606  /*l
7607  *b Description:
7608  **
7609  ** Reading of data from the last impact information will be considered
7610  ** complete when this function is called.
7611  */
7612  void set_last_impact_been_processed();
7613 
7614  /*l
7615  *b Description:
7616  **
7617  ** This function will add the passed impact object to the list of
7618  ** impact objects to be processed by calls to
7619  ** get_last_env_impact_info(). An internal copy of the impact object
7620  ** is made.
7621  */
7622  void set_last_env_impact_info(const diguyImpact& impact);
7623 
7624  /*l
7625  *b Description:
7626  **
7627  ** Sets the maximum number of unprocessed impacts there can be.
7628  **
7629  ** The unprocessed impact array is a first-in-first-out queue. If an
7630  ** impact occurs that pushes the number of unprocessed impacts past
7631  ** this maximum number, earlier impacts will be dropped from the
7632  ** array.
7633  **
7634  ** The initial value is 10.
7635  */
7636  void set_max_unprocessed_impacts(int max_unprocessed_impacts);
7637 
7638 
7639 #ifdef CPLUSPLUS_ONLY
7640 
7641 
7642 /*****************************************************************************/
7662  /*l
7663  *b Description:
7664  **
7665  ** This function sets a default point line of sight function that
7666  ** will be added to all new characters. It can be overridden by an
7667  ** explicit call to diguyCharacter::set_point_los_function(). See
7668  ** that function for details.
7669  **
7670  *b Callable From:
7671  **
7672  *- - C++
7673  */
7674  int set_default_point_los_function(diguyPointLOSFunction* point_los_function);
7675 
7676  /*l
7677  *b Description:
7678  **
7679  ** This function sets a default character line of sight function that
7680  ** will be added to all new characters. It can be overridden by an
7681  ** explicit call to diguyCharacter::set_character_los_function().
7682  ** See that function for details.
7683  **
7684  *b Callable From:
7685  **
7686  *- - C++
7687  */
7688  int set_default_character_los_function(diguyCharacterLOSFunction* character_los_function);
7689 
7690  /*l
7691  *b Description:
7692  **
7693  ** This function sets a default feeler function that will be added
7694  ** to all new DI-Guy AI agents. It can be overridden by an explicit
7695  ** call to diguyCharacter::agent_set_feeler_function().
7696  **
7697  ** See the "User-Defined Feelers" section in diguyCharacter.h for
7698  ** more information.
7699  **
7700  *b Arguments:
7701  **
7702  *a feeler_function - pointer to user-defined feeler function
7703  **
7704  *b Returns:
7705  **
7706  ** 0 on success, -1 on failure
7707  **
7708  *b Callable From:
7709  **
7710  *- - C++
7711  */
7712  int set_default_agent_feeler_function(diguyFeelerFunction* feeler_function);
7713 
7714 #endif
7715 
7716  /*l
7717  *b Description:
7718  **
7719  ** Experimental intersection-detection function.
7720  **
7721  *b Arguments:
7722  **
7723  *a origin_x,origin_y,origin_z - starting point
7724  *a dir_x,dir_y,dir_z - direction vector
7725  *a max_distance_to_test - distance to test to
7726  *a use_callback - 1 to use
7727  **
7728  *b Returns:
7729  **
7730  ** diguyIntersectionResult structure
7731  */
7732  diguyIntersectionResult exp_intersect_geometry(
7733  float origin_x, float origin_y, float origin_z,
7734  float dir_x, float dir_y, float dir_z,
7735  float max_distance_to_test,
7736  int use_callback = 1);
7737 
7738 /*****************************************************************************/
7748  /*l
7749  *b Description:
7750  **
7751  ** This function returns a pointer to the region with the given
7752  ** name. A new region with the given name will be created if
7753  ** it doesn't already exist.
7754  **
7755  *b Arguments:
7756  **
7757  *a name - name of the region to find or create
7758  **
7759  *b Returns:
7760  **
7761  ** pointer of type diguyRegion; should never be NULL
7762  */
7763  diguyRegion* find_or_create_region(const char* name);
7764 
7765  /*l
7766  *b Description:
7767  **
7768  ** This function returns a pointer to the specified region.
7769  **
7770  *b Arguments:
7771  **
7772  *a name - name of region to be found
7773  **
7774  *b Returns:
7775  **
7776  ** pointer of type diguyRegion; NULL if not found
7777  */
7778  diguyRegion* find_region(const char* name);
7779 
7780  /*l
7781  *b Description:
7782  **
7783  ** This function creates a new diguyRegion and returns a pointer to
7784  ** it.
7785  **
7786  *b Arguments:
7787  **
7788  *a name - name of the new region object
7789  **
7790  *b Returns:
7791  **
7792  ** pointer of type diguyRegion
7793  */
7794  diguyRegion* create_region(const char* name);
7795 
7796  /*l
7797  *b Description:
7798  **
7799  ** This function destroys the passed region.
7800  **
7801  *b Arguments:
7802  **
7803  *a region - region to destroy
7804  */
7805  void destroy_region(diguyRegion* region);
7806 
7807  /*l
7808  *b Returns:
7809  **
7810  ** number of regions in the scenario
7811  */
7812  int get_num_regions();
7813 
7814  /*l
7815  *b Returns:
7816  **
7817  ** pointer of type diguyRegion; NULL if no region at the
7818  ** specified index
7819  **
7820  *b Arguments:
7821  **
7822  *a index - index of the region; indices start at 0
7823  */
7824  diguyRegion* get_region_at_index(int index);
7825 
7826  /*l
7827  *b Description:
7828  **
7829  ** The scenario will attempt to create a navigation path on the
7830  ** via_region. An A* path planning algorithm is used to find the
7831  ** path. See also diguyCharacter::agent_move_to_point() and
7832  ** diguyCharacter::agent_move_to_point_via_subregions().
7833  **
7834  *b Arguments:
7835  **
7836  *a x1, y1, z1 - start location
7837  *a x2, y2, z2 - end location
7838  *a via_region - name of the region to run A* on
7839  *a path_shape - path shape that stores the created path
7840  *a preferred_subregions_mask - diguySubregionMask value of regions
7841  *a preferred for travel
7842  *a cost_bias_for_preferred_regions - how much cheaper it will be
7843  *a to cross spaces that are part of desired subregion;
7844  *a should be < 1.0
7845  *a cost_bias_for_neutral_regions - how much more expensive it will be
7846  *a to cross spaces that are not part of desired subregion; see
7847  *a below for more information
7848  *a repulsed_regions_mask - diguySubregionMask value of regions *not*
7849  *a preferred for travel
7850  *a cost_bias_for_repulsed_regions - how much more expensive it will be
7851  *a to cross regions that are marked as repulsive; pass
7852  *a DIGUY_DEFAULT_FLOAT to avoid completely
7853  **
7854  ** Pass DIGUY_DEFAULT_FLOAT for cost_bias_for_neutral_regions and
7855  ** cost_bias_for_repulsed_regions to specify that they should be
7856  ** avoided completely.
7857  **
7858  ** The preferred_subregions_mask and repulsed_regions_mask use
7859  ** DI-Guy subregion mask values combined together. For example,
7860  ** DIGUY_SUBREGION_MASK_SIDEWALK | DIGUY_SUBREGION_MASK_CROSSWALK.
7861  **
7862  ** For cost_bias_for_neutral_regions, specifying a non-zero value for
7863  ** this lowers the likelihood that searches fail on disjointed
7864  ** subregions. A value < 1 will cause the planner to run faster but
7865  ** explore fewer points, possibly missing preferred regions. Values
7866  ** greater then 1 will explore more points but will be slower.
7867  **
7868  *b Returns:
7869  **
7870  ** 0 on success, -1 on failure
7871  */
7872  int find_navigation_path(float x1, float y1, float z1,
7873  float x2, float y2, float z2,
7874  const char* via_region,
7875  diguyPathShape* path_shape,
7876  float cost_bias_for_preferred_regions = 0.25f,
7877  int preferred_subregions_mask = DIGUY_SUBREGION_MASK_NONE,
7878  float cost_bias_for_neutral_regions = 1.1f,
7879  int repulsed_regions_mask = DIGUY_SUBREGION_MASK_NONE,
7880  float cost_bias_for_repulsive_regions = 100.0f);
7881 
7882  /*l
7883  *b Description:
7884  **
7885  ** Sets an upper limit on how far a character is willing to travel as
7886  ** a multiple of the straight line distance between point A and point
7887  ** B before declaring that it can't get to a location.
7888  **
7889  ** Note that internally the straight line distance is forced to have a
7890  ** lower bound of 10 meters, so a character is always willing to
7891  ** travel a minimum of 10 * max_distance_planning_multiplier meters.
7892  **
7893  ** Defaults to -1, which means off.
7894  */
7895  void set_max_distance_planning_multiplier(float mul);
7896 
7897  /*l
7898  *b Returns:
7899  **
7900  ** float constant that's used to decide if planner should give up;
7901  ** -1 means off
7902  */
7903  float get_max_distance_planning_multiplier();
7904 
7905  /*l
7906  *b Description:
7907  **
7908  ** This function returns in seconds how much time has been spent path
7909  ** planning during the current frame. It can be used to avoid 100
7910  ** characters simultaneously hitting the path planner.
7911  **
7912  *b Returns:
7913  **
7914  ** time in seconds
7915  */
7916  float get_time_spent_path_planning_this_frame();
7917 
7918  /*l
7919  *b Description:
7920  **
7921  ** This function enables the path planner to run in a background
7922  ** thread. Note this only occurs if the
7923  ** diguyCharacter::agent_move_to_point_bg() or
7924  ** diguyCharacter::agent_move_to_point_via_subregions_bg() api
7925  ** functions are used.
7926  **
7927  ** By default the multi-threaded path planner is on.
7928  */
7929  void set_multithreaded_path_planning_enabled(int value);
7930  /*l
7931  *b Returns:
7932  **
7933  ** Returns 1 if the path planner is enabled to run in a background
7934  ** thread. By default the multi-threaded path planner is on.
7935  */
7936  int get_multithreaded_path_planning_enabled();
7937 
7938 
7939 /*****************************************************************************/
7949  /*l
7950  *b Returns:
7951  **
7952  ** number of formations in the scenario
7953  */
7954  int get_num_formations();
7955 
7956  /*l
7957  *b Returns:
7958  **
7959  ** pointer of type diguyFormation; NULL if no
7960  ** formation at the specified index
7961  **
7962  *b Arguments:
7963  **
7964  *a index - index of the formation; indices start at 0
7965  */
7966  diguyFormation* get_formation_at_index(int index);
7967 
7968  /*l
7969  *b Description:
7970  **
7971  ** This function returns a pointer to the specified formation.
7972  **
7973  *b Arguments:
7974  **
7975  *a name - name of formation to be found
7976  **
7977  *b Returns:
7978  **
7979  ** pointer of type diguyFormation; NULL if not found
7980  */
7981  diguyFormation* find_formation(const char* name);
7982 
7983  /*l
7984  *b Description:
7985  **
7986  ** This function returns a pointer to the first formation it finds of
7987  ** a given size.
7988  **
7989  *b Arguments:
7990  **
7991  *a size - size of formation to be found
7992  **
7993  *b Returns:
7994  **
7995  ** pointer of type diguyFormation; NULL if not found
7996  */
7997  diguyFormation* find_formation_of_size(int size);
7998 
7999  /*l
8000  *b Description:
8001  **
8002  ** This function creates a new formation and returns a
8003  ** pointer to it.
8004  **
8005  *b Arguments:
8006  **
8007  *a name - name of the new formation
8008  **
8009  *b Returns:
8010  **
8011  ** pointer of type diguyFormation
8012  */
8013  diguyFormation* create_formation(const char* name);
8014 
8015  /*l
8016  *b Description:
8017  **
8018  ** This function finds the formation with the given name or
8019  ** creates it if it doesn't exist.
8020  **
8021  *b Arguments:
8022  **
8023  *a name - name of the formation to find or create
8024  **
8025  *b Returns:
8026  **
8027  ** pointer of type diguyFormation; should never be NULL
8028  */
8029  diguyFormation* find_or_create_formation(const char* name);
8030 
8031  /*l
8032  *b Description:
8033  **
8034  ** This function destroys a formation.
8035  **
8036  *b Arguments:
8037  **
8038  *a formation - pointer to a diguyFormation
8039  **
8040  *b Returns:
8041  **
8042  ** 0 on success, -1 on failure
8043  */
8044  int destroy_formation(diguyFormation* formation);
8045 
8046 
8047 /*****************************************************************************/
8064  void set_action_bead_labels_visible(diguyVisibleFlag vflag);
8065  void set_aim_trajectories_visible(diguyVisibleFlag vflag);
8066  void set_author_selection_handles_visible(diguyVisibleFlag vflag);
8067  void set_bead_array_visible(diguyVisibleFlag vflag);
8068  void set_character_labels_visible(diguyVisibleFlag vflag);
8069  void set_character_visible(diguyVisibleFlag vflag);
8070  void set_crowd_behavior_visible(diguyVisibleFlag flag);
8071  void set_crowd_feelers_visible(diguyVisibleFlag flag);
8072  void set_crowd_influence_visible(diguyVisibleFlag flag);
8073  void set_crowd_regions_visible(diguyVisibleFlag flag);
8074  void set_light_array_visible(diguyVisibleFlag vflag);
8075  void set_lua_objects_visible(diguyVisibleFlag flag);
8076  void set_mesh_region_array_visible(diguyVisibleFlag vflag);
8077  void set_sensor_region_array_visible(diguyVisibleFlag vflag);
8078  void set_spath_visible(diguyVisibleFlag vflag);
8079  void set_waypoint_array_visible(diguyVisibleFlag vflag);
8080 
8081  diguyVisibleFlag get_action_bead_labels_visible();
8082  diguyVisibleFlag get_aim_trajectories_visible();
8083  diguyVisibleFlag get_author_selection_handles_visible();
8084  diguyVisibleFlag get_bead_array_visible();
8085  diguyVisibleFlag get_character_labels_visible();
8086  diguyVisibleFlag get_character_visible();
8087  diguyVisibleFlag get_crowd_behavior_visible();
8088  diguyVisibleFlag get_crowd_feelers_visible();
8089  diguyVisibleFlag get_crowd_influence_visible();
8090  diguyVisibleFlag get_crowd_regions_visible();
8091  diguyVisibleFlag get_light_array_visible();
8092  diguyVisibleFlag get_lua_objects_visible();
8093  diguyVisibleFlag get_mesh_region_array_visible();
8094  diguyVisibleFlag get_sensor_region_array_visible();
8095  diguyVisibleFlag get_spath_visible();
8096  diguyVisibleFlag get_waypoint_array_visible();
8097 
8098  void set_hide_author_selection_handles_during_play(int visible);
8099  int get_hide_author_selection_handles_during_play();
8100 
8101 /*****************************************************************************/
8111  /*l
8112  *b Returns:
8113  **
8114  ** If weapon fire will create light flashes.
8115  */
8116  int get_weapon_fire_effects_enabled();
8117 
8118  /*l
8119  *b Description:
8120  **
8121  ** Sets if weapon fire will create light flashes.
8122  */
8123  int set_weapon_fire_effects_enabled(int enabled);
8124 
8125  /*l
8126  *b Returns:
8127  **
8128  ** The number of light flashes that are currently active
8129  */
8130  int get_num_active_fire_effects();
8131 
8132  /*l
8133  *b Description:
8134  **
8135  ** This function gets the data needed for producing a weapon flash
8136  ** light source in the world. See diguyOglGraphicsShaderProgram::update_light_uniforms()
8137  ** for an example of its use. In the default OpenGL renderer the
8138  ** convenience function diguy_ogl_apply_active_lights() does this work
8139  ** for you.
8140  **/
8141  int get_weapon_fire_effect_data(int index, float * radius,
8142  float * position_x, float * position_y, float * position_z,
8143  float * color_r, float * color_g, float * color_b,
8144  float * falloff_r,
8145  float * falloff_rsq);
8146 
8147 /*****************************************************************************/
8162  /*l
8163  *b Description:
8164  **
8165  ** Sets the current selected character in scenario
8166  **
8167  *b Returns:
8168  **
8169  ** 0 on success, -1 on failure
8170  **/
8171  int set_current_character(diguyCharacter* current_character);
8172  /*l
8173  *b Returns:
8174  **
8175  ** The current selected character in scenario
8176  **/
8177  diguyCharacter* get_current_character();
8178 
8179  /*l
8180  *b Description:
8181  **
8182  ** Sets the current selected crowd in scenario
8183  **
8184  *b Returns:
8185  **
8186  ** 0 on success, -1 on failure
8187  **/
8188  int set_current_crowd(diguyCrowd* current_crowd);
8189  /*l
8190  *b Returns:
8191  **
8192  ** The current selected crowd in scenario
8193  **/
8194  diguyCrowd* get_current_crowd();
8195 
8196  /*l
8197  *b Description:
8198  **
8199  ** Sets the active crowd profile, which determines the attributes
8200  ** of subsequently-created crowds. See diguyCrowdProfile.
8201  **
8202  *b Returns:
8203  **
8204  ** 0 on success, -1 on failure
8205  **/
8206  int set_current_crowd_profile(diguyCrowdProfile* current_profile);
8207  /*l
8208  *b Description:
8209  **
8210  ** Sets the active crowd profile by name.
8211  **
8212  *b Returns:
8213  **
8214  ** 0 on success, -1 on failure
8215  **/
8216  int set_current_crowd_profile_by_name(const char* crowd_profile_name);
8217  /*l
8218  *b Returns:
8219  **
8220  ** Active crowd profile
8221  **/
8222  diguyCrowdProfile* get_current_crowd_profile();
8223 
8224  /*l
8225  *b Description:
8226  **
8227  ** Sets the current region. See diguyRegion.
8228  **
8229  *b Returns:
8230  **
8231  ** 0 on success, -1 on failure
8232  **/
8233  int set_current_region(diguyRegion* current_region);
8234  /*l
8235  *b Returns:
8236  **
8237  ** Current region.
8238  **/
8239  diguyRegion* get_current_region();
8240 
8241 
8242 /*****************************************************************************/
8247  /*l
8248  *b Description:
8249  **
8250  ** This function enables or disables the particle module.
8251  ** By default the particle module is enabled.
8252  */
8253  void set_particle_module_disabled(int disable_particle_module);
8254 
8255  /*l
8256  *b Description:
8257  **
8258  ** This function creates a particle system with type description_name
8259  ** at x, y, z. If duration is specified the system will automatically
8260  ** stop emitting after that amount of time.
8261  **
8262  *b Arguments:
8263  **
8264  *a description_name - name of particle description to create
8265  *a x, y, z - the world space position of the system
8266  *a record_transient_event - pass 1 to have this particle system
8267  *a play in history playback
8268  *a duration - how long the emitter should emit; if -1 is
8269  *a specified then the description must have a
8270  *a lifetime specified
8271  */
8272  int create_particle_system(const char* description_name,
8273  float x, float y, float z,
8274  int record_transient_event = 1,
8275  float duration = -1.0f);
8276 
8277  /*l
8278  *b Description:
8279  **
8280  ** Similar to create_particle_system(), but allows orientation to be set.
8281  **
8282  *b Arguments:
8283  **
8284  *a rz, rx, ry - orientation axes
8285  **
8286  ** (See create_particle_system() for other parameters)
8287  */
8288  int create_particle_system_with_orientation(const char* description_name,
8289  float x, float y, float z,
8290  float rz, float rx, float ry,
8291  int record_transient_event = 1,
8292  float duration = -1.0f);
8293 
8294  /*l
8295  *b Returns:
8296  **
8297  ** 1 if the particle description named description_name exists,
8298  ** else 0
8299  */
8300  int has_particle_description(const char* description_name);
8301 
8302  /*l
8303  *b Description:
8304  **
8305  ** Set wind velocity vector for particle system
8306  */
8307  void set_global_wind(float x, float y, float z);
8308 
8309 
8310 /*****************************************************************************/
8316 // These should probably be C++ only. Not sure how much they make sense for
8317 // exposure to the scripting languages, unless you want perl to call lua
8318 // via C++.
8319 
8320  /*l
8321  *b Returns:
8322  **
8323  ** string representation of lua_object.field_name
8324  **
8325  ** Note that the returned string pointer will not remain valid, so
8326  ** the returned string should be copied.
8327  **
8328  *b Arguments:
8329  **
8330  *a lua_object - a global lua object
8331  *a field_name - name of the field; field_name can include ".",
8332  *a allowing retrieval of fields in complex data
8333  *a structures
8334  **
8335  *b Callable From:
8336  **
8337  *- - C++
8338  **/
8339  const char* lua_get_object_field_as_string(const char* lua_object,
8340  const char* field_name);
8341 
8342  /*l
8343  **
8344  *b Description:
8345  **
8346  ** Runs a member function of a lua object.
8347  **
8348  *b Arguments:
8349  **
8350  *a lua_object - a global lua object
8351  *a function_name - name of the function to call
8352  *a argument - optional string argument
8353  *a has_return_string - if set to 1 function will pop the top value of
8354  *a the lua stack and return it as a string
8355  **
8356  *b Returns:
8357  **
8358  ** NULL or string representation of
8359  ** lua_object:function_name(argument).
8360  **
8361  ** The returned string should be copied if it needs to be used later.
8362  **
8363  *b Callable From:
8364  **
8365  *- - C++
8366  **/
8367  const char* lua_evaluate_object_function(const char* lua_object,
8368  const char* function_name,
8369  const char* argument = NULL,
8370  int has_return_string = 0);
8371 
8372  /*l
8373  *b Description:
8374  **
8375  ** A two argument version of lua_evaluate_object_function().
8376  **
8377  *b Callable From:
8378  **
8379  *- - C++
8380  */
8381  const char* lua_evaluate_object_function_2a(const char* lua_object,
8382  const char* function_name,
8383  const char* argument,
8384  const char* argument2,
8385  int has_return_string = 0);
8386 
8387  /*l
8388  *b Description:
8389  **
8390  ** A three argument version of lua_evaluate_object_function().
8391  **
8392  *b Callable From:
8393  **
8394  *- - C++
8395  */
8396  const char* lua_evaluate_object_function_3a(const char* lua_object,
8397  const char* function_name,
8398  const char* argument,
8399  const char* argument2,
8400  const char* argument3,
8401  int has_return_string = 0);
8402 
8403  /*l
8404  *b Description:
8405  **
8406  ** A four argument version of lua_evaluate_object_function().
8407  **
8408  *b Callable From:
8409  **
8410  *- - C++
8411  */
8412  const char* lua_evaluate_object_function_4a(const char* lua_object,
8413  const char* function_name,
8414  const char* argument,
8415  const char* argument2,
8416  const char* argument3,
8417  const char* argument4,
8418  int has_return_string = 0);
8419 
8420  /*l
8421  *b Description:
8422  **
8423  ** Executes a lua_object:state_manager() function call. Useful for
8424  ** creating sleep-able coroutine based objects that aren't
8425  ** characters.
8426  **
8427  *b Callable From:
8428  **
8429  *- - C++
8430  **/
8431  int lua_send_message_to_object(const char* lua_object,
8432  const char* sender,
8433  const char* message_type,
8434  const char* message,
8435  const char* message_params = NULL);
8436 
8437 
8438 #ifdef CPLUSPLUS_ONLY
8439 
8440  /*l
8441  *b Description:
8442  **
8443  ** This function allows low level access to the lua_State pointer.
8444  ** This pointer can be used by a programmer to query and run functions
8445  ** on the Lua virtual machine. This object can also be used to
8446  ** register new C functions to lua, which allows you to instrument and
8447  ** create callbacks from script to your code. See luaL_register
8448  ** on-line.
8449  **
8450  ** For more information on how the Lua C api works see:
8451  ** http://www.lua.org/pil/24.html
8452  **
8453  *b NOTE:
8454  **
8455  ** Currently all scenarios share the same underlying Lua state object.
8456  ** This may cause issues in applications with multiple scenarios.
8457  **
8458  *b Callable From:
8459  **
8460  *- - C++
8461  */
8462  void* get_lua_state();
8463 
8464  /*l
8465  *b Description:
8466  **
8467  ** Mainly used to pass a qt pointer to lua so lqt can be used to
8468  ** modify/read from the widget. This requires the that the lqt package
8469  ** is loaded; see the lqt.lua utility package for more info.
8470  **
8471  *b Arguments:
8472  **
8473  *a lua_state - a Lua_State pointer, might be the same as get_lua_state();
8474  *a depends if the calling function is inside a coroutine
8475  *a class_name - class name should be a core class of qt with a star
8476  *a after it; i.e. "QWidget*" or "QLineEdit*"
8477  *a ptr - pointer to that is returned to the calling function in lua
8478  **
8479  *b Callable From:
8480  **
8481  *- - C++
8482  **
8483  *b C++ Example:
8484  **
8485  *e int push_graphics_view_to_lua(lua_State *L)
8486  *e {
8487  *e bdiQGraphicsView* graphics_view = get_primary_3d_window_graphics_view();
8488  *e if (m_scenario->push_qt_pointer_to_lua(L, "QGraphicsView*", graphics_view) == -1)
8489  *e {
8490  *e return 0;
8491  *e }
8492  *e return 1;
8493  *e }
8494  **
8495  ** Plug-in init code:
8496  **
8497  *e lua_State* L = (lua_State*)scenario->get_lua_state();
8498  *e if (L)
8499  *e {
8500  *e lua_register(L, "get_graphics_view", push_graphics_view_to_lua);
8501  *e }
8502  **
8503  ** In lua:
8504  **
8505  *e local graphics_view = get_graphics_view();
8506  **
8507  **/
8508  int push_qt_pointer_to_lua(void* lua_state,
8509  const char* class_name,
8510  void* ptr);
8511 
8512  /*l
8513  *b Description:
8514  **
8515  ** The most open function calling function available, if this doesn't
8516  ** manage to accomplish what you need you probably want to start
8517  ** using the lua interpreter directly.
8518  **
8519  ** The type arguments are string versions of the type being sent to
8520  ** lua, options include:
8521  *>
8522  *- - '' - empty argument
8523  *- - 'b' boolean - void* argument1 is assumed to be an int
8524  *- - 'f' field - void* argument1 assumed to be character string of
8525  *- a field of a global lua object; supports nested
8526  *- fields like foo.bar.a
8527  *- - 's' string - void* argument1 assumed to be character string
8528  *- - 'd' double - void* argument is assumed to be a double
8529  *- - diguy... - void* argument assumed to be a diguy class
8530  *- pointer ie "diguyCharacter", "diguyCrowd" (no
8531  *- star used for diguy classes)
8532  *- - Q...* - void* argument is assumed to be a pointer to a
8533  *- child of QObject; the class name should be a core
8534  *- class of qt with a star after it, e.g. "QWidget*"
8535  *- or "QLineEdit*"
8536  *<
8537  *b Arguments:
8538  **
8539  *a lua_object - a global lua object
8540  *a function_name - name of the function to call
8541  *a arg(1/2/3/4)_type - is the data type
8542  *a argument(1/2/3/4) - void* pointers to data
8543  *a has_return_string - if set to 1 function will pop the top value of
8544  *a the lua stack and return it as a string
8545  **
8546  *b Returns:
8547  **
8548  ** NULL or string representation of lua_object:function_name(argument)
8549  **
8550  ** The returned string should be copied if it needs to be used later.
8551  **
8552  *b Callable From:
8553  **
8554  *- - C++
8555  **/
8556  const char* lua_evaluate_object_function_4a_flex(const char* lua_object,
8557  const char* function_name,
8558  const char* arg1_type, void* argument1,
8559  const char* arg2_type, void* argument2,
8560  const char* arg3_type, void* argument3,
8561  const char* arg4_type, void* argument4,
8562  int has_return_string = 0);
8563 
8564  /*l
8565  *b Description:
8566  **
8567  ** Effectively the same as diguyScenario::lua_evaluate_object_function_4a_flex()
8568  ** but works on global functions.
8569  **
8570  *b Callable From:
8571  **
8572  *- - C++
8573  */
8574  const char* lua_evaluate_global_function_4a_flex(const char* function_name,
8575  const char* arg_type, void* argument,
8576  const char* arg_type2, void* argument2,
8577  const char* arg_type3, void* argument3,
8578  const char* arg_type4, void* argument4,
8579  int has_return_string = 0);
8580 
8581 #endif
8582 
8583  /*l
8584  *b Description:
8585  **
8586  ** Prints a message to lua interpreter log object. In DI-Guy
8587  ** Scenario this is sent to the AI Mind Editor and used to fill out
8588  ** the error log. The Mind editor log parses debug.traceback()
8589  ** calls.
8590  **/
8591  int lua_log_printf(int notify_level, const char* string);
8592 
8593  /*l
8594  *b Returns:
8595  **
8596  ** package meta data as a formatted string; useful for debugging,
8597  ** only valid inside DI-Guy Scenario
8598  */
8599  const char* dump_package_info(const char* package_name);
8600 
8601 /****************************************************************************/
8602 /****************************************************************************/
8603 /****************************************************************************/
8610 /****************************************************************************/
8611 /****************************************************************************/
8612 /****************************************************************************/
8613 
8614  /*l
8615  *b Returns:
8616  **
8617  ** value set by last call to set_eval_decisions_as_scripts()
8618  */
8619  int get_eval_decisions_as_scripts();
8620 
8621  /*l
8622  *b Description:
8623  **
8624  ** If called with an argument of 1, all decision beads and decision beads will
8625  ** be converted to scripts before being run.
8626  */
8627  void set_eval_decisions_as_scripts(int eval_decisions_as_scripts);
8628 
8629  /*l
8630  *b Description:
8631  **
8632  ** Gets the point of impact with the world along specified line segment
8633  **
8634  *b Returns:
8635  **
8636  ** pointer to diguyImpact object or NULL
8637  */
8638  diguyImpact* get_impact_on_line(float from_x,
8639  float from_y,
8640  float from_z,
8641  float to_x,
8642  float to_y,
8643  float to_z);
8644 
8645  /*l
8646  *b Description:
8647  **
8648  ** Increments wait cursor counter. If non-zero, then wait cursor is displayed
8649  ** in DI-GUY scenario.
8650  */
8651  void wait_cursor_push();
8652  /*l
8653  *b Description:
8654  **
8655  ** Decrements wait cursor counter.
8656  */
8657  void wait_cursor_pop();
8658 
8659 
8660 #ifdef CPLUSPLUS_ONLY
8661 
8662  /*l
8663  *b Description:
8664  **
8665  ** This function sets a generic node pointer that can later be
8666  ** retrieved by the get_graphics_api_node_ptr() call. The pointer is
8667  ** otherwise not used.
8668  **
8669  *b Arguments:
8670  **
8671  *a node_ptr - generic void* pointer
8672  **
8673  *b Callable From:
8674  **
8675  *- - C++
8676  */
8677  void set_graphics_api_node_ptr(void* node_ptr);
8678 
8679  /*l
8680  *b Returns:
8681  **
8682  ** pointer set by most recent call to set_graphics_api_node_ptr
8683  **
8684  *b Callable From:
8685  **
8686  *- - C++
8687  */
8688  void* get_graphics_api_node_ptr();
8689 
8690 #endif
8691 
8692  /*l
8693  *b Description:
8694  **
8695  ** Sets whether shadow disks are drawn for characters. Call with 1 to turn on,
8696  ** 0 to turn off.
8697  */
8698  void set_draw_character_shadow_disks(int draw_character_shadow_disks);
8699 
8700  /*l
8701  *b Returns:
8702  **
8703  ** 1 if shadow disks are drawn, 0 if not
8704  */
8705  int get_draw_character_shadow_disks();
8706 
8707  /*l
8708  *b Returns:
8709  **
8710  ** size of texture map for shadows
8711  */
8712  int get_shadow_map_size();
8713 
8714  /*l
8715  *b Description:
8716  **
8717  ** Sets size of texture map for shadows. Defaults to 1024. Allowed values
8718  ** are powers of two up to 4096.
8719  */
8720  int set_shadow_map_size(int shadow_size);
8721 
8722  /*l
8723  *b Description:
8724  **
8725  ** Used for DI-Guy OSG Author Programming Example. Sets the default value
8726  ** used for characters. See also diguyCharacter::set_scene_graph_mask()
8727  */
8728  void set_default_character_scene_graph_mask(unsigned long mask);
8729  unsigned long get_default_character_scene_graph_mask();
8730 
8731  /*l
8732  *b Description:
8733  **
8734  ** Used for DI-Guy OSG Author Programming Example. Sets the default value
8735  ** used for characters. See also diguySceneObject::set_scene_graph_mask()
8736  */
8737  void set_default_scene_object_scene_graph_mask(unsigned long mask);
8738  unsigned long get_default_scene_object_scene_graph_mask();
8739 
8740  /*l
8741  *b Description:
8742  **
8743  ** For internal use.
8744  */
8745  void set_internal_int(int var, int val);
8746  void set_internal_float(int var, float val);
8747 
8748  /*l
8749  *b Description:
8750  **
8751  ** This sets the number of point lights that get handed down to
8752  ** diguyGraphicsShaderTechnique::pick_shader_program().
8753  */
8754  int set_num_active_point_lights(int active_lights);
8755 
8756  /*l
8757  *b Description:
8758  ** This gets the number of point lights that get handed down to
8759  ** diguyGraphicsShaderTechnique::pick_shader_program() the default is 0.
8760  ** diguy_ogl_apply_active_lights() automatically updates this value in
8761  ** the OpenGL renderer.
8762  */
8763  int get_num_active_point_lights();
8764 
8765 /****************************************************************************/
8766 /****************************************************************************/
8767 /****************************************************************************/
8771 /****************************************************************************/
8772 /****************************************************************************/
8773 /****************************************************************************/
8774 
8775  /*l
8776  *b Description:
8777  **
8778  ** Experimental. For internal use.
8779  */
8780  int optimized_update(float t);
8781 
8782  /*l
8783  *b Description:
8784  **
8785  ** Sets bounding box of world
8786  **
8787  *b Arguments:
8788  **
8789  *a x_min,y_min,z_min,x_max,y_max,z_max - bounds
8790  **
8791  *b Returns:
8792  **
8793  ** 0 on success, -1 on failure
8794  ** (float * arguments converted to return values in Lua)
8795  */
8796  int set_world_bounds(float x_min, float y_min, float z_min,
8797  float x_max, float y_max, float z_max);
8798 
8799  /*l
8800  *b Description:
8801  **
8802  ** Gets bounding box of world
8803  **
8804  *b Arguments:
8805  **
8806  *a x_min,y_min,z_min,x_max,y_max,z_max - output parameters
8807  **
8808  *b Returns:
8809  **
8810  ** 0 on success, -1 on failure
8811  ** (float * arguments converted to return values in Lua)
8812  */
8813  int get_world_bounds(float* x_min, float* y_min, float* z_min,
8814  float* x_max, float* y_max, float* z_max);
8815 
8816 
8817 
8818 /****************************************************************************/
8819 /****************************************************************************/
8820 /****************************************************************************/
8824 /****************************************************************************/
8825 /****************************************************************************/
8826 /****************************************************************************/
8827 
8828  /*l
8829  *b Description:
8830  **
8831  ** Internal use
8832  */
8833  void set_checkpoint_frequency(float freq);
8834  /*l
8835  *b Description:
8836  **
8837  ** Internal use
8838  */
8839  float get_checkpoint_frequency();
8840  /*l
8841  *b Description:
8842  **
8843  ** Internal use
8844  */
8845  void set_checkpointing_enabled(int enable_checkpointing);
8846  /*l
8847  *b Description:
8848  **
8849  ** Internal use
8850  */
8851  int get_checkpointing_enabled();
8852 
8853  // should be removed, only for testing
8854  //void checkpoint();
8855  //void load_checkpoint();
8856 
8857 /****************************************************************************/
8858 /****************************************************************************/
8859 /****************************************************************************/
8863 /****************************************************************************/
8864 /****************************************************************************/
8865 /****************************************************************************/
8866 
8867  /*l
8868  *b Description:
8869  **
8870  ** Sets initial render mode
8871  **
8872  *b Arguments:
8873  **
8874  *a render_mode - string containing render mode setting name
8875  **
8876  ** Built-in render modes:
8877  **
8878  *- "normal"
8879  *- "shadow"
8880  *- "glow"
8881  *- "alternate1"
8882  *- "alternate2"
8883  *- "alternate3"
8884  */
8885  void set_initial_render_mode(const char* render_mode);
8886 
8887  /*l
8888  *b Returns:
8889  **
8890  ** initial render mode, as string
8891  **
8892  */
8893  const char* get_initial_render_mode();
8894 
8895  /*l
8896  *b Description:
8897  **
8898  ** Sets current render mode. See set_initial_render_mode()
8899  **
8900  */
8901  void set_current_render_mode(const char* render_mode);
8902 
8903  /*l
8904  *b Returns:
8905  **
8906  ** render mode, as string, derived from current light settings
8907  **
8908  *b Arguments:
8909  **
8910  *a set_current_to_derived - if 1, current render mode becomes derived
8911  *- mode
8912  **
8913  */
8914  const char* derive_render_mode_from_light_settings(int set_current_to_derived = 1);
8915 
8917  const char* get_current_render_mode();
8918 
8919  /*l
8920  *b Description:
8921  **
8922  ** Sets default shader for characters
8923  **
8924  *b Arguments:
8925  **
8926  *a render_mode - string containing render mode name
8927  *a shader_name - string containing name of shader technique
8928  *- (there should be a _glsl.cfg file of the same name)
8929  *a update_existing_characters - if 1, all existing characters will now
8930  *- be drawn using this shader
8931  */
8932  void set_default_character_shader(const char* render_mode,
8933  const char* shader_name,
8934  int update_existing_characters = 1);
8935 
8937  const char* get_default_character_shader(const char* render_mode);
8938 
8939  /*l
8940  *b Description:
8941  **
8942  ** Sets default shader for scene objects
8943  **
8944  *b Arguments:
8945  **
8946  *a render_mode - string containing render mode name
8947  *a shader_name - string containing name of shader technique
8948  *- (there should be a _glsl.cfg file of the same name)
8949  *a update_existing_scene_objects - if 1, all existing scene objects will now
8950  *- be drawn using this shader
8951  */
8952  void set_default_scene_object_shader(const char* render_mode,
8953  const char* shader_name,
8954  int update_existing_scene_objects = 1);
8955 
8957  const char* get_default_scene_object_shader(const char* render_mode);
8958 
8959  /*l
8960  *b Description:
8961  **
8962  ** Sets default shader for particle systems
8963  **
8964  *b Arguments:
8965  **
8966  *a render_mode - string containing render mode name
8967  *a shader_name - string containing name of shader technique
8968  *- (there should be a _glsl.cfg file of the same name)
8969  *a update_existing_particle_systems - if 1, all existing particle systems will now
8970  *- be drawn using this shader
8971  */
8972  void set_default_particle_system_shader(const char* render_mode,
8973  const char* shader_name,
8974  int update_existing_particle_systems = 1);
8975 
8977  const char* get_default_particle_system_shader(const char* render_mode);
8978 
8979  /*l
8980  *b Description:
8981  **
8982  ** Sets FaceFX animation set for a given actor.
8983  **
8984  *b Arguments:
8985  **
8986  *a actor_name - actor's name
8987  *a file_name - fully qualified file name ending in ".animset_ingame"
8988  */
8989  int facefx_mount_animset(const char* actor_name, const char* file_name);
8990 
8991  /*l
8992  *b Description:
8993  **
8994  ** Sets vehicle smoothing on or off. If 1, vehicle will be updated
8995  ** at a higher rate than frame dt
8996  **
8997  ** Default is on.
8998  */
8999  int set_vehicle_smoothing_enabled(int enable_smoothing);
9000  int get_vehicle_smoothing_enabled();
9001 
9002  /*l
9003  *b Description:
9004  **
9005  ** Culling distance (from camera) for drawing
9006  */
9007  int set_character_culling_distance(float dist);
9008  float get_character_culling_distance();
9009 
9010  /*l
9011  *b Description:
9012  **
9013  ** Culling distance (from camera)
9014  */
9015  int set_vehicle_culling_distance(float dist);
9016  float get_vehicle_culling_distance();
9017 
9018  /*l
9019  *b Description:
9020  **
9021  ** Culling distance of props (from camera)
9022  */
9023  int set_prop_culling_distance(float dist);
9024  float get_prop_culling_distance();
9025 
9026  /*l
9027  *b Description:
9028  **
9029  * Documentation Pending EXPERIMENTAL IK
9030  */
9031  int set_realtime_ik_enabled(int val);
9032  int get_realtime_ik_enabled();
9033 
9034  int set_draw_ik_visuals(int val);
9035  int get_draw_ik_visuals();
9036 
9037  int set_draw_skeletons(int val);
9038  int get_draw_skeletons();
9039 
9040  float get_last_update_time()
9041  {
9042  if(m_last_update_time == -9999.0f){
9043  return 0.0f;
9044  }
9045  return m_last_update_time;
9046  }
9047 
9048 /****************************************************************************/
9049 /****************************************************************************/
9050 /****************************************************************************/
9061 /****************************************************************************/
9062 /****************************************************************************/
9063 /****************************************************************************/
9064 
9065  // Removed due to head system changes. Body Appearance now dictates what heads are available
9066  /*l
9067  ** Similar to get_character_type_num_appearances(), but for
9068  ** head appearances.
9069  */
9070  int get_character_type_num_head_appearances(const char* character_type);
9071 
9072  /*l
9073  ** Similar to get_character_type_appearance_at_index(), but for
9074  ** head appearances.
9075  */
9076  const char* get_character_type_head_appearance_at_index(const char* character_type,
9077  int index);
9078 
9079 #ifdef CPLUSPLUS_ONLY
9080 
9081  /*l
9082  *b Description:
9083  **
9084  ** Deprecated; use diguyApp::add_default_scenario_callback() instead.
9085  */
9086  static int add_default_callback(int callback_id,
9087  diguyScenarioCallback* callback,
9088  void* callback_params = 0,
9089  void* callback_user_data = 0);
9090 
9091  /*l
9092  *b Description:
9093  **
9094  ** Deprecated; use diguyApp::remove_default_scenario_callback()
9095  ** instead.
9096  */
9097  static int remove_default_callback(int callback_id,
9098  diguyScenarioCallback* callback);
9099 
9100 #endif
9101 
9102  /*l
9103  *b Description:
9104  **
9105  ** Deprecated;
9106  ** use diguyApp::remove_default_scenario_callback_with_User_data()
9107  ** instead.
9108  */
9109  static int remove_default_callback_with_user_data(int callback_id,
9110  void* callback_user_data);
9111 
9112  /*l
9113  *b Description:
9114  **
9115  ** Deprecated; use diguyApp::add_default_scenario_callback_script()
9116  ** instead.
9117  */
9118  static int add_default_callback_script(int callback_id,
9119  const char* callback_script,
9120  const char* callback_script_type);
9121 
9122  /*l
9123  *b Description:
9124  **
9125  ** Deprecated; use diguyApp::remove_default_scenario_callback_script()
9126  ** instead.
9127  */
9128  static int remove_default_callback_script(int callback_id,
9129  const char* callback_script,
9130  const char* callback_script_type);
9131 
9132  /*l
9133  *b Description:
9134  **
9135  ** Deprecated as of 10.0.0; use get_character_type_map() intead,
9136  ** and then call
9137  ** diguyCharacterTypeMap::get_field_value(DIGUY_CHARACTER_TYPE_MAP_FIELD_CHARACTER_CLASS)
9138  */
9139  const char* get_character_type_class(const char* character_type);
9140 
9141  /*l
9142  *b Description:
9143  **
9144  ** Deprecated as of 10.5.1; use merge_object() intead.
9145  */
9146  int merge_asset(const char* string);
9147 
9148  /*l
9149  *b Description:
9150  **
9151  ** Deprecated as of 12.0.0; use bdi_log_print() from libbdilog.h
9152  ** instead.
9153  */
9154  void print_to_log(int notify_level, const char* string);
9155 
9156 
9157 #ifdef CPLUSPLUS_ONLY
9158 
9159  /*
9160  *2 VegaPrime Helper Functions
9161  */
9162  diguyCharacter* create_pending_reflected_character(const char* name,
9163  const char* character_type,
9164  const char* appearance = NULL);
9165 
9166  int set_network_translation(float x, float y, float z);
9167  int get_network_translation(float* x, float* y, float* z);
9168 
9169  /*l
9170  *b Description:
9171  **
9172  ** Deprecated as of 12.0.0; use save_as() instead.
9173  */
9174  void set_project_filename(const char* project_filename);
9175 
9176  /*l
9177  *b Description:
9178  **
9179  ** Deprecated as of 12.0.0; use get_filename() or
9180  ** get_filename_without_directory() intead.
9181  */
9182  const char* get_project_filename();
9183 
9189  bdiScenario* get_scripted_object() {return m_scenario;}
9190 
9191 
9192 private:
9193 
9194  /*l
9195  ** A private constructor. Use the DI-Guy function
9196  ** diguy_create_scenario() to obtain a diguyScenario object pointer.
9197  */
9198  diguyScenario(bdiScenario* scenario);
9199 
9200  /*l
9201  ** A private destructor. Use the DI-Guy function
9202  ** diguy_destroy_scenario() to delete a diguyScenario object pointer.
9203  */
9204  virtual ~diguyScenario();
9205 
9206  /*l
9207  ** A pointer to internal data.
9208  */
9209  bdiScenario* m_scenario;
9210  float m_last_update_time;
9211 
9212  friend class bdiScenario;
9213 
9214 #endif
9215 
9216 };
9217 
9218 #endif /* __diguyScenario_H */
9219