DI-Guy SDK Documentation  13.7.1
diguy_dis_constants.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2022 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
6 /*********************************************************************
7  **
8  *t DI-Guy API, DIS Constants and Enumerations
9  **
10  ** This file contains constants defined by the DIS
11  ** networking standard. They should be compatible with
12  ** other DIS networking applications that follow the
13  ** DIS standard.
14  */
15 
16 #pragma once
17 
18 
19 /****************************************************************************/
20 /*l
21  *b Description:
22  **
23  ** Lifeform state values from an Entity State PDU.
24  **
25  */
26 enum
27 {
38 
43 };
44 
45 
46 /****************************************************************************/
47 /*l
48  *b Description:
49  **
50  ** Primary weapon position values from an Entity State PDU.
51  */
52 enum
53 {
58 };
59 
60 
61 /****************************************************************************/
62 /*l
63  *b Description:
64  **
65  ** Secondary weapon position values from an Entity State PDU.
66  */
67 enum
68 {
73 };
74 
75 
76 /****************************************************************************/
77 /*l
78  *b Description:
79  **
80  ** Damage appearance values from an Entity State PDU.
81  */
82 enum
83 {
89 };
90 
91 
92 /****************************************************************************/
93 /*l
94  *b Description:
95  **
96  ** Smoke appearance values from an Entity State PDU.
97  */
98 enum
99 {
104 };
106 
107 /****************************************************************************/
108 /*l
109  *b Description:
110  **
111  ** Trailing effect values from an Entity State PDU.
112  */
113 enum
114 {
119 };
120 
121 
122 /****************************************************************************/
123 /*l
124  *b Description:
125  **
126  ** Flames appearance values from an Entity State PDU.
127  */
128 enum
129 {
132 };
133 
134 
135 /****************************************************************************/
136 /*l
137  *b Description:
138  **
139  ** Power plant status values from an Entity State PDU.
140  */
141 enum
142 {
145 };
146 
147 
148 /****************************************************************************/
149 /*l
150  *b Description:
151  **
152  ** This enumeration lists missile trail status values from an Entity
153  ** State PDU.
154  */
155 enum
156 {
159 };
160 
161 
162 /****************************************************************************/
163 /*l
164  *b Description:
165  **
166  ** This enumeration lists the Articulated part info for DI-Guy's gazing.
167  */
168 enum
169 {
170  DIGUY_DIS_FOCUS_TARGET = 10240
171 };
172 
173 
174 /****************************************************************************/
175 /*l
176  ** \enum diguyCustomPDUType
177  **
178  *b Description:
179  **
180  ** This enumeration lists the message IDs for DI-Guy's custom pdus,
181  ** not all are usable outside of diguyscenario
182  **
183  *i DIGUY_CUSTOM_PDU_ID_SET_CHAR_TYPE
184  **
185  *- - Contents: String
186  *- - Meaning: call diguyCharacter::set_character_type()
187  **
188  *i DIGUY_CUSTOM_PDU_ID_SET_CHAR_APPEARANCE
189  **
190  *- - Contents: String A, String B, String C, Float D
191  *- - Meaning: Set the character appearance to A. If strings B and C are present (either both or
192  *- neither), they set the head appearance (B) and hand item appearance (C). The final float (D)
193  *- is not optional (and is expected, even if B and C are not given), sets the body weight ratio
194  *- (valid range 0.5 - 2.0, defaults to 1.0).
195  **
196  *i DIGUY_CUSTOM_PDU_ID_SET_CHAR_ACTION
197  **
198  *- - Contents: String A, String B, [Float C, Bool D, Float E_x, Float E_y, Float E_z]
199  *- - Meaning: Set the character action to A, the second string is either "p" or ""
200  *- (the empty string). A value of "p" for the second string indicates that the
201  *- action is paused. Characters are typically paused if the sending application
202  *- such as DI-Guy Scenario has been playing and the user hits "pause" on the VCR control.
203  *- The remaining arguments are optional. Float C represents the speed modifier that force
204  *- action was called with. Bool D indicates whether the transition uses motion offsets to
205  *- reposition the character. Floats E_x, E_y, and E_z are an adjustment vector that can be
206  *- used to slide the character into position during the transition.
207  **
208  *i DIGUY_CUSTOM_PDU_ID_SET_CHAR_VISIBLE
209  **
210  *- - Contents: Long Boolean
211  **
212  *i DIGUY_CUSTOM_PDU_ID_SET_SCENARIO_FRAME
213  **
214  *- - Contents: Long val
215  *- - Meaning: call diguyScenario::set_frame_desired(val)
216  **
217  *i DIGUY_CUSTOM_PDU_ID_SET_SCENARIO_PLAYBACK_MODE
218  **
219  *- - Contents: Long val
220  *- - Meaning: call diguyScenario::set_playback_mode(val)
221  **
222  *i DIGUY_CUSTOM_PDU_ID_LOAD_SCENARIO_CAMERA
223  **
224  *- - Contents: string
225  *- - Meaning: call diguyScenario::get_scenario_camera()->load_settings(string)
226  **
227  *i DIGUY_CUSTOM_PDU_ID_RESET
228  **
229  *- - Meaning: call diguyScenario::reset()
230  **
231  *i DIGUY_CUSTOM_PDU_ID_HAIL
232  **
233  *i DIGUY_CUSTOM_PDU_ID_LOAD_SCENARIO_FILE
234  **
235  *- - Contents: string
236  *- - Meaning: call diguyScenario::load(string)
237  **
238  *i DIGUY_CUSTOM_PDU_ID_SET_CAMERA_DETAILS
239  **
240  *- Internal Use only
241  **
242  *i DIGUY_CUSTOM_PDU_ID_XC_LOAD_SCENARIO
243  **
244  *- - Contents:
245  ** - NetU16 => Target_site
246  ** - NetU16 => Target_host
247  ** - String => Filename
248  ** - String => Reference name
249  **
250  *i DIGUY_CUSTOM_PDU_ID_XC_LOAD_SCENARIO_COMPLETE
251  **
252  *- - Contents: string
253  *- - Meaning: Indicates scenario has finished loading
254  **
255  *i DIGUY_CUSTOM_PDU_ID_XC_MERGE_SCENARIO
256  **
257  *- - Contents:
258  ** - NetU16 => Target_site
259  ** - NetU16 => Target_host
260  ** - NetFlt32 => Time of Day
261  ** - NetFlt32[3] => Refx, Refy, Refz
262  ** - NetFlt32[3] => x, y, z
263  ** - NetFlt32[3] => w,r,p
264  ** - String => Filename
265  ** - String => Reference name
266  **
267  *i DIGUY_CUSTOM_PDU_ID_XC_MERGE_SCENARIO_COMPLETE
268  **
269  *- - Contents: string
270  *- - Meaning: Indicates scenario has finished loading
271  **
272  *i DIGUY_CUSTOM_PDU_ID_XC_SET_TIN_TOD
273  **
274  *- - Contents:
275  ** - NetU16 => Target_site
276  ** - NetU16 => Target_host
277  ** - NetFlt32 => Time of Day
278  *- - Meaning: call diguyScenario::set_tin_time_of_day()
279  **
280  *i DIGUY_CUSTOM_PDU_ID_XC_TIME_NOW
281  **
282  *- - Contents:
283  ** - NetFlt32 => seconds since midnight
284  ** - NetFlt32 => seconds to smooth
285  *- - Meaning: call diguyScenario::set_sync_info()
286  **
287  *i DIGUY_CUSTOM_PDU_ID_XC_CONTROL
288  **
289  *- - Contents:
290  ** - NetU16 => Target_site
291  ** - NetU16 => Target_host
292  ** - String => Command ("RUN", "STOP", "RESET", "FF", "REWIND")
293  **
294  *i DIGUY_CUSTOM_PDU_ID_XC_TRIGGER_SCRIPT
295  **
296  *- - Contents:
297  ** - NetU16 => Target_site
298  ** - NetU16 => Target_host
299  ** - String Script name
300  **
301  *i DIGUY_CUSTOM_PDU_ID_XC_EVAL_SCRIPT
302  **
303  *- - Contents:
304  ** - NetU16 => Target_site
305  ** - NetU16 => Target_host
306  ** - String => Script text
307  **
308  *i DIGUY_CUSTOM_PDU_ID_XC_SET_FF_SPEED
309  **
310  *- - Contents:
311  ** - NetU16 => Target_site
312  ** - NetU16 => Target_host
313  ** - NetFlt32 => Speed multiple
314  **
315  *i DIGUY_CUSTOM_PDU_ID_XC_TRIGGER_SIGNAL
316  **
317  *- - Contents:
318  ** - NetU16 => Target_site
319  ** - NetU16 => Target_host
320  ** - String => Signal to trigger
321  **
322  *i DIGUY_CUSTOM_PDU_ID_XC_RESET_SCENARIO
323  **
324  *- - Contents:
325  ** - NetU16 => Target_site
326  ** - NetU16 => Target_host
327  **
328  *i DIGUY_CUSTOM_PDU_ID_XC_ENTER_SLAVE_MODE
329  **
330  *- - Contents:
331  ** - NetU16 => Target_site
332  ** - NetU16 => Target_host
333  **
334  *i DIGUY_CUSTOM_PDU_ID_XC_EXIT_SLAVE_MODE
335  **
336  *- - Contents:
337  ** - NetU16 => Target_site
338  ** - NetU16 => Target_host
339  **
340  *i DIGUY_CUSTOM_PDU_ID_VARIABLE_STATE
341  **
342  *- - Contents:
343  ** - NetU16 => Target_site
344  ** - NetU16 => Target_host
345  ** - String => variable
346  ** - String => value
347  **
348  *i DIGUY_CUSTOM_PDU_ID_SAVE_SCENARIO
349  **
350  *- - Contents:
351  ** - NetU16 => Target_site
352  ** - NetU16 => Target_host
353  ** - NetU16 => use_user_name
354  ** - String => file name
355  **
356  *i DIGUY_CUSTOM_PDU_ID_SAVE_SCENARIO_COMPLETE
357  **
358  *- - Contents:
359  ** - String => file name
360  **
361  *i DIGUY_CUSTOM_PDU_ID_AI_SEND_MESSAGE_TO_CHARACTER
362  **
363  *- - Contents:
364  ** - NetU16 => Target_site
365  ** - NetU16 => Target_host
366  ** - NetU16 => target AI network number
367  ** - String => sender
368  ** - String => message_type
369  ** - String => message
370  ** - String => message_params
371  *- - Meaning: call
372  *e diguyCharacter::agent_accept_message(sender,
373  *e message_type,
374  *e message,
375  *e message_params);
376  *- on character with diguyCharacter::get_network_entity_number() == target AI network number
377  **
378  *i DIGUY_CUSTOM_PDU_ID_AI_SEND_MESSAGE_TO_GROUP
379  **
380  *- - Contents:
381  ** - String => group_name
382  ** - String => sender
383  ** - String => message_type
384  ** - String => message
385  ** - String => message_params
386  *- - Meaning: call
387  *e diguyCharacterGroup::send_message_to_all_members(sender,
388  *e message_type,
389  *e message,
390  *e message_params);
391  **
392  *i DIGUY_CUSTOM_PDU_ID_AI_BROADCAST_MESSAGE
393  **
394  *- - Contents:
395  ** - String => sender
396  ** - NetFlt32 => radius
397  ** - String => message_type
398  ** - String => message
399  ** - String => message_params
400  *- - Meaning: call
401  *e diguyCharacter::agent_broadcast_message(sender,
402  *e radius,
403  *e message_type,
404  *e message,
405  *e message_params);
406  ** Where character is the sender of message.
407  **
408  *i DIGUY_CUSTOM_PDU_ID_AI_BROADCAST_MESSAGE_TO_GROUP
409  **
410  *- - Contents:
411  ** - String => sender
412  ** - String => group_name
413  ** - NetFlt32 => radius
414  ** - String => message_type
415  ** - String => message
416  ** - String => message_params
417  *- - Meaning: call
418  *e diguyCharacter::agent_broadcast_message_to_group(group_name,
419  *e radius,
420  *e message_type,
421  *e message,
422  *e message_params);
423  ** Where character is the sender of message.
424  **
425  *i DIGUY_CUSTOM_PDU_ID_BEGIN_APPEARANCE_EFFECT
426  **
427  *- - Contents:
428  ** - String => appearance effect
429  ** - bool => flag if theres extended data
430  *- - Optional extended data:
431  ** - NetFlt32 => override scale
432  ** - NetFlt32[3] => override_offset x, y, z
433  ** - NetFlt32 => override duration
434  *- - Meaning: call
435  *e diguyCharacter::begin_appearance_effect(app_name, link_name, override_scale,
436  *e override_offset_x, override_offset_y, override_offset_z,
437  *e override_duration,
438  ** or
439  *e diguyCharacter::begin_appearance_effect(app_name);
440  **
441  *i DIGUY_CUSTOM_PDU_ID_END_APPEARANCE_EFFECT ( Gradual Stop )
442  **
443  *- - Contents:
444  *- - String => appearance_effect_name
445  ** - String => link_name
446  *- - Meaning: call
447  *e diguyCharacter::end_appearance_effect(appearance_effect_name,link_name)
448  **
449  *i DIGUY_CUSTOM_PDU_ID_STOP_APPEARANCE_EFFECT ( Instant Stop )
450  **
451  *- - Contents:
452  *- - String => appearance_effect_name
453  ** - String => link_name
454  *- - Meaning: call
455  *e diguyCharacter::stop_appearance_effect(appearance_effect_name, link_name)
456  **
457  *i DIGUY_CUSTOM_PDU_ID_SET_SCENE_OBJECT_BIT
458  **
459  *- - Contents:
460  *- - bool => true false
461  *- - Meaning: call
462  *e diguyCharacter::set_is_scene_object(value)
463  **
464  *i DIGUY_CUSTOM_PDU_ID_BROADCAST_EXERCISE_DATETIME
465  **
466  *b internal use only
467  *- - Contents:
468  ** - NetU16 => Target_site
469  ** - NetU16 => Target_host
470  ** - NetU16[7] => year, month, day, hour, minute, second, msec
471  *- - Meaning: call
472  ** bdiScenario::set_network_datetime(network_datetime);
473  **
474  *i DIGUY_CUSTOM_PDU_ID_REQUEST_EXERCISE_DATETIME_BROADCAST
475  **
476  ** Unused
477  **
478  *i DIGUY_CUSTOM_PDU_ID_SET_SHAPE_VARIATION_2
479  **
480  *- - Contents:
481  *- - complicated: a series of NetU16 ( link index ), NetU16 (shape index )
482  *- followed by a slightly compressed chunk of pixel data.
483  *- should probably only happen once per character, DI-Guy 13 adds a force
484  *- update and a version number to this PDU.
485  *-
486  *e int offset = 0;
487  *e short version = 0;
488  *e pdu->pullShort(version, offset);
489  *e
490  *e if(version != DIGUY_CUSTOM_PDU_ID_SET_SHAPE_VARIATION_VERSION){
491  *e return;
492  *e }
493  *e bool force = 0;
494  *e pdu->pullBool(force, offset);
495  *e if(character->get_has_texture_variations() && !force ){
496  *e return;
497  *e }
498  *e character->set_shape_texture_variations_no_effect(1);
499  *e
500  *e short link_index = 0;
501  *e while ( pdu->pullShort(link_index,offset) )
502  *e {
503  *e short shape_index = 0;
504  *e pdu->pullShort(shape_index, offset);
505  *e
506  *e bdiLink * link = character->get_link_at_index(link_index);
507  *e if(link)
508  *e {
509  *e bdiShape * shape = link->get_shape(shape_index);
510  *e if(!shape )
511  *e {
512  *e // we're done here character's don't match
513  *e break;
514  *e }
515  *e const unsigned char * data_blob = NULL;
516  *e int bytes_read;
517  *e if ( pdu->pullUnsignedData(data_blob, offset, bytes_read) )
518  *e {
519  *e // note pull the data first ignore if variation is already set.
520  *e if(!shape->get_has_custom_variation() || force)
521  *e {
522  *e // special value to register that rampdata is loaded off network
523  *e shape->set_variation_index(-2);
524 
525  *e unsigned char * data_blob_copy = shape->get_unique_ramp_data();
526  *e int new_data = 0;
527  *e if(!data_blob_copy){
528  *e new_data = 1;
529  *e data_blob_copy = new unsigned char [ shape->get_unique_ramp_data_size()*4 ];
530  *e }
531  *e // fill out the 0th index with nothing (that
532  *e data_blob_copy[0] = 128;
533  *e data_blob_copy[1] = 128;
534  *e data_blob_copy[2] = 128;
535  *e data_blob_copy[3] = 255;
536  *e
537  *e int q;
538  *e for(q = 0; q < bytes_read/3; q++)
539  *e {
540  *e data_blob_copy[(q+1)*4] = data_blob[q*3];
541  *e data_blob_copy[(q+1)*4+1] = data_blob[q*3+1];
542  *e data_blob_copy[(q+1)*4+2] = data_blob[q*3+2];
543  *e data_blob_copy[(q+1)*4+3] = 255;;
544  *e }
545  *e // fill the rest of the buffer with padding
546  *e for( ; q < shape->get_unique_ramp_data_size()-1; q++)
547  *e {
548  *e data_blob_copy[(q+1)*4] = 128;
549  *e data_blob_copy[(q+1)*4+1] = 128;
550  *e data_blob_copy[(q+1)*4+2] = 128;
551  *e data_blob_copy[(q+1)*4+3] = 255;
552  *e }
553  *e if(new_data){
554  *e shape->set_unique_ramp_data(data_blob_copy);
555  *e }
556  *e else{
557  *e shape->update_variation_texture();
558  *e }
559  *e }
560  *e }
561  *e }
562  *e }
563  *e
564  **
565  *i DIGUY_CUSTOM_PDU_ID_EXECUTE_GESTURE
566  **
567  *- - Contents:
568  ** - String => gesture_name
569  ** - Long => reps
570  ** - NetFlt32 => overall_duration
571  ** - NetFlt32 => channel_A_weight
572  *- - Meaning: call
573  ** diguyCharacter::execute_gesture(gesture_name,reps, overall_duration, channel_A_weight);
574  **
575  *i DIGUY_CUSTOM_PDU_ID_CHARACTER_SCALE
576  **
577  *- - Contents:
578  ** - NetFlt32[3] => scale x,y,z
579  ** - NetFlt32 => body_weight (optional added in 13.2)
580  *- - Meaning: call
581  *- diguyCharacter::set_scale(x,y,z);
582  *- if body_weight was found in pdu call
583  *- diguyCharacter::set_weight_scale(body_weight);
584  **
585  *i DIGUY_CUSTOM_PDU_ID_PLUGIN_RESERVED0
586  *i DIGUY_CUSTOM_PDU_ID_PLUGIN_RESERVED9
587  */
589 {
646 } ;
647 
Definition: diguy_dis_constants.h:589
Definition: diguy_dis_constants.h:602
Definition: diguy_dis_constants.h:26
Definition: diguy_dis_constants.h:91
Definition: diguy_dis_constants.h:127
Definition: diguy_dis_constants.h:31
Definition: diguy_dis_constants.h:92
Definition: diguy_dis_constants.h:52
Definition: diguy_dis_constants.h:638
Definition: diguy_dis_constants.h:115
Definition: diguy_dis_constants.h:587
Definition: diguy_dis_constants.h:586
Definition: diguy_dis_constants.h:30
Definition: diguy_dis_constants.h:593
Definition: diguy_dis_constants.h:610
Definition: diguy_dis_constants.h:599
Definition: diguy_dis_constants.h:149
Definition: diguy_dis_constants.h:621
Definition: diguy_dis_constants.h:29
Definition: diguy_dis_constants.h:624
Definition: diguy_dis_constants.h:627
Definition: diguy_dis_constants.h:38
Definition: diguy_dis_constants.h:63
Definition: diguy_dis_constants.h:636
Definition: diguy_dis_constants.h:603
Definition: diguy_dis_constants.h:600
Definition: diguy_dis_constants.h:608
Definition: diguy_dis_constants.h:591
Definition: diguy_dis_constants.h:138
Definition: diguy_dis_constants.h:629
Definition: diguy_dis_constants.h:25
Definition: diguy_dis_constants.h:606
Definition: diguy_dis_constants.h:64
Definition: diguy_dis_constants.h:65
Definition: diguy_dis_constants.h:614
Definition: diguy_dis_constants.h:605
Definition: diguy_dis_constants.h:596
Definition: diguy_dis_constants.h:607
Definition: diguy_dis_constants.h:90
Definition: diguy_dis_constants.h:28
Definition: diguy_dis_constants.h:33
Definition: diguy_dis_constants.h:622
Definition: diguy_dis_constants.h:623
Definition: diguy_dis_constants.h:75
Definition: diguy_dis_constants.h:104
Definition: diguy_dis_constants.h:51
Definition: diguy_dis_constants.h:102
Definition: diguy_dis_constants.h:39
Definition: diguy_dis_constants.h:635
Definition: diguy_dis_constants.h:62
Definition: diguy_dis_constants.h:105
Definition: diguy_dis_constants.h:76
Definition: diguy_dis_constants.h:32
Definition: diguy_dis_constants.h:628
Definition: diguy_dis_constants.h:585
const int DIGUY_CUSTOM_PDU_ID_SET_SHAPE_VARIATION_VERSION
Definition: diguy_dis_constants.h:642
Definition: diguy_dis_constants.h:626
Definition: diguy_dis_constants.h:639
Definition: diguy_dis_constants.h:34
diguyCustomPDUType
This enumeration lists the message IDs for DI-Guy's custom pdus, not all are usable outside of diguys...
Definition: diguy_dis_constants.h:582
Definition: diguy_dis_constants.h:139
Definition: diguy_dis_constants.h:116
Definition: diguy_dis_constants.h:126
Definition: diguy_dis_constants.h:615
Definition: diguy_dis_constants.h:598
Definition: diguy_dis_constants.h:632
Definition: diguy_dis_constants.h:37
Definition: diguy_dis_constants.h:588
Definition: diguy_dis_constants.h:597
Definition: diguy_dis_constants.h:77
Definition: diguy_dis_constants.h:604
Definition: diguy_dis_constants.h:611
Definition: diguy_dis_constants.h:49
Definition: diguy_dis_constants.h:50
Definition: diguy_dis_constants.h:630
Definition: diguy_dis_constants.h:103
Definition: diguy_dis_constants.h:594
Definition: diguy_dis_constants.h:618
Definition: diguy_dis_constants.h:89
Definition: diguy_dis_constants.h:617
Definition: diguy_dis_constants.h:633
Definition: diguy_dis_constants.h:584
Definition: diguy_dis_constants.h:601
Definition: diguy_dis_constants.h:637
Definition: diguy_dis_constants.h:79
Definition: diguy_dis_constants.h:631
Definition: diguy_dis_constants.h:616
Definition: diguy_dis_constants.h:620
Definition: diguy_dis_constants.h:78
Definition: diguy_dis_constants.h:625
Definition: diguy_dis_constants.h:634
Definition: diguy_dis_constants.h:595
Definition: diguy_dis_constants.h:27
Definition: diguy_dis_constants.h:612
Definition: diguy_dis_constants.h:613
Definition: diguy_dis_constants.h:619
Definition: diguy_dis_constants.h:590
Definition: diguy_dis_constants.h:592
Definition: diguy_dis_constants.h:609
Definition: diguy_dis_constants.h:36