tweak C1-era CARR
[openc2e.git] / caosVM_creatures.cpp
blobac63771345272b7bf51e8d8da35947b03e3fd4ef
1 /*
2 * caosVM_creatures.cpp
3 * openc2e
5 * Created by Alyssa Milburn on Tue Jun 01 2004.
6 * Copyright (c) 2004 Alyssa Milburn. All rights reserved.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
20 #include "caosVM.h"
21 #include <iostream>
22 #include "openc2e.h"
23 #include "World.h"
24 #include "Engine.h"
25 #include "SkeletalCreature.h"
26 #include "Creature.h"
27 using std::cerr;
29 CreatureAgent *caosVM::getTargCreatureAgent() {
30 valid_agent(targ);
31 CreatureAgent *c = dynamic_cast<CreatureAgent *>(targ.get());
32 caos_assert(c);
33 return c;
36 Creature *caosVM::getTargCreature() {
37 return getTargCreatureAgent()->getCreature();
40 oldCreature *getoldCreature(Agent *a) {
41 if (!a) return 0;
42 CreatureAgent *b = dynamic_cast<CreatureAgent *>(a);
43 if (!b) return 0;
44 oldCreature *c = dynamic_cast<oldCreature *>(b->getCreature());
45 return c;
48 c2eCreature *getc2eCreature(Agent *a) {
49 if (!a) return 0;
50 CreatureAgent *b = dynamic_cast<CreatureAgent *>(a);
51 if (!b) return 0;
52 c2eCreature *c = dynamic_cast<c2eCreature *>(b->getCreature());
53 return c;
56 /**
57 STM# SHOU (command) stimulusno (integer)
58 %status stub
59 %pragma variants c1 c2
60 %cost c1,c2 0
62 void caosVM::c_STM_SHOU() {
63 VM_PARAM_INTEGER(stimulusno)
65 // TODO
68 /**
69 STM# SIGN (command) stimulusno (integer)
70 %status stub
71 %pragma variants c1 c2
72 %cost c1,c2 0
74 void caosVM::c_STM_SIGN() {
75 VM_PARAM_INTEGER(stimulusno)
77 // TODO
80 /**
81 STM# TACT (command) stimulusno (integer)
82 %status stub
83 %pragma variants c1 c2
84 %cost c1,c2 0
86 void caosVM::c_STM_TACT() {
87 VM_PARAM_INTEGER(stimulusno)
89 // TODO
92 /**
93 STM# WRIT (command) object (agent) stimulusno (integer)
94 %status stub
95 %pragma variants c1 c2
96 %cost c1,c2 0
98 void caosVM::c_STM_WRIT() {
99 VM_PARAM_INTEGER(stimulusno)
100 VM_PARAM_VALIDAGENT(object)
102 // TODO
106 STIM SHOU (command) stimulus (integer) strength (float)
107 %status stub
109 Send a stimulus of the given type to all Creatures who can hear OWNR.
111 void caosVM::c_STIM_SHOU() {
112 VM_VERIFY_SIZE(3)
113 VM_PARAM_FLOAT(strength)
114 VM_PARAM_INTEGER(stimulus)
116 // TODO
120 STIM SIGN (command) stimulus (integer) strength (float)
121 %status stub
123 Sends a stimulus of the given type to all Creatures who can see OWNR.
125 void caosVM::c_STIM_SIGN() {
126 VM_VERIFY_SIZE(3)
127 VM_PARAM_FLOAT(strength)
128 VM_PARAM_INTEGER(stimulus)
130 // TODO
134 STIM TACT (command) stimulus (integer) strength (float)
135 %status stub
137 Sends a stimulus of the given type to all Creatures who are touching OWNR.
139 void caosVM::c_STIM_TACT() {
140 VM_VERIFY_SIZE(3)
141 VM_PARAM_FLOAT(strength)
142 VM_PARAM_INTEGER(stimulus)
144 // TODO
148 STIM WRIT (command) creature (agent) stimulus (integer) strength (float)
149 %status maybe
151 Sends a stimulus of the given type to specific Creature.
153 void caosVM::c_STIM_WRIT() {
154 VM_VERIFY_SIZE(3)
155 VM_PARAM_FLOAT(strength)
156 VM_PARAM_INTEGER(stimulus)
157 VM_PARAM_VALIDAGENT(creature)
159 c2eCreature *c = getc2eCreature(creature.get());
160 if (!c) return; // ignored on non-creatures
162 // TODO: ownr?
163 c->handleStimulus(stimulus, strength);
167 STIM SHOU (command) significance (integer) input (integer) intensity (integer) features (integer) chem0 (integer) amount0 (integer) chem1 (integer) amount1 (integer) chem2 (integer) amount2 (integer) chem3 (integer) amount3 (integer)
168 %status stub
169 %pragma implementation caosVM::c_STIM_SHOU_c2
170 %pragma variants c1 c2
171 %cost c1,c2 0
173 void caosVM::c_STIM_SHOU_c2() {
174 VM_PARAM_INTEGER(amount3)
175 VM_PARAM_INTEGER(chem3)
176 VM_PARAM_INTEGER(amount2)
177 VM_PARAM_INTEGER(chem2)
178 VM_PARAM_INTEGER(amount1)
179 VM_PARAM_INTEGER(chem1)
180 VM_PARAM_INTEGER(amount0)
181 VM_PARAM_INTEGER(chem0)
182 VM_PARAM_INTEGER(features)
183 VM_PARAM_INTEGER(intensity)
184 VM_PARAM_INTEGER(input)
185 VM_PARAM_INTEGER(significance)
187 // TODO
191 STIM SIGN (command) significance (integer) input (integer) intensity (integer) features (integer) chem0 (integer) amount0 (integer) chem1 (integer) amount1 (integer) chem2 (integer) amount2 (integer) chem3 (integer) amount3 (integer)
192 %status stub
193 %pragma implementation caosVM::c_STIM_SIGN_c2
194 %pragma variants c1 c2
195 %cost c1,c2 0
197 void caosVM::c_STIM_SIGN_c2() {
198 VM_PARAM_INTEGER(amount3)
199 VM_PARAM_INTEGER(chem3)
200 VM_PARAM_INTEGER(amount2)
201 VM_PARAM_INTEGER(chem2)
202 VM_PARAM_INTEGER(amount1)
203 VM_PARAM_INTEGER(chem1)
204 VM_PARAM_INTEGER(amount0)
205 VM_PARAM_INTEGER(chem0)
206 VM_PARAM_INTEGER(features)
207 VM_PARAM_INTEGER(intensity)
208 VM_PARAM_INTEGER(input)
209 VM_PARAM_INTEGER(significance)
211 // TODO
215 STIM TACT (command) significance (integer) input (integer) intensity (integer) features (integer) chem0 (integer) amount0 (integer) chem1 (integer) amount1 (integer) chem2 (integer) amount2 (integer) chem3 (integer) amount3 (integer)
216 %status stub
217 %pragma implementation caosVM::c_STIM_TACT_c2
218 %pragma variants c1 c2
219 %cost c1,c2 0
221 void caosVM::c_STIM_TACT_c2() {
222 VM_PARAM_INTEGER(amount3)
223 VM_PARAM_INTEGER(chem3)
224 VM_PARAM_INTEGER(amount2)
225 VM_PARAM_INTEGER(chem2)
226 VM_PARAM_INTEGER(amount1)
227 VM_PARAM_INTEGER(chem1)
228 VM_PARAM_INTEGER(amount0)
229 VM_PARAM_INTEGER(chem0)
230 VM_PARAM_INTEGER(features)
231 VM_PARAM_INTEGER(intensity)
232 VM_PARAM_INTEGER(input)
233 VM_PARAM_INTEGER(significance)
235 // TODO
239 STIM WRIT (command) creature (agent) significance (integer) input (integer) intensity (integer) features (integer) chem0 (integer) amount0 (integer) chem1 (integer) amount1 (integer) chem2 (integer) amount2 (integer) chem3 (integer) amount3 (integer)
240 %status stub
241 %pragma implementation caosVM::c_STIM_WRIT_c2
242 %pragma variants c1 c2
243 %cost c1,c2 0
245 void caosVM::c_STIM_WRIT_c2() {
246 VM_PARAM_INTEGER(amount3)
247 VM_PARAM_INTEGER(chem3)
248 VM_PARAM_INTEGER(amount2)
249 VM_PARAM_INTEGER(chem2)
250 VM_PARAM_INTEGER(amount1)
251 VM_PARAM_INTEGER(chem1)
252 VM_PARAM_INTEGER(amount0)
253 VM_PARAM_INTEGER(chem0)
254 VM_PARAM_INTEGER(features)
255 VM_PARAM_INTEGER(intensity)
256 VM_PARAM_INTEGER(input)
257 VM_PARAM_INTEGER(significance)
258 VM_PARAM_AGENT(creature)
260 // TODO
261 //oldCreature *c = getoldCreature(creature.get());
262 //if (!c) return; // ignored on non-creatures
264 // TODO
268 STIM FROM (command) significance (integer) input (integer) intensity (integer) features (integer) chem0 (integer) amount0 (integer) chem1 (integer) amount1 (integer) chem2 (integer) amount2 (integer) chem3 (integer) amount3 (integer)
269 %status stub
270 %pragma implementation caosVM::c_STIM_FROM_c1
271 %pragma variants c1
272 %cost c1,c2 0
274 void caosVM::c_STIM_FROM_c1() {
275 VM_PARAM_INTEGER(amount3)
276 VM_PARAM_INTEGER(chem3)
277 VM_PARAM_INTEGER(amount2)
278 VM_PARAM_INTEGER(chem2)
279 VM_PARAM_INTEGER(amount1)
280 VM_PARAM_INTEGER(chem1)
281 VM_PARAM_INTEGER(amount0)
282 VM_PARAM_INTEGER(chem0)
283 VM_PARAM_INTEGER(features)
284 VM_PARAM_INTEGER(intensity)
285 VM_PARAM_INTEGER(input)
286 VM_PARAM_INTEGER(significance)
288 valid_agent(from.getAgent());
289 // TODO
293 SWAY SHOU (command) drive (integer) adjust (float) drive (integer) adjust (float) drive (integer) adjust (float) drive (integer) adjust (float)
294 %status stub
296 Adjusts these four drives in all Creatures who can hear OWNR.
298 void caosVM::c_SWAY_SHOU() {
299 VM_VERIFY_SIZE(8)
300 VM_PARAM_FLOAT(adjust4)
301 VM_PARAM_INTEGER(drive4)
302 VM_PARAM_FLOAT(adjust3)
303 VM_PARAM_INTEGER(drive3)
304 VM_PARAM_FLOAT(adjust2)
305 VM_PARAM_INTEGER(drive2)
306 VM_PARAM_FLOAT(adjust1)
307 VM_PARAM_INTEGER(drive1)
309 valid_agent(owner);
310 //TODO
314 SWAY SIGN (command) drive (integer) adjust (float) drive (integer) adjust (float) drive (integer) adjust (float) drive (integer) adjust (float)
315 %status stub
317 Adjusts these four drives in all Creatures who can see OWNR.
319 void caosVM::c_SWAY_SIGN() {
320 VM_VERIFY_SIZE(8)
321 VM_PARAM_FLOAT(adjust4)
322 VM_PARAM_INTEGER(drive4)
323 VM_PARAM_FLOAT(adjust3)
324 VM_PARAM_INTEGER(drive3)
325 VM_PARAM_FLOAT(adjust2)
326 VM_PARAM_INTEGER(drive2)
327 VM_PARAM_FLOAT(adjust1)
328 VM_PARAM_INTEGER(drive1)
330 valid_agent(owner);
331 //TODO
335 SWAY TACT (command) drive (integer) adjust (float) drive (integer) adjust (float) drive (integer) adjust (float) drive (integer) adjust (float)
336 %status stub
338 Adjusts these four drives in all Creatures who are touching OWNR.
340 void caosVM::c_SWAY_TACT() {
341 VM_VERIFY_SIZE(8)
342 VM_PARAM_FLOAT(adjust4)
343 VM_PARAM_INTEGER(drive4)
344 VM_PARAM_FLOAT(adjust3)
345 VM_PARAM_INTEGER(drive3)
346 VM_PARAM_FLOAT(adjust2)
347 VM_PARAM_INTEGER(drive2)
348 VM_PARAM_FLOAT(adjust1)
349 VM_PARAM_INTEGER(drive1)
351 valid_agent(owner);
352 //TODO
356 SWAY WRIT (command) creature (agent) drive (integer) adjust (float) drive (integer) adjust (float) drive (integer) adjust (float) drive (integer) adjust (float)
357 %status stub
359 Adjusts these four drives in the specified creature.
361 void caosVM::c_SWAY_WRIT() {
362 VM_VERIFY_SIZE(8)
363 VM_PARAM_FLOAT(adjust4)
364 VM_PARAM_INTEGER(drive4)
365 VM_PARAM_FLOAT(adjust3)
366 VM_PARAM_INTEGER(drive3)
367 VM_PARAM_FLOAT(adjust2)
368 VM_PARAM_INTEGER(drive2)
369 VM_PARAM_FLOAT(adjust1)
370 VM_PARAM_INTEGER(drive1)
371 VM_PARAM_VALIDAGENT(creature)
373 valid_agent(owner);
374 //TODO
378 NOHH (command)
379 %status stub
381 Tells the target Creature to stop holding hands with the pointer.
383 void caosVM::c_NOHH() {
384 VM_VERIFY_SIZE(0)
386 if (!targ) return; // DS agent help, at least, does 'targ hhld nohh'
388 Creature *c = getTargCreature();
389 // TODO
393 ZOMB (command) zombie (integer)
394 %status maybe
396 Turns zombification of the target Creature on and off. Set to 1 to disconnect the brain and
397 motor of the target Creature, and 0 to undo.
399 void caosVM::c_ZOMB() {
400 VM_VERIFY_SIZE(1)
401 VM_PARAM_INTEGER(zombie)
403 Creature *c = getTargCreature();
405 c->setZombie(zombie);
409 ZOMB (integer)
410 %status maybe
412 Returns 1 if target Creature is zombified, or 0 if otherwise.
414 void caosVM::v_ZOMB() {
415 Creature *c = getTargCreature();
416 result.setInt(c->isZombie());
420 DIRN (command) direction (integer)
421 %status maybe
423 Changes the target Creature to face a different direction.
425 void caosVM::c_DIRN() {
426 VM_VERIFY_SIZE(1)
427 VM_PARAM_INTEGER(direction)
429 caos_assert(direction >= 0 && direction <= 3);
431 CreatureAgent *c = getTargCreatureAgent();
432 c->setDirection(direction);
436 DIRN (integer)
437 %status maybe
438 %pragma variants c2 cv c3
440 Returns the direction the target Creatures is facing.
442 void caosVM::v_DIRN() {
443 CreatureAgent *c = getTargCreatureAgent();
445 result.setInt(c->getDirection());
449 HHLD (agent)
450 %status stub
452 Returns Creatures that are holding hands with pointer, or NULL if none.
454 void caosVM::v_HHLD() {
455 VM_VERIFY_SIZE(0)
457 result.setAgent(0); // TODO
461 MVFT (command) x (float) y (float)
462 %status maybe
464 Move the target Creature's foot (along with the rest of the Creature, obviously) to the given
465 coordinates. You should use this rather than MVTO for Creatures.
467 void caosVM::c_MVFT() {
468 VM_VERIFY_SIZE(2)
469 VM_PARAM_FLOAT(y)
470 VM_PARAM_FLOAT(x)
472 caos_assert(targ);
473 SkeletalCreature *c = dynamic_cast<SkeletalCreature *>(targ.get());
474 caos_assert(c);
476 // TODO: this should be nicer
477 float downfootxoffset = c->attachmentX(c->isLeftFootDown() ? 11 : 12, 0);
478 float downfootyoffset = c->attachmentY(c->isLeftFootDown() ? 11 : 12, 0);
480 targ->moveTo(x - downfootxoffset, y - downfootyoffset);
484 CREA (integer) agent (agent)
485 %status done
487 Determines whether the given agent is a creature or not (0 or 1).
489 void caosVM::v_CREA() {
490 VM_VERIFY_SIZE(1)
491 VM_PARAM_AGENT(agent)
493 CreatureAgent *c = dynamic_cast<CreatureAgent *>(agent.get());
494 if (c) result.setInt(1);
495 else result.setInt(0);
499 VOCB (command)
500 %status stub
502 Makes the target Creature learn all vocabulary words immediately.
504 void caosVM::c_VOCB() {
505 VM_VERIFY_SIZE(0)
507 Creature *c = getTargCreature();
509 // TODO
513 DEAD (command)
514 %status maybe
516 Kill the target Creature biologically.
518 void caosVM::c_DEAD() {
519 Creature *c = getTargCreature();
521 c->die();
525 DEAD (integer)
526 %status maybe
527 %pragma variants c1 c2 cv c3
529 Determines whether the target Creature is dead (0 or 1).
531 void caosVM::v_DEAD() {
532 Creature *c = getTargCreature();
534 result.setInt(!c->isAlive());
538 NORN (command) creature (agent)
539 %status maybe
541 Sets the target Creature to the given one.
543 void caosVM::c_NORN() {
544 VM_PARAM_AGENT(creature)
546 world.selectCreature(creature);
550 NORN (agent)
551 %status maybe
552 %pragma variants cv c3
554 Returns the target Creature.
557 NORN (variable)
558 %status maybe
559 %pragma variants c1 c2
561 Returns the target Creature.
563 CAOS_LVALUE(NORN, (void)0,
564 caosVar(world.selectedcreature),
565 world.selectCreature(newvalue.getAgent())
568 #include "AgentHelpers.h"
571 URGE SHOU (command) noun_stim (float) verb_id (integer) verb_stim (float)
572 %status stub
574 Urges all Creatures who can hear OWNR to perform the given action on OWNR.
575 The two stimuli parameters can range from -1.0 (discourage) to 1.0 (encourage).
577 void caosVM::c_URGE_SHOU() {
578 VM_PARAM_FLOAT(verb_stim)
579 VM_PARAM_INTEGER(verb_id)
580 VM_PARAM_FLOAT(noun_stim)
582 valid_agent(owner);
584 // TODO
588 URGE SIGN (command) noun_stim (float) verb_id (integer) verb_stim (float)
589 %status maybe
591 Urges all Creatures who can see OWNR to perform the given action on OWNR.
592 The two stimuli parameters can range from -1.0 (discourage) to 1.0 (encourage).
594 void caosVM::c_URGE_SIGN() {
595 VM_PARAM_FLOAT(verb_stim)
596 VM_PARAM_INTEGER(verb_id)
597 VM_PARAM_FLOAT(noun_stim)
599 valid_agent(owner);
601 // TODO: sanitise stim params (bind to -1.0/1.0)
602 c2eStim stim;
603 stim.noun_id = owner->category;
604 if (stim.noun_id == -1) return; // TODO: correct?
605 stim.noun_amount = noun_stim;
606 stim.verb_id = verb_id;
607 stim.verb_amount = verb_stim;
609 std::vector<boost::shared_ptr<Agent> > agents = getVisibleList(owner, 0, 0, 0);
610 for (std::vector<boost::shared_ptr<Agent> >::iterator i = agents.begin(); i != agents.end(); i++) {
611 boost::shared_ptr<Agent> a = *i; // guaranteed to be valid from getVisibleList
613 CreatureAgent *ca = dynamic_cast<CreatureAgent *>(a.get());
614 if (!ca) continue;
615 c2eCreature *c = dynamic_cast<c2eCreature *>(ca->getCreature());
616 if (!c) continue;
618 c->handleStimulus(stim);
623 URGE TACT (command) noun_stim (float) verb_id (integer) verb_stim (float)
624 %status stub
626 Urges all Creatures who are touching OWNR to perform the given action on OWNR.
627 The two stimuli parameters can range from -1.0 (discourage) to 1.0 (encourage).
629 void caosVM::c_URGE_TACT() {
630 VM_PARAM_FLOAT(verb_stim)
631 VM_PARAM_INTEGER(verb_id)
632 VM_PARAM_FLOAT(noun_stim)
634 valid_agent(owner);
636 // TODO
640 URGE WRIT (command) creature (agent) noun_id (integer) noun_stim (float) verb_id (integer) verb_stim (float)
641 %status stub
643 Urges the specified Creature to perform the specified action (verb) on the specified object type
644 (noun). Provide a stim greater than 1 to force, and an id of -1 and a stim greater than 1 to unforce.
646 void caosVM::c_URGE_WRIT() {
647 VM_PARAM_FLOAT(verb_stim)
648 VM_PARAM_INTEGER(verb_id)
649 VM_PARAM_FLOAT(noun_stim)
650 VM_PARAM_INTEGER(noun_id)
651 VM_PARAM_AGENT(creature)
653 if (!creature) return;
654 c2eCreature *c = getc2eCreature(creature.get());
655 if (!c) return; // ignored on non-creatures
657 // TODO
661 DRIV (command) drive_id (integer) adjust (float)
662 %status maybe
664 Modifies the level of a drive in target Creature by the given level, which can range from -1.0 (decrease) to 1.0 (increase).
666 void caosVM::c_DRIV() {
667 VM_PARAM_FLOAT(adjust)
668 VM_PARAM_INTEGER(drive_id) caos_assert(drive_id >= 0 && drive_id < 20);
670 valid_agent(targ);
671 c2eCreature *c = getc2eCreature(targ.get());
672 if (!c) return; // ignored on non-creatures
674 c->adjustDrive(drive_id, adjust);
678 DRIV (float) drive_id (integer)
679 %status maybe
681 Returns the level of a drive (0.0 to 1.0) in target Creature.
683 void caosVM::v_DRIV() {
684 VM_PARAM_INTEGER(drive_id) caos_assert(drive_id >= 0 && drive_id < 20);
686 c2eCreature *c = getc2eCreature(targ.get());
687 caos_assert(c);
689 result.setFloat(c->getDrive(drive_id));
693 CHEM (command) chemical_id (integer) adjust (float)
694 %status maybe
696 Modifies the level of a chemical in target Creature's bloodstream by adjust, which can range from -1.0 (decrease) to 1.0 (increase).
698 void caosVM::c_CHEM() {
699 VM_PARAM_FLOAT(adjust)
700 VM_PARAM_INTEGER(chemical_id) caos_assert(chemical_id >= 0 && chemical_id < 256);
702 valid_agent(targ);
703 c2eCreature *c = getc2eCreature(targ.get());
704 if (!c) return; // ignored on non-creatures
706 c->adjustChemical(chemical_id, adjust);
710 CHEM (command) chemical_id (integer) adjust (integer)
711 %status maybe
712 %pragma variants c1 c2
713 %pragma implementation caosVM::c_CHEM_c1
714 %cost c1,c2 0
716 Set the level of a chemical (0 to 255) in target creature's bloodstream.
718 void caosVM::c_CHEM_c1() {
719 VM_PARAM_INTEGER(adjust)
720 VM_PARAM_INTEGER(chemical_id) caos_assert(chemical_id >= 0 && chemical_id < 256);
722 // TODO: can adjust be negative?
724 valid_agent(targ);
725 oldCreature *c = getoldCreature(targ.get());
726 if (!c) return; // ignored on non-creatures
728 c->addChemical(chemical_id, adjust);
732 CHEM (float) chemical_id (integer)
733 %status maybe
735 Returns the level of a chemical (0.0 to 1.0) in target creature's bloodstream.
737 void caosVM::v_CHEM() {
738 VM_PARAM_INTEGER(chemical_id) caos_assert(chemical_id >= 0 && chemical_id < 256);
740 valid_agent(targ);
741 c2eCreature *c = getc2eCreature(targ.get());
742 caos_assert(c);
744 result.setFloat(c->getChemical(chemical_id));
748 CHEM (integer) chemical_id (integer)
749 %status maybe
750 %pragma variants c1 c2
751 %pragma implementation caosVM::v_CHEM_c1
753 Returns the level of a chemical (0 to 255) in target creature's bloodstream.
755 void caosVM::v_CHEM_c1() {
756 VM_PARAM_INTEGER(chemical_id) caos_assert(chemical_id >= 0 && chemical_id < 256);
758 valid_agent(targ);
759 oldCreature *c = getoldCreature(targ.get());
760 caos_assert(c);
762 result.setInt(c->getChemical(chemical_id));
766 ASLP (command) asleep (integer)
767 %status maybe
768 %pragma variants c1 c2 cv c3
770 If asleep is 1, makes the target creature sleep. If asleep is 0, makes the target creature wake.
772 void caosVM::c_ASLP() {
773 VM_PARAM_INTEGER(asleep)
775 Creature *c = getTargCreature();
777 c->setAsleep(asleep);
781 ASLP (integer)
782 %status maybe
783 %pragma variants c1 c2 cv c3
784 %cost c1,c2 0
786 Determines whether the target Creature is asleep.
788 void caosVM::v_ASLP() {
789 Creature *c = getTargCreature();
791 result.setInt(c->isAsleep());
794 #include "AgentHelpers.h"
796 class blockUntilApproached : public blockCond {
797 protected:
798 AgentRef parent, it;
799 CreatureAgent *parentcreature;
801 public:
802 blockUntilApproached(AgentRef p, AgentRef i) : parent(p), it(i) {
803 assert(parent);
804 parentcreature = dynamic_cast<CreatureAgent *>(parent.get());
805 assert(parentcreature);
807 virtual bool operator()() {
808 if (!parent) return false;
809 if (!it) return false; // TODO: CAs
811 if (agentsTouching(parent, it)) return false;
813 // parentcreature is guaranteed to be valid if parent is
815 // TODO: cope with this problem (eg: another APPR, creature paused, non-skeletal creature, etc)
816 //if (parentcreature->isApproaching()) return false;
818 // note that this merely sets up the approach to be done on the next tick of the creature
819 parentcreature->approach(it);
821 return true;
826 APPR (command)
827 %status maybe
828 %pragma variants c1 c2 cv c3
830 Makes the target Creature approach the IT agent (or if none, an agent of that category using CAs),
831 blocking until it makes it there or gives up.
833 void caosVM::c_APPR() {
834 CreatureAgent *a = getTargCreatureAgent();
835 caos_assert(a);
837 startBlocking(new blockUntilApproached(targ, _it_));
841 UNCS (command) unconscious (integer)
842 %status stub
844 Makes the target Creature conscious if 0, or unconscious if 1.
846 void caosVM::c_UNCS() {
847 VM_PARAM_INTEGER(unconscious)
849 Creature *c = getTargCreature();
851 // TODO
855 UNCS (integer)
856 %status stub
857 %pragma variants c2 cv c3
859 Returns 1 if the target Creature is unconscious, or 0 otherwise.
861 void caosVM::v_UNCS() {
862 Creature *c = getTargCreature();
864 result.setInt(0); // TODO
868 FACE (command) number (integer)
869 %status stub
871 void caosVM::c_FACE() {
872 VM_PARAM_INTEGER(number)
874 caos_assert(targ);
875 SkeletalCreature *c = dynamic_cast<SkeletalCreature *>(targ.get());
876 caos_assert(c);
878 // TODO
882 FACE INT (integer)
883 %status maybe
885 Returns the front-facing pose for the current facial expression of the target creature.
887 void caosVM::v_FACE_INT() {
888 caos_assert(targ);
889 SkeletalCreature *c = dynamic_cast<SkeletalCreature *>(targ.get());
890 caos_assert(c);
892 result.setInt(c->getFaceSpriteFrame());
896 FACE STRING (string)
897 %status maybe
899 Returns the current sprite filename for the face of the target creature.
901 void caosVM::v_FACE_STRING() {
902 caos_assert(targ);
903 SkeletalCreature *c = dynamic_cast<SkeletalCreature *>(targ.get());
904 caos_assert(c);
906 result.setString(c->getFaceSpriteName());
910 LIKE (command) creature (agent)
911 %status stub
913 Causes the target Creature to state an opinion about the specified Creature.
915 void caosVM::c_LIKE() {
916 VM_PARAM_VALIDAGENT(creature)
918 Creature *c = getTargCreature();
920 // TODO
924 LIMB (string) bodypart (integer) genus (integer) gender (integer) age (integer) variant (integer)
925 %status stub
927 Returns the filename for the specified part of a Creature, substituting as necessary.
929 void caosVM::v_LIMB() {
930 VM_PARAM_INTEGER(variant)
931 VM_PARAM_INTEGER(age)
932 VM_PARAM_INTEGER(gender)
933 VM_PARAM_INTEGER(genus)
934 VM_PARAM_INTEGER(bodypart)
936 Creature *c = getTargCreature();
938 result.setString(""); // TODO
942 ORDR SHOU (command) speech (string)
943 %status stub
945 Makes the target Creature speak the specified speech to all creatures in hearing range.
947 void caosVM::c_ORDR_SHOU() {
948 VM_PARAM_STRING(speech)
950 valid_agent(targ);
951 // TODO
955 ORDR SIGN (command) speech (string)
956 %status stub
958 Makes the target Creature speak the specified speech to all creatures that can see it.
960 void caosVM::c_ORDR_SIGN() {
961 VM_PARAM_STRING(speech)
963 valid_agent(targ);
964 // TODO
968 ORDR TACT (command) speech (string)
969 %status stub
971 Makes the target Creature speak the specified speech to all creatures that are touching it.
973 void caosVM::c_ORDR_TACT() {
974 VM_PARAM_STRING(speech)
976 valid_agent(targ);
977 // TODO
981 ORDR WRIT (command) creature (agent) speech (string)
982 %status stub
984 Makes the target Creature speak the specified speech to the specified creature.
986 void caosVM::c_ORDR_WRIT() {
987 VM_PARAM_STRING(speech)
988 VM_PARAM_VALIDAGENT(creature)
990 valid_agent(targ);
991 // TODO
995 DREA (command) dream (integer)
996 %status maybe
998 Turns a Creature's dreaming on and off. A Creature's instincts are
999 processed while it is dreaming. If it is not asleep already, then it
1000 will be made to sleep before dreaming begins.
1002 void caosVM::c_DREA() {
1003 VM_PARAM_INTEGER(dream)
1005 Creature *c = getTargCreature();
1006 c->setDreaming(dream);
1010 DREA (integer)
1011 %status maybe
1013 Returns whether or not the target Creature is dreaming (0 or 1).
1015 void caosVM::v_DREA() {
1016 Creature *c = getTargCreature();
1017 result.setInt(c->isDreaming());
1021 BORN (command)
1022 %status maybe
1024 Registers the birth of the target Creature, and sends a birth event to
1025 the game.
1027 void caosVM::c_BORN() {
1028 Creature *c = getTargCreature();
1029 c->born();
1033 CAGE (integer)
1034 %status maybe
1035 %pragma variants c1 c2 cv c3
1037 Returns the integer value of the target Creature's current life stage.
1039 void caosVM::v_CAGE() {
1040 Creature *c = getTargCreature();
1041 result.setInt((int)c->getStage());
1045 BYIT (integer)
1046 %status maybe
1048 Determines whether or not the target Creature can reach the IT agent (0
1049 or 1).
1051 void caosVM::v_BYIT() {
1052 Creature *c = getTargCreature();
1054 if (_it_ && agentsTouching(targ, _it_)) // TODO
1055 result.setInt(1);
1056 else
1057 result.setInt(0);
1061 _IT_ (agent)
1062 %status maybe
1063 %pragma implementation caosVM::v_IT
1064 %pragma variants c1 c2 cv c3
1066 Returns the agent that the OWNR creature was focused on when the
1067 current script began running.
1069 void caosVM::v_IT() {
1070 valid_agent(owner);
1071 caos_assert(dynamic_cast<CreatureAgent *>(owner.get())); // TODO: return null instead?
1072 result.setAgent(_it_);
1076 NEWC (command) family (integer) gene_agent (agent) gene_slot (integer) sex (integer) variant (integer)
1077 %status maybe
1079 Creates a new creature over the space of a few ticks, using the specified agent/slot for genetic data. sex is 0 for random, 1 for male or 2 for female.
1081 void caosVM::c_NEWC() {
1082 VM_PARAM_INTEGER(variant)
1083 VM_PARAM_INTEGER(sex)
1084 VM_PARAM_INTEGER(gene_slot)
1085 VM_PARAM_VALIDAGENT(gene_agent)
1086 VM_PARAM_INTEGER(family)
1088 // TODO: creation should be blocking and multiple-tick!
1090 std::map<unsigned int, shared_ptr<class genomeFile> >::iterator i = gene_agent->slots.find(gene_slot);
1091 caos_assert(i != gene_agent->slots.end());
1093 // randomise sex if necessary
1094 if (sex == 0) sex = 1 + (int) (2.0 * (rand() / (RAND_MAX + 1.0)));
1095 caos_assert(sex == 1 || sex == 2); // TODO: correct?
1097 // TODO: if variant is 0, randomise between 1 and 8
1098 SkeletalCreature *a = new SkeletalCreature(family);
1099 try {
1100 c2eCreature *c = new c2eCreature(i->second, (sex == 2), variant, a);
1101 a->setCreature(c);
1102 } catch (...) {
1103 delete a;
1104 throw;
1107 a->finishInit();
1109 world.history.getMoniker(world.history.findMoniker(i->second)).moveToCreature(a);
1110 i->second.reset(); // TODO: remove the slot from the gene_agent entirely
1112 setTarg(a);
1116 NEW: CREA (command) family (integer) gene_agent (agent) gene_slot (integer) sex (integer) variant (integer)
1117 %status stub
1119 Creates a new creature using the specified agent/slot for genetic data. sex is 0 for random, 1 for male or 2 for female.
1121 void caosVM::c_NEW_CREA() {
1122 /*VM_PARAM_INTEGER(variant)
1123 VM_PARAM_INTEGER(sex)
1124 VM_PARAM_INTEGER(gene_slot)
1125 VM_PARAM_VALIDAGENT(gene_agent)
1126 VM_PARAM_INTEGER(family)*/
1128 c_NEWC(); // TODO
1129 //targ = NULL; // TODO
1133 NEW: CREA (command) moniker (integer) sex (integer)
1134 %status maybe
1135 %pragma variants c1 c2
1136 %pragma implementation caosVM::c_NEW_CREA_c1
1138 Creates a new creature using the specified moniker for genetic data. sex is 0 for random, 1 for male or 2 for female.
1140 void caosVM::c_NEW_CREA_c1() {
1141 VM_PARAM_INTEGER(sex)
1142 VM_PARAM_INTEGER(moniker)
1144 caos_assert(moniker != 0);
1146 std::string realmoniker = std::string((char *)&moniker, 4);
1147 shared_ptr<genomeFile> genome = world.loadGenome(realmoniker);
1148 if (!genome)
1149 throw creaturesException("failed to find genome file '" + realmoniker + '"');
1151 caos_assert(genome->getVersion() == engine.version);
1153 // randomise sex if necessary
1154 if (sex == 0) sex = 1 + (int) (2.0 * (rand() / (RAND_MAX + 1.0)));
1155 caos_assert(sex == 1 || sex == 2); // TODO: correct?
1157 SkeletalCreature *a = new SkeletalCreature(4);
1159 // TODO: why do we even need to pass a variant here?
1160 oldCreature *c;
1162 try {
1163 if (engine.version == 1) c = new c1Creature(genome, (sex == 2), 0, a);
1164 else c = new c2Creature(genome, (sex == 2), 0, a);
1165 } catch (...) {
1166 delete a;
1167 throw;
1170 a->setCreature(c);
1171 a->finishInit();
1173 a->slots[0] = genome;
1174 world.newMoniker(genome, realmoniker, a);
1175 world.history.getMoniker(world.history.findMoniker(genome)).moveToCreature(a);
1177 setTarg(a);
1180 int calculateRand(int value1, int value2); // caosVM_variables.cpp
1183 LTCY (command) action (integer) min (integer) max (integer)
1184 %status maybe
1185 %pragma variants c1 c2 cv c3
1187 void caosVM::c_LTCY() {
1188 VM_PARAM_INTEGER(max); caos_assert(max >= 0 && max <= 255);
1189 VM_PARAM_INTEGER(min); caos_assert(min >= 0 && min <= 255);
1190 VM_PARAM_INTEGER(action);
1192 int n = calculateRand(min, max);
1194 Creature *c = getTargCreature();
1196 c2eCreature *c2ec = dynamic_cast<c2eCreature *>(c);
1197 if (c2ec) {
1198 c2ec->setInvolActionLatency(action, n);
1201 // TODO: ltcy support for c1/c2
1205 F**K (command)
1206 %status stub
1207 %pragma variants c1
1208 %pragma implementation caosVM::c_MATE
1212 MATE (command)
1213 %pragma variants c2 cv c3
1214 %status stub
1216 void caosVM::c_MATE() {
1217 Creature *c = getTargCreature();
1218 caos_assert(_it_);
1219 CreatureAgent *t = dynamic_cast<CreatureAgent *>(_it_.get());
1220 caos_assert(t);
1221 Creature *d = t->getCreature();
1223 // TODO
1227 DRV! (integer)
1228 %status stub
1229 %pragma implementation caosVM::v_DRV
1230 %pragma variants c1 c2 cv c3
1232 void caosVM::v_DRV() {
1233 Creature *c = getTargCreature();
1234 result.setInt(0); // TODO
1238 IITT (agent)
1239 %status maybe
1241 Return the agent which the target creature is currently focused on. Note that you should probably use _IT_ in creature scripts.
1243 void caosVM::v_IITT() {
1244 Creature *c = getTargCreature();
1245 result.setAgent(c->getAttentionFocus());
1249 AGES (command) times (integer)
1250 %status maybe
1252 Age (ie, increase the life stage of) the target creature the specified number of times.
1254 void caosVM::c_AGES() {
1255 VM_PARAM_INTEGER(times)
1256 caos_assert(times >= 0);
1258 Creature *c = getTargCreature();
1259 for (int i = 0; i < times; i++) {
1260 c->ageCreature();
1265 LOCI (command) type (integer) organ (integer) tissue (integer) id (integer) value (float)
1266 %status maybe
1268 Set the value of the specified loci of the target creature. 'type' is 0 for receptor loci and 1 for emitter loci.
1269 See genetics documentation for details of the parameters.
1271 void caosVM::c_LOCI() {
1272 VM_PARAM_FLOAT(value)
1273 VM_PARAM_INTEGER(id)
1274 VM_PARAM_INTEGER(tissue)
1275 VM_PARAM_INTEGER(organ)
1276 VM_PARAM_INTEGER(type)
1278 c2eCreature *c = getc2eCreature(targ.get());
1280 float *f = c->getLocusPointer(!type, organ, tissue, id);
1281 caos_assert(f);
1282 *f = value;
1286 LOCI (float) type (integer) organ (integer) tissue (integer) id (integer)
1287 %status maybe
1289 Return the current value of the specified loci of the target creature. 'type' is 0 for receptor loci and 1 for emitter loci.
1290 See genetics documentation for details of thei parameters.
1292 void caosVM::v_LOCI() {
1293 VM_PARAM_INTEGER(id)
1294 VM_PARAM_INTEGER(tissue)
1295 VM_PARAM_INTEGER(organ)
1296 VM_PARAM_INTEGER(type)
1298 c2eCreature *c = getc2eCreature(targ.get());
1300 float *f = c->getLocusPointer(!type, organ, tissue, id);
1301 caos_assert(f);
1302 result.setFloat(*f);
1306 TAGE (integer)
1307 %status maybe
1309 Returns age of target creature, in ticks. Only counts ticks since it was BORN.
1311 void caosVM::v_TAGE() {
1312 Creature *c = getTargCreature();
1313 result.setInt(c->getAge());
1317 ORGN (integer)
1318 %status maybe
1320 Return the number of organs the target creature has.
1322 void caosVM::v_ORGN() {
1323 c2eCreature *c = getc2eCreature(targ.get());
1324 result.setInt(c->noOrgans());
1328 ORGF (float) organ (integer) value (integer)
1329 %status maybe
1331 Return some data about the specified organ (numbered starting at zero) of the target creature.
1333 value should be one of the following types of data:
1334 0: clock rate
1335 1: short term life force as a proportion of the initial life force
1336 2: repair rate
1337 3: injury to apply
1338 4: initial life force
1339 5: short term life force
1340 6: long term life force
1341 7: damage rate
1342 8: energy cost
1343 9: atp damage coefficient
1345 Returns -1 if the specified organ or value is invalid.
1347 void caosVM::v_ORGF() {
1348 VM_PARAM_INTEGER(value)
1349 VM_PARAM_INTEGER(organ)
1351 c2eCreature *c = getc2eCreature(targ.get());
1352 if (organ < 0 || (unsigned int)organ >= c->noOrgans()) {
1353 result.setFloat(-1.0f);
1354 return;
1357 shared_ptr<c2eOrgan> o = c->getOrgan(organ);
1359 switch (value) {
1360 case 0: result.setFloat(o->getClockRate()); break;
1361 case 1: result.setFloat(o->getShortTermLifeforce() / o->getInitialLifeforce()); break;
1362 case 2: result.setFloat(o->getRepairRate()); break;
1363 case 3: result.setFloat(o->getInjuryToApply()); break;
1364 case 4: result.setFloat(o->getInitialLifeforce()); break;
1365 case 5: result.setFloat(o->getShortTermLifeforce()); break;
1366 case 6: result.setFloat(o->getLongTermLifeforce()); break;
1367 case 7: result.setFloat(o->getDamageRate()); break;
1368 case 8: result.setFloat(o->getEnergyCost()); break;
1369 case 9: result.setFloat(o->getATPDamageCoefficient()); break;
1370 default: result.setFloat(-1.0f); break;
1375 ORGI (integer) organ (integer) value (integer)
1376 %status maybe
1378 Returns a count of receptors (value 0), emitters (value 1) or reactions (value 2) in the specified organ (numbered starting at zero) of the target creature.
1380 Returns -1 if the specified organ or value is invalid.
1382 void caosVM::v_ORGI() {
1383 VM_PARAM_INTEGER(value)
1384 VM_PARAM_INTEGER(organ)
1386 c2eCreature *c = getc2eCreature(targ.get());
1387 if (organ < 0 || (unsigned int)organ >= c->noOrgans()) {
1388 result.setFloat(-1.0f);
1389 return;
1392 shared_ptr<c2eOrgan> o = c->getOrgan(organ);
1394 switch (value) {
1395 case 0: result.setInt(o->getReceptorCount()); break;
1396 case 1: result.setInt(o->getEmitterCount()); break;
1397 case 2: result.setInt(o->getReactionCount()); break;
1398 default: result.setFloat(-1.0f); break;
1403 SOUL (command) part (integer) on (integer)
1404 %status stub
1406 void caosVM::c_SOUL() {
1407 VM_PARAM_INTEGER(on)
1408 VM_PARAM_INTEGER(part)
1409 caos_assert(part >= 0 && part <= 8);
1411 Creature *c = getTargCreature();
1412 // TODO
1416 SOUL (integer) part (integer)
1417 %status stub
1419 void caosVM::v_SOUL() {
1420 VM_PARAM_INTEGER(part)
1421 caos_assert(part >= 0 && part <= 8);
1423 Creature *c = getTargCreature();
1424 result.setInt(1); // TODO
1428 DECN (integer)
1429 %status maybe
1431 void caosVM::v_DECN() {
1432 Creature *c = getTargCreature();
1433 result.setInt(c->getDecisionId());
1437 ATTN (integer)
1438 %status maybe
1440 void caosVM::v_ATTN() {
1441 Creature *c = getTargCreature();
1442 result.setInt(c->getAttentionId());
1446 TOUC (command)
1447 %status stub
1448 %pragma variants c1 c2 cv c3
1450 void caosVM::c_TOUC() {
1451 Creature *c = getTargCreature();
1453 // TODO
1457 FORF (command) creature (agent)
1458 %status stub
1460 void caosVM::c_FORF() {
1461 VM_PARAM_VALIDAGENT(creature)
1463 Creature *c = getTargCreature();
1464 // TODO: do we handle pointer as well?
1465 Creature *learn = dynamic_cast<Creature *>(creature.get());
1466 if (!learn) return;
1468 // TODO
1472 WALK (command)
1473 %status maybe
1474 %pragma variants c1 c2 cv c3
1476 void caosVM::c_WALK() {
1477 CreatureAgent *c = getTargCreatureAgent();
1479 c->startWalking();
1483 DONE (command)
1484 %status stub
1485 %pragma variants c1 c2 cv c3
1487 void caosVM::c_DONE() {
1488 Creature *c = getTargCreature();
1490 // TODO
1494 SAYN (command)
1495 %status stub
1496 %pragma variants c1 c2 cv c3
1498 void caosVM::c_SAYN() {
1499 Creature *c = getTargCreature();
1501 // TODO
1505 IMPT (command) nudge (integer)
1506 %status stub
1507 %pragma variants c1 c2
1509 void caosVM::c_IMPT() {
1510 VM_PARAM_INTEGER(nudge)
1512 // TODO: check for creature targ?
1513 // TODO
1517 AIM: (command) actionno (integer)
1518 %status stub
1519 %pragma variants c1 c2
1521 void caosVM::c_AIM() {
1522 VM_PARAM_INTEGER(actionno)
1524 // TODO: check for creature targ? who knows?
1525 // TODO
1529 BABY (variable)
1530 %status maybe
1531 %pragma variants c1 c2
1533 CAOS_LVALUE_TARG_SIMPLE(BABY, targ->babymoniker); // TODO
1536 SNEZ (command)
1537 %status stub
1538 %pragma variants c1 c2
1540 void caosVM::c_SNEZ() {
1541 Creature *c = getTargCreature();
1543 // TODO
1547 DRIV (integer) drive (integer)
1548 %status maybe
1549 %pragma variants c1 c2
1550 %pragma implementation caosVM::v_DRIV_c1
1552 Returns the value for the specified drive of the target creature.
1554 void caosVM::v_DRIV_c1() {
1555 VM_PARAM_INTEGER(drive)
1556 caos_assert(drive < 16);
1558 oldCreature *c = getoldCreature(targ.get());
1559 // TODO: c2 support
1560 caos_assert(c);
1562 result.setInt(c->getDrive(drive));
1566 DREA (command) max (integer)
1567 %status stub
1568 %pragma variants c1 c2
1569 %pragma implementation caosVM::c_DREA_c1
1571 Start dreaming and process (at most?) max instincts.
1573 void caosVM::c_DREA_c1() {
1574 VM_PARAM_INTEGER(max)
1576 oldCreature *c = getoldCreature(targ.get());
1577 caos_assert(c);
1579 // TODO
1583 BRED (integer) part (integer)
1584 %status stub
1586 void caosVM::v_BRED() {
1587 VM_PARAM_INTEGER(part)
1589 result.setInt(0); // TODO
1593 BVAR (integer)
1594 %status stub
1596 void caosVM::v_BVAR() {
1597 result.setInt(0); // TODO
1601 EXPR (command) index (integer) ticks (integer)
1602 %status stub
1604 void caosVM::c_EXPR() {
1605 VM_PARAM_INTEGER(ticks)
1606 VM_PARAM_INTEGER(index)
1608 // TODO
1612 EXPR (integer)
1613 %status stub
1615 void caosVM::v_EXPR() {
1616 result.setInt(0); // TODO
1620 TNTC (command) tintindex (integer) part (integer) commit (integer)
1621 %status stub
1623 void caosVM::c_TNTC() {
1624 VM_PARAM_INTEGER(commit)
1625 VM_PARAM_INTEGER(part)
1626 VM_PARAM_INTEGER(tintindex)
1628 // TODO
1632 INJR (command) organ (integer) amount (integer)
1633 %status stub
1634 %pragma variants c2
1636 void caosVM::c_INJR() {
1637 VM_PARAM_INTEGER(amount)
1638 VM_PARAM_INTEGER(organ)
1640 valid_agent(targ);
1641 // TODO
1645 SAY$ (command) string (string)
1646 %status stub
1647 %pragma variants c1
1649 void caosVM::c_SAY() {
1650 VM_PARAM_STRING(string)
1652 valid_agent(targ);
1653 // TODO
1657 TRIG (command) lobe (integer) cell (integer) amount (integer)
1658 %status stub
1659 %pragma variants c2
1661 void caosVM::c_TRIG() {
1662 VM_PARAM_INTEGER(amount)
1663 VM_PARAM_INTEGER(cell)
1664 VM_PARAM_INTEGER(lobe)
1666 valid_agent(targ);
1667 // TODO
1671 MONK (integer)
1672 %status stub
1673 %pragma variants c2
1675 void caosVM::v_MONK() {
1676 oldCreature *c = getoldCreature(targ.get());
1677 caos_assert(c);
1679 result.setInt(0); // TODO
1682 // clothes
1685 BODY (command) set (integer) layer (integer)
1686 %status stub
1688 void caosVM::c_BODY() {
1689 VM_PARAM_INTEGER(layer)
1690 VM_PARAM_INTEGER(set)
1692 // TODO
1696 BODY (integer) part (integer)
1697 %status stub
1699 void caosVM::v_BODY() {
1700 VM_PARAM_INTEGER(part)
1702 result.setInt(-1); // TODO
1706 DYED (command) part (integer) overlay (integer) set (integer) layer (integer)
1707 %status stub
1709 void caosVM::c_DYED() {
1710 VM_PARAM_INTEGER(layer)
1711 VM_PARAM_INTEGER(set)
1712 VM_PARAM_INTEGER(overlay)
1713 VM_PARAM_INTEGER(part)
1715 // TODO
1719 HAIR (command) ruffleness (integer)
1720 %status stub
1722 void caosVM::c_HAIR() {
1723 VM_PARAM_INTEGER(ruffleness)
1725 // TODO
1729 NUDE (command)
1730 %status stub
1732 void caosVM::c_NUDE() {
1733 // TODO
1737 RSET (command)
1738 %status stub
1740 void caosVM::c_RSET() {
1741 // TODO
1745 STRE (command)
1746 %status stub
1748 void caosVM::c_STRE() {
1749 // TODO
1753 SWAP (command) variant (integer) part (integer) commit (integer)
1754 %status stub
1756 void caosVM::c_SWAP() {
1757 VM_PARAM_INTEGER(commit)
1758 VM_PARAM_INTEGER(part)
1759 VM_PARAM_INTEGER(variant)
1761 // TODO
1765 WEAR (command) part (integer) set (integer) layer (integer)
1766 %status stub
1768 void caosVM::c_WEAR() {
1769 VM_PARAM_INTEGER(layer)
1770 VM_PARAM_INTEGER(set)
1771 VM_PARAM_INTEGER(part)
1773 // TODO
1777 WEAR (integer) part (integer) layer (integer)
1778 %status stub
1780 void caosVM::v_WEAR() {
1781 VM_PARAM_INTEGER(layer)
1782 VM_PARAM_INTEGER(part)
1784 result.setInt(-1); // TODO
1788 TNTO (command) tintindex (integer) part (integer) set (integer) layer (integer)
1789 %status stub
1791 void caosVM::c_TNTO() {
1792 VM_PARAM_INTEGER(layer)
1793 VM_PARAM_INTEGER(set)
1794 VM_PARAM_INTEGER(part)
1795 VM_PARAM_INTEGER(tintindex)
1797 // TODO
1800 // attachment locations
1803 DFTX (float)
1804 %status stub
1806 void caosVM::v_DFTX() {
1807 result.setFloat(0); // TODO
1811 DFTY (float)
1812 %status stub
1814 void caosVM::v_DFTY() {
1815 result.setFloat(0); // TODO
1819 UFTX (float)
1820 %status stub
1822 void caosVM::v_UFTX() {
1823 result.setFloat(0); // TODO
1827 UFTY (float)
1828 %status stub
1830 void caosVM::v_UFTY() {
1831 result.setFloat(0); // TODO
1835 HEDX (float) index (integer)
1836 %status stub
1838 void caosVM::v_HEDX() {
1839 VM_PARAM_INTEGER(index)
1841 result.setFloat(0); // TODO
1845 HEDY (float) index (integer)
1846 %status stub
1848 void caosVM::v_HEDY() {
1849 VM_PARAM_INTEGER(index)
1851 result.setFloat(0); // TODO
1855 MTHX (float)
1856 %status stub
1858 void caosVM::v_MTHX() {
1859 result.setFloat(0); // TODO
1863 MTHY (float)
1864 %status stub
1866 void caosVM::v_MTHY() {
1867 result.setFloat(0); // TODO