ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Announcements and Showcase
forum topic indicator Scriptable Path (update)
person icon
sven
Registered User
Quote
2024-12-31 11:21:39

https://5v3n.itch.io/coppercube-...

Example shows 2 AIs :
one moves to "store" by opening closeing doors if needed -asks something (number 1-3) - takes if correct item given..and walks out of "store"
(there are 3 cilinders on table you must pick one that asked and "place it in box on table)
Second AI goes to switch light on if its switched off if needed.
You can open close door by pressing box on wall..same with light.


Some changes made plus removed errors: (i think so at least)
its just a fun project that may not have real use for you..it has different use for me but made it work like this also.

Script looks basic like as this:

WAYPOINT(7)

if( lamp.state = 1)
anim( stand,1)
wait(2000)
jumpToLine(1)
else
anim(walk,1)
print(clerk: lets turn light on)
endif


WAYPOINT(8)

if(lamp.state=0)
anim(Pistol_shot,0)
wait(500)
setVar(lamp.use,1)
anim(walk,1)
else
anim(walk,1)
newRoute(4,5,6,7)
endif



Possible commands currently:

setVar(varName,value) *can be also other variable dont need to be value

if() else endif *can have < > = ! &

print(textToPrint) *variable prints with at beginning

wait(timeToWait)

anim(animationName,loopMode)

affect endAffect *gives control over other node

rotY(rotationY)

jumpToLine(lineNumberInCurrentScriptToJump) *dont count empty lines

end *ends script reading at current pos

newRoute(waypointNumbers-separatedByCommas) *temporary route -needs some work tho



with setVar there are some special calls possible:
RANDOM
ADD
SUB
MUL
DIV
setVar(variableName,RANDOM,min,max) *sets variable to be random number
ADD/SUB/MUL/DIV **add substract multiply divide
setVar(varName,ADD,5) * its same as varname+=5; same with others

script actually doesnt care if you use () or just comma separators.

in example lamp.state and door.state and .use are defined in my script.. those variables you can have if you use script that has these variables.

you can set variable:
a * a is a then -can be used globally
or
this.a * this.a will be clerk.a (for example) - can be used locally or globally
(for example if multiple AIs comes to ask number 1-3 then this. variable is preferred..so each AI have theyr own desision. ("decision" as in example shown)

NB use TABs in script not spaces as in example script.

person icon
Sikes
Guest
Quote
2024-12-31 12:38:44

Thank you sven, you are really helping some of us and we are happy to have you with us always


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |