creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
Development Forum
old
More CAOS questions   
Geek2Nurse

Geek2Nurse
United States  

 visit Geek2Nurse's website: Adventures in Nornia
  4/5/2012

I'm getting very close to being dangerous now...have figured out how to stick stuff in my different rooms using CAOS and am probably destroying ecosystems all over the C3/DS world!

Q1: I'm getting "invalid targ" errors on certain agents, though, and I don't understand why. For instance, I can add a Gosh Hawk by using this code:

inst rtar 2 16 1 stpt seta va00 twin targ 1 mvto mopx mopy

But if I use the exact same code to try to insert a robin (inst rtar 2 15 1 stpt seta va00 twin targ 1 mvto mopx mopy) I get an "invalid targ" error. Can anyone explain why?

Q2:Some agents, like the foxglove, are made up of multiple parts; leaf + flower + plant. What would the CAOS code look like for injecting a complete, working foxglove into a room?


---
Optimist: the glass is half full.
Pessimist: the glass is half empty.
Engineer: the glass is twice as big as it needs to be.

 
Malkin

Malkin
Australia  
Manager


 visit Malkin's website: Malkin's page at CWiki
  4/6/2012

TARG is an odd concept to grasp, deceptively simple and powerful.

My best guess is that the robin doesn't like its 'targ' being set at 1.


My TCR Norns
 
Liam

Liam
Australia  

 visit Liam's website: Spellhold Studios
  4/6/2012

You can't target a number, no. TARG is for objects.

You can store a targ in a variable (like ov07 for example), but if you do that, you have to declare in your install script that it's a targ variable by setting it to null:


seta ov07 null


Otherwise you'll get targ problems as well.

Edit: with an install script like that, you want "targ ownr" -- target the owner agent (that's just been created), move to these coordinates.


- Liam / K'aeloree

Spellhold Studios, a Baldur's Gate II, Neverwinter Nights and Oblivion Modding Community

 
Geek2Nurse

Geek2Nurse
United States  

 visit Geek2Nurse's website: Adventures in Nornia
  4/6/2012

Hmmm. I freely admit to not having my brain wrapped around even this little script, yet...I got it off the Wiki's list of useful CAOS codes, and have managed to make minor modifications to it with some success, but I still don't completely understand it!

Liam, your response will probably make perfect sense to me in a few weeks when I've worked out more of what this stuff actually does...

I think I understand the various pieces of what you said, but I'm not entirely sure how to put them together.

The CAOS command listing I generated from my installation lists two variants of TARG; one is a command and one is an agent reference. I was thinking that in the script I'm using, TARG is the original agent being acted on by TWIN. I think I understand you to be saying TARG is a command, which would make 1 the agent, in which case the script shouldn't ever work at all, should it?


---
Optimist: the glass is half full.
Pessimist: the glass is half empty.
Engineer: the glass is twice as big as it needs to be.

 
Liam

Liam
Australia  

 visit Liam's website: Spellhold Studios
  4/6/2012

Hmm... I misinterpreted the script there, I do apologise; I assumed TWIN was a command on its own, however, the following commands are actually also part of it.

However, I'm not sure what on earth the seta is there for, it doesn't make any sense and I suspect that's what's breaking the script. To break it down:

* make this instant
inst

* randomly target an agent of this classifier
rtar 2 16 1

* stop scripts in the current agent
stpt

* this is where it stops making sense...
seta va00 twin targ 1

* move to the hand's position
mvto mopx mopy


Anyone have any insights? I'd suggest trying this:

inst rtar 2 16 1 stpt twin targ 1 mvto mopx mopy


- Liam / K'aeloree

Spellhold Studios, a Baldur's Gate II, Neverwinter Nights and Oblivion Modding Community

 
Malkin

Malkin
Australia  
Manager


 visit Malkin's website: Malkin's page at CWiki
  4/6/2012

As far as I can tell, 'twin' is the point at which the goshawk is cloned, and it's that clone that has its targ put at 1 and the clone that's moved to the hand's position.

My TCR Norns
 
Liam

Liam
Australia  

 visit Liam's website: Spellhold Studios
  4/6/2012

TWIN TARG 1 is actually just one command, apparently, looking at the CAOS guide -- TARG and 1 are the parameters of the command.

- Liam / K'aeloree

Spellhold Studios, a Baldur's Gate II, Neverwinter Nights and Oblivion Modding Community

 
Malkin

Malkin
Australia  
Manager


 visit Malkin's website: Malkin's page at CWiki
  4/6/2012

Ah, so, 'I'll have one clone of the target, please?'

My TCR Norns
 
Papriko
Peppery One

Papriko
Germany  


  4/6/2012

Liam wrote:
TWIN TARG 1 is actually just one command, apparently, looking at the CAOS guide -- TARG and 1 are the parameters of the command.

Almost. My CAOS doc says it is a command, but it returns a TARG value. If you write it alone it's like writing FROM or OWNR lonely into a line. TWIN does clone, yes, but you need to redirect that agent pointer somewhere. That's why the SETA VA00 is there.
You clone the agent, TWIN returns the TARG of the cloned object and that gets saved in the VA.

For that instant cloning of the agent you actually don't even need the VA. Just target it directly.

I'd do the code like this:
* make this instant
inst

* randomly target an agent of this classifier
rtar 2 16 1

* stop scripts in the current agent
stpt

* duplicate the agent and target the clone
targ twin targ 1

* move to the hand's position
mvto mopx mopy


btw: as it seems you are running this from the ingame CAOS line. The INST is not needed, since the command line always runs instantly.


Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis...
 
Geek2Nurse

Geek2Nurse
United States  

 visit Geek2Nurse's website: Adventures in Nornia
  4/6/2012

Ooh, ooh, I'm actually understanding this! The "seta" part of the script was the part I just couldn't figure out the reason for, so I'm glad it didn't actually make sense after all. (Who keeps up the Wiki? Maybe it should be updated, since that's where the code came from.)

Thanks, everyone!

Now, who wants to tackle helping me with question #2? ;)

Q2:Some agents, like the foxglove, are made up of multiple parts; leaf + flower + plant. What would the CAOS code look like for injecting a complete, working foxglove into a room?


---
Optimist: the glass is half full.
Pessimist: the glass is half empty.
Engineer: the glass is twice as big as it needs to be.

 
Geek2Nurse

Geek2Nurse
United States  

 visit Geek2Nurse's website: Adventures in Nornia
  4/7/2012

Dang it! The revised command works great, but only on stuff the other one worked on. I still can't make hummingbirds, robins, or pigeons, although the kingfishers are happy to have me "twin" as many of them as I want to.

This pops in 3 kingfishers:
reps 3 rtar 2 15 10 stpt targ twin targ 1 mvto mopy mopy repe


This gives me an Invalid targ error:
reps 3 rtar 2 15 3 stpt targ twin targ 1 mvto mopy mopy repe


But I've checked with CTRL-SHIFT-T, and the hummingbird's classifier is 2 15 3. So why can't I make them????? *sigh*

UPDATE: Ok, I figured it out. The agent has to actually exist in the world before it can be twinned. I was assuming it created them from agent files, but apparently it twins them from existing injected agents. After I went to the norn meso and splurged a couple of robins out of the seed splurter, I didn't get the error any more when I tried to twin robins. Now I'm gonna go make some hummingbirds! :)

Baby steps...


---
Optimist: the glass is half full.
Pessimist: the glass is half empty.
Engineer: the glass is twice as big as it needs to be.

 
Malkin

Malkin
Australia  
Manager


 visit Malkin's website: Malkin's page at CWiki
  4/7/2012

As far as the wildlife go, the kingfisher and the goshhawk are far more simple than any of the other birds. This might be why they're not working.

My TCR Norns
 
Horstj

Horstj
Germany  


  4/8/2012

@ question 2: just have a look ta the foxgloves .cos-file, it should be somewhere in the infinite deeps of your bootstrap-folder.
But basicy it workes like this:

inst
new: comp (put classifier and stuff here)
pat: dull 1 (first part, most basic almost like a SIMP)
pat: butt 2 (second part, a clicable button that calls a script)
...
pat: (whatever) n (nth part)

The positions and planes of parts are allways relative to the top right corner of the base and trying to create a part outside of the base will cause an error.
This is an exerpt from a working script that makes a compound agent (it would have been 87 lines, so I took out the parts that are all the same):

***Multi-Vend V1***

*make metavendor
inst
new: comp 2 23 10853 "multivend01" 2 0 6000
*no physics:128,no collisions:64, invisible:16, activateable:4, mouseable:2, carryable:1
attr 23
* no creature actions
bhvr 0

***Variables***
*state on or off
setv ov80 0
*category
setv ov81 0
[...]

***parts***
* Part 1 - powerbutton
pat: butt 1 "multivend01" 28 2 378 162 1 [1] 1001 1
part 1
anim [1 0]

* Part 2 - okbutton
pat: butt 2 "multivend01" 26 2 378 121 1 [1] 1002 1
part 2
anim [1 0]

[...]

* Part 12 - maindisplay, zero for startingscreen, low numbers for objects, high numbers for categorys
pat: dull 12 "multiscreenv02" 0 31 6 1

*moveit
part 0
doif mopx gt 5569 and mopx lt 5899 and mopy gt 3489 and mopy lt 3697
mvto 5800 3520
elif mopx gt 5914 and mopx lt 6251 and mopy gt 8731 and mopy lt 9083
mvto 6170 9080
else
mvto mopx mopy
endi
slow

 
Geek2Nurse

Geek2Nurse
United States  

 visit Geek2Nurse's website: Adventures in Nornia
  4/10/2012

Thanks, Horstj -- this will take some study, but you've given me a place to start! I guess getting foxgloves into my metarooms is going to take more than a one-liner from the console. :)

---
Optimist: the glass is half full.
Pessimist: the glass is half empty.
Engineer: the glass is twice as big as it needs to be.

 
Horstj

Horstj
Germany  


  4/10/2012

Do they produce seed? If they do, you could just collect some and throw them into the places where you want them, and if you're lucky they'll grow.
 
Geek2Nurse

Geek2Nurse
United States  

 visit Geek2Nurse's website: Adventures in Nornia
  4/12/2012

So far, I haven't been lucky enough to find any. :(

---
Optimist: the glass is half full.
Pessimist: the glass is half empty.
Engineer: the glass is twice as big as it needs to be.

 
Malkin

Malkin
Australia  
Manager


 visit Malkin's website: Malkin's page at CWiki
  4/12/2012

They do produce seed, try the norn terrarium seed bank to create some. :)

My TCR Norns
 
Geek2Nurse

Geek2Nurse
United States  

 visit Geek2Nurse's website: Adventures in Nornia
  4/12/2012

I finally got some. ;) I had tried the seed bank, but every time I did, it sprouted or something ate it before I could get back to my other metaroom and launch the CAOS code to copy it there. Ended up starting a new world, and it had enough foxgloves in it to have seeds I could target before they got away!

---
Optimist: the glass is half full.
Pessimist: the glass is half empty.
Engineer: the glass is twice as big as it needs to be.

 
Papriko
Peppery One

Papriko
Germany  


  4/13/2012

You could simply press enter when you see a seed. Pressing enter without typing any code into the CAOS line will repeat the last previously used line (saved per world).

Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis...
 
Geek2Nurse

Geek2Nurse
United States  

 visit Geek2Nurse's website: Adventures in Nornia
  4/13/2012

Oh, man, is THAT good to know! I've tried all the old DOS command line shortcuts for repeating previous typing/commands, and none of them worked. I just figured CAOS didn't have any. Are there others?

---
Optimist: the glass is half full.
Pessimist: the glass is half empty.
Engineer: the glass is twice as big as it needs to be.

 
bedalton

bedalton



  1/29/2020

I know that this post is ancient, but I just started picking up CAOS and I feel excited because I think I understand why the command in the initial post did not work. As the original poster figured out, it was due to the fact that there were no instances of the agent in the world. RTAR randomly targets an agent IN the world. If none exists, TARG is set to null. Your command failed because you were TWIN'ing null.
 


downloads
cobs
adoptions
creaturelink
metarooms
breeds
 
gallery
art
wallpaper
screenshots
graphics
promos
sprites
dev
hack shack
script reservations
dev resources
active projects
dev forum
 
community
links
advice
chat
polls
resources
creatchi
 
forum
bookmarks
general
news
help
development
strangeo
survivor
mycaves
log in
register
lost pw
2 online
Pankypie
C-Rex
creatures caves is your #1 resource for the creatures artificial life game series: creatures, creatures 2, creatures 3, docking station, and the upcoming creatures family.

contact    help    privacy policy    terms & conditions    rules    donate    wiki