creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
Development Forum
old
Vendor Not Injecting   
Steelfoot

Steelfoot



  10/24/2009

So since I can't seem to scrounge up a copy of the old Calm Balm Vendor by MNB, I decided that it would be a fun project for myself to make a very simple vending machine. Unfortunately, I can't seem to get the thing to install. The error I'm given is as follows:

Sorry, the injection of this agent failed. Please contact the author for further assistance.

Script 12 23 742 1
Invalid command at token "scrp"
... ic 100 setv ov61 40 @ scrp 2 25 21 12 lock addv ov70 ...


Here's my CAOS so far.

*generate vendor object
inst
new: simp 2 23 742 "violetpot" 1 0 5000
attr 199
perm 60
elas 0
fric 100
accg 3

* vend script
scrp 2 23 742 1
inst
snde "zpop"
new: simp 2 25 21 "calmbalm" 0 0 598
attr 199
bhvr 48
accg 2
perm 64
aero 3
elas 10
fric 100
setv ov61 40
*nom nom nom
scrp 2 25 21 12
lock
addv ov70 1
doif from <> null
snde "drnk"
targ from
driv 12 -.34
chem 155 .15
chem 154 .05
chem 129 .15
endi
targ ownr
doif ov70 = 1
pose 1
elif ov70 = 2
pose 2
elif ov70 >= 3
kill ownr
endi
endm

* Collision sound for potion
scrp 2 25 21 6
snde "dr10"
endm

rscr
enum 2 23 742
kill targ
next


When I attempt to inject the script directly from the CAOS editor, I'm given a syntax error at the line "scrp 2 25 21 12." That's the only line it seems to take issue with.

So, um... Yeah. Anyone know? I must be blind or something, this has to be something simple, it always is with programming.

 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  10/24/2009

I see it. It looks like you're missing an "endm" at the end of the activate 1 script. It's taking issue with that line because it thinks you're starting another behavior script while you're still inside th activate 1 script.


 
Steelfoot

Steelfoot



  10/24/2009

That definitely helped since it's no longer giving me syntax errors, but it doesn't spawn for some reason! When injecting the agent both from the CAOS app and the game itself, nothing happens. Thankfully, it's not displaying error messages or the failure message, but instead it's just not doing anything.

Thanks for helping me thus far!

 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  10/24/2009

I believe this is because you need to tell it the coordinates that it's supposed to appear at. This goes both for the vendor's install script and the activate 1 script to tell the object it vends where to appear.


 
Steelfoot

Steelfoot



  10/24/2009

That definitely helped me there, it injects and everything now, save for another problem:

Runtime error in agent 2 23 742 script 2 23 742 1 unique id 3084
Invalid map position (9288.864258, 515.000000)
... 3 elas 10 fric 100 {@}mvto va00 va01 setv ov61 40


Va00 and va01 are set to the top left of the vendor. I'm thinking that it's trying to inject the item between two points on the map or something, because I cannot get my cursor in that position no matter how I try. Is there a way to round those variables? Failing that, is there a way around this?

Thanks for all your help Ghosthande, you're jumping through hoops for me and I appreciate it. :3

 
Papriko
Peppery One

Papriko



  10/24/2009

I would guess the food tries to put it's center on that position. It is the top left corner of your agent, so the borders of the - what gets vended? food? - are overlapping with the ceiling or wall next to the vendor.

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

Ghosthande


 visit Ghosthande's website: Breeders Beware
  10/24/2009

No problem Steelfoot. :D

Try using MVSF instead of MVTO. That will place it in the nearest position to your coordinates that is "safe" for the agent to appear.



 
Steelfoot

Steelfoot



  10/24/2009

At the moment, this is what my code looks like:

*generate vendor object
inst
new: simp 2 23 742 "violetpot" 1 0 5000
attr 199
perm 60
elas 0
fric 100
accg 3
mvsf 6090 9060

* vend script
scrp 2 23 742 1
setv va00 post
setv va01 posl
inst
snde "zpop"
new: simp 2 25 21 "calmbalm" 0 0 598
attr 199
bhvr 48
accg 2
perm 64
aero 3
elas 10
fric 100
mvsf va00 va01
setv ov61 40
endm
*nom nom nom
scrp 2 25 21 12
lock
addv ov70 1
doif from <> null
snde "drnk"
targ from
driv 12 -.34
chem 155 .15
chem 154 .05
chem 129 .15
endi
targ ownr
doif ov70 = 1
pose 1
elif ov70 = 2
pose 2
elif ov70 >= 3
kill ownr
endi
endm

* Collision sound for potion
scrp 2 25 21 6
snde "dr10"
endm

rscr
enum 2 23 742
kill targ
next


I'm using mvsf instead of mvto in all possible applications. Instead of the previous error mentioned, it gives a similar error in the exact same location telling me that it could not find a safe location, as follows:

Failed to find safe location (9176.922852, 6090.000000)
... 3 elas 10 fric 100 {@}mvsf va00 va01 setv ov61 40


Papriko, it's supposed to vend Calm Balm. Since MNB's variant of the Agent appears to be MIA I'm building a replacement for it as practice. Apparently, I'm a bit rusty--that or CAOS has changed a lot since C1.

And by the way, I eventually intend to make something more useful than this out of this, like a soda machine or something. All this work for a good soda for my norns.

 
Papriko
Peppery One

Papriko



  10/24/2009

I'm just curious, but where do you take the coordinates from?

Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis...
 
Steelfoot

Steelfoot



  10/24/2009

The vendor's spawn coordinates are in the Docking Station vendor room, in the empty space in the bottom left corner. A little high up in the empty space there, next to the translucent dome on the device with the tentacles, but it drops down immediately after.

The coordinates for where the item is supposed to spawn are at the top left of the vendor itself.

 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  10/24/2009

It looks like you have X and Y reversed. At the top you set va00 as post [Y] and va01 as posl [X], but tell it to mvsf to va00 va01 [which is Y X]. Who knows where it's trying to put it, it's using the coordinate X as coordinate Y and vice-versa! I think if you tell it to mvsf va01 va00 instead it will work just fine.


 
Papriko
Peppery One

Papriko



  10/24/2009

You mean the Comms Room? Then you can also try these coordinates:
mvsf game "CreatorX" game"CreatorY"


Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis...
 
Steelfoot

Steelfoot



  10/24/2009

Aye, it's done now. Fully functional, complete with a silly sound for vending and it even pops the calm balms out of the top with some velocity!

Thanks guys! Just sent it to get approved by the site admins.

EDIT: It's approved. Credit to you all for helping me out!

 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  10/24/2009

Yay, congrats!


 


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