creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
Development Forum
old
Coding a plant--CAOS troubles   
Ghosthande
Prodigal Sock

Ghosthande
United States  

 visit Ghosthande's website: Breeders Beware
  11/30/2008

I am having some trouble with a fruiting plant I'm trying to make. The CAOS tool keeps telling me there are syntax errors, but I can't figure out what the problem is. This is what the code looks like:


inst
new: simp 2 23 60667 "tulu_pumpkin" 1 0 500
bhvr 0
attr 16
perm 100
emit 8 10
fric 100
mvto 98638 1092

scrp 2 23 60667 9
tick 0
gsub grow

subr grow
setv va00 posl
addv va00 32
setv va01 post
addv va01 9
new: simp 2 21 60668 "tulu_pumpkin" 5 1 501
attr 195
bhvr 8
perm 100
elas 0.5
fric 80
aero 80
mvsf va00 va01
lock
reps 4
doif pose ne 5
wait rand 40 80
addv va00 1
pose va00
endi
repe
doif pose = 5
unlk
endi
retn

scrp 2 21 60668 8
lock
snde "hit_"
stim writ from 44 1
stim writ from 97 1
unlk
reps 6
new: simp 2 11 60669 "tulu_pumpkin" 2 6 502
bhvr 16
velo rand 10 25 rand 0 -10
pose rand 1 2
enum 2 8 60668
repe
kill ownr
endm

scrp 2 11 60669 12
lock
snde "chwp"
stim writ from 79 10
chem 10 10
kill ownr
endm

rscr
enum 2 23 60667
kill targ
enum 2 21 60668
kill targ
next
enum 2 11 60669
kill targ
next
scrx 2 8 60668 8
scrx 2 11 60669 12


What am I doing wrong? It seems interesting that it's always beginnings and ends of things that are the problem, but I'm not sure why they are problematic or how I could do things differently. Any thoughts?



 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  12/1/2008

Have you tried using the unlk command at the end of each script, after the repe?

My TCR Norns
 
RisenAngel
Sanely Insane

RisenAngel

Manager


 visit RisenAngel's website: The Realm
  12/1/2008

It still might not work after this, but I do believe this might help:

retn
endm

scrp 2 21 60668 8


~ The Realm ~
Risen Angel's Creatures Blog


 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  12/1/2008

Adding an endm at the end of the subroutine fixed the error at the beginning of the hit script, but the other errors are still there; adding unlk's doesn't seem to help any. Hmm.


 
RisenAngel
Sanely Insane

RisenAngel

Manager


 visit RisenAngel's website: The Realm
  12/1/2008

This might help a little.


setv va00 posl
setv va01 post

reps 6
new: simp 2 11 60669 "tulu_pumpkin" 2 6 502
bhvr 16
velo rand 10 25 rand 0 -10
pose rand 1 2
mvsf va00 va01


~ The Realm ~
Risen Angel's Creatures Blog


 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  12/2/2008  1

Aw geez. Did you know there is actually an option on the View menu to bring up an Error Output Window which tells you exactly what the problem is?! I just found it by mistake just now. I think I've fixed the syntax errors now. :\


[edit] Hmm, okay, not sure what to do about this. I changed the way the plant works a little because it just didn't make much sense the way I had it. I thought I'd use the sort of animation that you use for toys, the typical anim[X X X] arrangement, but when I click on the plant (I've got it hand-operated right now for ease of testing) it gives me an error that says "Runtime error in agent 2 4 60667 script 2 4 60667 1 unique id 12962
Anim change failed - on part 0 which has base 0
... stim writ from 13 1 {@}anim [1 2 3] wait 2 new: simp ... "
I know there's a problem with the animation command but I'm not sure what the problem is exactly. Here's how the operation script runs right now:

scrp 2 4 60667 1
stim writ from 13 1
anim [1 2 3]
wait 2
new: simp 2 21 60668 "tulu_pumpkin" 5 1 501
attr 195
bhvr 8
perm 100
elas 0.5
fric 10
aero 10
mvto 468 9219
endm


I've checked other objects that do work correctly and can't see what I could have done wrong or anything that I have left out. Why is it giving me an error message?


[edit] I've fixed it. I'm not really sure how, but I did. Some kind of numerical problem. Think it works okay now.



 
Rascii
Caves Dweller

Rascii

Administrator


 visit Rascii's website: Creatures Caves
  12/18/2008

Meh.

Use the new new code tags!!

:P

Or does everyone prefer using the quote tags?


- Rascii
 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  12/18/2008

I'm not sure what the difference is?


 


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
1 online
RisenAngel
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