DI-Guy SDK Documentation  13.7
diguyCharacterPathScriptBead.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2022 MAK Technologies, Inc.
4  ** All rights reserved.
5  *********************************************************************/
6 
7 /*********************************************************************
8  **
9  *t diguyCharacterPathScriptBead
10  **
11  *b Link against: libdiguy
12  */
13 
14 #ifndef __diguyCharacterPathScriptBead_H
15 #define __diguyCharacterPathScriptBead_H
16 
17 #ifdef SWIG
19 #else
20 #define CPLUSPLUS_ONLY
21 #endif
22 
23 #ifdef CPLUSPLUS_ONLY
24 class bdiBeadScript;
25 #endif
26 
27 
28 #include <declspec_diguy.h>
29 
37 class BDI_DECLSPEC_diguy diguyCharacterPathScriptBead
38 {
39 
40 public:
41 /*****************************************************************************/
51  /*l
52  *b Description:
53  **
54  ** Returns the name of the object. This pointer will
55  ** never be NULL.
56  **
57  *b Returns:
58  **
59  ** name of the object
60  */
61  const char* get_name();
62 
63  /*l
64  *b Description:
65  **
66  ** This function sets the name of this object.
67  **
68  *b Returns:
69  **
70  ** 0 on success, -1 on failure
71  */
72  int set_name(const char* name);
73 
74  /*l
75  *b Description:
76  **
77  ** This function returns the script this bead performs.
78  **
79  *b Returns:
80  **
81  ** script to perform; empty string if no script set
82  */
83  const char* get_script();
84 
85  /*l
86  *b Description:
87  **
88  ** This function sets the script this bead performs. When
89  ** a character is traversing the path containing this
90  ** bead, the specified script will be performed when this bead
91  ** is reached.
92  **
93  ** If this script bead is part of a diguyCharacterPath,
94  ** the diguyCharacterPath::update() function must be called for
95  ** changes to take effect.
96  **
97  *b Arguments:
98  **
99  *a script - the script that should be evaluated when
100  *a this bead is reached; pass NULL to un-set
101  *a the script
102  **
103  *b Returns:
104  **
105  ** 0 on success, -1 on failure
106  */
107  int set_script(const char* script);
108 
109  /*l
110  *b Description:
111  **
112  ** This function sets the script type of this bead. This can only
113  ** be "lua".
114  **
115  *b Arguments:
116  **
117  *a script_type - the language of the script
118  **
119  *b Returns:
120  **
121  ** 0 on success, -1 on failure
122  */
123  int set_script_type(const char* script);
124 
125  /*l
126  *b Returns:
127  **
128  ** The language of the script
129  */
130 
131  const char* get_script_type();
132 
133  /*l
134  *b Description:
135  **
136  ** This function returns how far into the path this bead is.
137  **
138  *b Returns:
139  **
140  ** distance into path of this bead, in meters
141  */
142  float get_distance_into_path();
143 
144  /*l
145  *b Description:
146  **
147  ** This function sets how far into the path this bead is.
148  **
149  ** Since distances and times on paths are interrelated,
150  ** calling this function will have the side-effect of setting
151  ** when on the path the bead is located, as if to a call to
152  ** set_tin().
153  **
154  ** If this script bead is part of a diguyCharacterPath,
155  ** the diguyCharacterPath::update() function must be called for
156  ** changes to take effect.
157  **
158  *b Arguments:
159  **
160  *a distance_into_path - how far into the path this bead is,
161  *a in meters
162  **
163  *b Returns:
164  **
165  ** 0 on success, -1 on failure
166  */
167  int set_distance_into_path(float distance_into_path);
168 
169  /*l
170  *b Description:
171  **
172  ** This function returns where on the path this bead is.
173  **
174  *b Returns:
175  **
176  ** location of this bead, in meters
177  */
178  float get_length();
179 
180  /*l
181  *b Description:
182  **
183  ** This function sets how long this bead will have an
184  ** effect. The bead will have an effect from its initial
185  ** distance into the path (as set by set_distance_into_path())
186  ** to (distance + length) seconds.
187  **
188  ** Since distances and times on paths are interrelated,
189  ** calling this function will have the side-effect of setting
190  ** when on the path the bead's effect ends, as if to a call
191  ** to set_duration().
192  **
193  ** If this script bead is part of a diguyCharacterPath,
194  ** the diguyCharacterPath::update() function must be called for
195  ** changes to take effect.
196  **
197  *b Arguments:
198  **
199  *a duration - duration of this bead, in seconds
200  **
201  *b Returns:
202  **
203  ** 0 on success, -1 on failure
204  */
205  int set_length(float length);
206 
207  /*l
208  *b Description:
209  **
210  ** This function returns when on the path this bead is.
211  **
212  *b Returns:
213  **
214  ** time location of this bead, in seconds
215  */
216  float get_tin();
217 
218  /*l
219  *b Description:
220  **
221  ** This function sets when this bead will begin to have
222  ** an effect.
223  **
224  ** Since distances and times on paths are interrelated,
225  ** calling this function will have the side-effect of setting
226  ** where on the path the bead is located, as if to a call to
227  ** set_distance_into_path().
228  **
229  ** If this script bead is part of a diguyCharacterPath,
230  ** the diguyCharacterPath::update() function must be called for
231  ** changes to take effect.
232  **
233  *b Arguments:
234  **
235  *a tin - when this bead begins to have an effect, in seconds
236  **
237  *b Returns:
238  **
239  ** 0 on success, -1 on failure
240  */
241  int set_tin(float tin);
242 
243  /*l
244  *b Description:
245  **
246  ** This function returns how long this bead will have an
247  ** effect.
248  **
249  *b Returns:
250  **
251  ** duration of this bead, in seconds
252  */
253  float get_duration();
254 
255  /*l
256  *b Description:
257  **
258  ** This function sets how long this bead will have an
259  ** effect. The bead will have an effect from tin seconds
260  ** (as set by set_tin()) to (tin + duration) seconds.
261  **
262  ** Since distances and times on paths are interrelated,
263  ** calling this function will have the side-effect of setting
264  ** where on the path the bead's effect ends, as if to a call
265  ** to set_length().
266  **
267  ** If this script bead is part of a diguyCharacterPath,
268  ** the diguyCharacterPath::update() function must be called for
269  ** changes to take effect.
270  **
271  *b Arguments:
272  **
273  *a duration - duration of this bead, in seconds
274  **
275  *b Returns:
276  **
277  ** 0 on success, -1 on failure
278  */
279  int set_duration(float duration);
280 
281 
282 /****************************************************************************/
283 /****************************************************************************/
284 /****************************************************************************/
291 /****************************************************************************/
292 /****************************************************************************/
293 /****************************************************************************/
294 
295  const char* get_begin_at_object_name();
296 
297  int set_begin_at_object_name(const char* begin_at_object_name);
298 
299  float get_begin_at_object_offset();
300 
301  int set_begin_at_object_offset(float begin_at_object_offset);
302 
303  const char* get_end_at_object_name();
304 
305  int set_end_at_object_name(const char* end_at_object_name);
306 
307  float get_end_at_object_offset();
308 
309  int set_end_at_object_offset(float end_at_object_offset);
310 
311 
312 /****************************************************************************/
313 /****************************************************************************/
314 
319 #ifdef CPLUSPLUS_ONLY
320 
321  bdiBeadScript* get_scripted_object() {return m_scripted_object;}
322 
323  friend class bdiBeadScript;
324 
325 private:
326 
327  /*l
328  ** A private constructor.
329  */
330  diguyCharacterPathScriptBead(bdiBeadScript* scripted_object);
331 
332  /*l
333  ** A private destructor.
334  */
336 
337  /*l
338  ** A pointer to internal data.
339  */
340  bdiBeadScript* m_scripted_object;
341 
342 #endif
343 
344 };
345 
346 
347 #endif /* __diguyCharacterPathScriptBead_H */
348 
349 
350 /*********************************************************************
351  ** Copyright (c) 1992-2022 MAK Technologies, Inc.
352  ** All rights reserved.
353  *********************************************************************/
A bead that sits on a character's spline path and triggers a new script evaluation.
Definition: diguyCharacterPathScriptBead.h:34