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