creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
Development Forum
old
A vendor i,ve created   
Arnout

Arnout
Netherlands  


  12/11/2009

I,ve tried to create a bacteria vendor for C3/C3+DS, but in my CAOS there is 1 error, but there is no red text.
This is my cos file:

inst
** Create the Bacteria Vendor! :D
new: simp 2 23 65445 "bacteria-vendor" 7 0 1 <edit

** Hand can pick it up.
attr 199

** Sits down on platforms.
perm 60

** Does not bounce on floors
elas 0

** Does nos slide down of slopes.
fric 100

** This will give it gravity.
accg 3

** Let,s move it to a room! ;)
mvto 5000 3400

** This will move the camera to our object.
cmrt 0

** Activating script.
scrp 2 23 65445 1

** This will make our vendor Animate!
anim [0 1 2 3 4 5 6]

** Get the left position of our Vendor.
setv va00 posl

** Move the bacteria to the opposite way,
** when you click the vendor.
addv va00 30

** Get the top position of our vendor.
setv va01 post

** Another opposite thingy. :P
addv va01 10




** Let,s produce something over there!
inst
new: simp 2 32 23 "bacteria" 2 0 6999
* invisible + has boundaries + no physics (will be set in timer script once position is validated)
attr 144
* no gravity
accg 0
* status vars
seta ov00 null
seta ov01 null
setv ov02 0
setv ov03 0
***GENETIC STUFF ***
* 10mins - 30mins
setv ov10 rand 6000 18000
* make all differant ages
setv ov11 rand 1 ov10
setv ov04 ov10
subv ov04 ov11
* reporductive age %
setv ov12 rand 5 100
divv ov12 100.0
* uninfect level %
setv ov13 rand 70 100
divv ov13 100.0
* infect level %
setv ov14 rand 5 25
divv ov14 100.0
*antigen
setv ov15 rand 82 89
* toxin 1
setv ov16 rand 70 81
* toxin 1 amount 0.005 - 0.05
setv ov17 rand 5 50
divv ov17 1000.0
* toxin 2 - initial value 69 = emit nothing
setv ov18 69
* toxin amount 0.005 - 0.05
setv ov19 rand 5 50
divv ov19 1000.0
** max and min bacteria
setv ov30 60
setv ov31 40
** pose not invisible
setv ov32 1
** transfer odds
setv ov33 100
setv ov34 80
setv ov35 30


I was wanting an creature egg vendor too, and i think i will work on that one too. :)

 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  12/11/2009

What error are you getting? It helps to know where it spits one out at you and what it says.

I don't know much about programming bacteria, but something does look wrong with your vendor's install script:

new: simp 2 23 65445 "Bacteria-vendor" 2 23 65445



The last three numbers (in bold) are just a repeat of the classifier. Why is this? These three numbers are meant to indicate 1) how many sprites are in the file, 2) which frame is the starting frame and 3) which plane it sits on in the game. So you're telling it, "this object uses 2 sprites, starting at frame 23, and it sits on plane 65445(!)"

If this does not match the layout of your sprite file, that's probably what's causing your error right there.



 
Arnout

Arnout



  12/11/2009

lol, i forget that. I,ve edited it, But there is still a syntax error.
 
Papriko
Peppery One

Papriko



  12/11/2009

May I say something little? If you are going to publish it, please remove all capitals from the name of the sprite file and then make the code fitting to it. Not much, I just mean change it from "Bacteria-vendor" to "bacteria-vendor". If you don't do it will Linux users (and maybe also people on Mac, not sure) become quite angry, because it won't find the file.

Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis...
 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  12/13/2009

Does it matter if it's uppercase or lowercase, as long as it's consistent?



Okay Arnout, I pasted your code into the CAOS program to make it easier to read and I believe I've found your error. When I pasted it in, I clicked File > Refresh Syntax and the CAOS program checked the code for me. The error output window immediately posted this:

Checking 'cos1'...
Line 96: 'endm' expected, got end-of-source
Done. 1 syntax error(s) found.



(Bolded by me). There needs to be an "endm" at the end of a script to tell it where that script ends. Otherwise it just keeps reading until it hits the end of the file or something that can't go in a script, like the rscr, and gets confused.

I do recommend that you use the error output window, if you're using the CAOS program. You can find it under View > Error Output Window. It will bring up this little window which will give you a better idea of what's happening if something goes wrong.



 
Papriko
Peppery One

Papriko



  12/13/2009

Ghosthande wrote:
Does it matter if it's uppercase or lowercase, as long as it's consistent?

Yes. Don't you remember what a mess the KT.mng made?


Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis...
 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  12/13/2009

Ok - going off what Ghosthande's found, I think your installation script needs an 'endm' at the end.

My TCR Norns
 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  12/13/2009

No, not the installation script, the activate script [the section that begins with scrp 2 23 65445 1]. Install scripts don't have defined beginnings and endings because they run immediately and only once. A behavior script like an activate/eat/timer script is the only thing that needs a defined beginning and ending, because those scripts are functions that the object calls on certain events.


^ Papriko, we didn't test it with them both capitalized/uppercase. As long as capitalization is the same on both ends it would probably work, although writing names in lowercase is the best convention.



 
Arnout

Arnout



  12/14/2009

Thanks everyone, now it only needs a nice map position and then it will probaply work. :)
The place it was using now is an invalid map position

The vendor by it self is not small, it uses a CV sprite.

 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  12/14/2009

Very festive.

If you're having trouble getting it to accept the position, try using "mvsf" instead of "mvto". That'll move it to the closest "safe" location to the one you specify. Sometimes the game can be inexplicably stubborn with positioning, but this takes care of it.



 
AquaShee

AquaShee



  12/16/2009

Arnout, change the "Let's move it to a room bit to the following code:
seta va00 targ
enum 1 2 11
spas targ va00
doif ov00 = 0 and clac = 0
mesg writ targ 0
endi
next

It's from the CAOS Chaos tutorials, this way the vendor gets put in the inventory, so you don't have to worry about finding a nice room.


The Community Scribble: make (y)our own metaroom!
 


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
0 online
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