Albian Glow-Worm convert

Development guides, discussion, and testing for Garden Box compatible agents.

Albian Glow-Worm convert

Postby malkin » Fri Jan 25, 2013 4:37 am

So the general concept here is for a critter patch which spawns critter eggs. At night time, they hatch into short-lived glow-worms like these, they crawl around, can be interacted with, and die in the morning.

I probably need to put some population checks so that we don't end up with SUDDENLY, A MILLION WORMS! come dusk. :lol:

The egg timer code:
Code: Select all
**If you've been hanging around for a bit
doif ov00 ge 5
**go die now
gsub diee
**if it's not afternoon or night time
elif time ne 3 or time ne 4
**go be dormant for a bit
gsub dorm
**if your egg is fresh and it's afternoon or night time
else
**go hatch
gsub hatch

endi

**die subroutine
subr diee

kill ownr

retn

**dormancy subroutine
subr dorm

wait rand 50 300

addv ov00 1

doif ov00 ge 5

gsub diee

endi

retn

**hatch subroutine
subr hatch
**set the place you're going to hatch from
setv va00 posl
setv va01 post
inst
new: simp 2 13 X "albianglowworm" 12 0 rand 1500 5500
attr 198
bhvr 57
elas 4
perm 60
accg 2
aero 2
fric 50
mvsf va00 va01
***movement counter
setv va20 rand 1 2
doif va20 = 1
setv ov00 51
elif va20 = 2
setv ov00 0
tick 1
**the egg should be destroyed now
targ ownr
kill ownr
retn

endm


Just a little stuck on thinking my way through the initial 'blossoming/ripening' of the egg in the patch. One of the features I was hoping to include was to make the eggs super-bouncy (but not perfectly bouncy, they'd stop eventually), but I can't logic my way through getting the egg to only hatch if they're not falling.
malkin
 
Posts: 131
Joined: Sat Feb 11, 2012 3:55 am

Re: Albian Glow-Worm convert

Postby Amaikokonut » Fri Jan 25, 2013 7:35 pm

Aww, I love this idea <: Agents that are aware of night and day are something I've been becoming more interested in.
Code looks pretty good at first glance. To handle falling, you might use something like 'doif fall = 0' as a check.
I like the idea of them being super bouncy though; might help them wedge themselves into various places of the world, too. Maybe the bounciness could start off really high and then decrease as the egg ages, to give them more travel potential but still have a chance to eventually settle. Or maybe they'd be bouncy early in the day but slow down as night draws near. Whatever works :>

I'm interested to see how this progresses!
Amaikokonut
Site Admin
 
Posts: 171
Joined: Wed Feb 08, 2012 3:34 pm

Re: Albian Glow-Worm convert

Postby malkin » Sat Jan 26, 2013 12:19 am

Part of the reason why I wanted to make them bouncy was to make the hatching area less predictable. However, if I make them bouncy, I can just see the eggs hatching somewhere on one of the 'stick-to-me!' walls, or even some of the slopey bits which sometimes give agents such trouble (yes, walk out of the hatching pad, I'm talking to you :P ). How do you help a mobile critter conquer slopes?

Is it too cruel to make just pushing and pulling kill the worms, as well as hitting? Should I make them emit a very small amount of light, or is that cheating?

Push, Pull, Hit and Pick Up scripts
Code: Select all
**********************
***Activate1 Script***
**********************
scrp 2 13 X 1
   targ from
   stim writ targ 85 2
   targ ownr
endm

**********************
***Activate2 Script***
**********************
scrp 2 13 X 2
   targ from
   stim writ targ 85 2
   targ ownr
endm

*Hit
scrp 2 13 X 3
      inst
   doif from <> null
      targ from
      doif crea targ = 1
* REDUCE Pain, Fear and Anger!
         driv 0 -0.45
         driv 10 -0.35
         driv 12 -0.35
      endi
   endi
   kill ownr
endm

**** eat script
scrp 2 13 X 12
   snde "chwp"
   stim writ from 80 1
   kill ownr
endm

**** pickup script
scrp 2 13 X 4
   targ from
   stim writ targ 18 1
   targ ownr
*only do this if not dead
   doif ov00 ne 9
      doif ov10 lt 0
         anim [0 1 2 3 4 5]
      else
         anim [6 7 8 9 10 11]
      endi
      over
   endi
endm
malkin
 
Posts: 131
Joined: Sat Feb 11, 2012 3:55 am

Re: Albian Glow-Worm convert

Postby ham5ter » Mon Jan 28, 2013 1:44 pm

I alwas missed these litle Guys in Creatures 3 and Dockingstation.

I am looking forward to use them in my worlds
ham5ter
 
Posts: 6
Joined: Tue Jan 22, 2013 7:12 pm

Re: Albian Glow-Worm convert

Postby malkin » Tue Jan 29, 2013 11:30 pm

Are there any agents out there that eat 'critter egg'? Trying to work out if my invisible eggs should be wholly invisible, or if they could serve as 'cannon fodder'. :P

Code: Select all
new: simp 1 205 X "blnk" 0 0 9000
setv name "spawn_script" 1000
sets name "sprite_file" "albianglowworm"
setv name "sprite_pose" 9

setv name "prod_fmly" 2
setv name "prod_gnus" 18
setv name "prod_spcs" X

seta va00 targ
enum 1 1 22929
   mesg wrt+ targ 1000 va00 0 0
next

*spawn
scrp 1 205 X 1000
   inst
   new: simp 2 18 X "blnk" 0 0 name "patch_plane"
   attr 208
   elas 50
   fric 50
   perm rand 45 55
   accg 2
   aero 2
   mvto _p1_ _p2_
*The patch ID is important-- if you don't copy it over, the patch plant won't realize that
*the fruit is there, and it will spawn another one, and continue spawning FOREVER.
   setv name "patch_id" mame "patch_id"
*making sure that the patch will spawn regularly
   tick rand mame "tickfrom" mame "tickto"
   doif tick eq 0
      tick 200
   endi
endm
malkin
 
Posts: 131
Joined: Sat Feb 11, 2012 3:55 am

Re: Albian Glow-Worm convert

Postby malkin » Sun Feb 03, 2013 9:28 pm

So I compile this into an agent with the appropriate auxillary files using Jagent. I put the resulting agent in the My Agents folder. I boot up Docking Station. I install Magic Words Core and the main GB. I leaf through my various GB agents in-game. I can't find this one at all. :oops: Have I missed something really obvious?
Attachments
GB_PP_Albian_Glow_Worm.cos
(4.16 KiB) Downloaded 6511 times
malkin
 
Posts: 131
Joined: Sat Feb 11, 2012 3:55 am

Re: Albian Glow-Worm convert

Postby Amaikokonut » Mon Feb 04, 2013 1:15 am

I've only glanced at it, but
Code: Select all
DS-Name "Albian Glow Worm"
should read
Code: Select all
DSGB-Name "Albian Glow Worm"
Else the game doesn't know it's a GB-agent :P
If you get an error when compiling, be sure you have the newest version of Jagent.

I haven't really given it a good look though, so let me know if that doesn't work and I'll dig deeper. Good luck; I'm quite excited to see this!
Amaikokonut
Site Admin
 
Posts: 171
Joined: Wed Feb 08, 2012 3:34 pm

Re: Albian Glow-Worm convert

Postby malkin » Mon Feb 04, 2013 5:23 am

Ah, I thought it was something that simple. :P Thank you! :D That simple fix allows me to see it in my box, unfortunately, when clicking on the cross-hairs I get the error: The injection of this agent has failed. Please contact the author for further assistance. There seems to be something wrong with the egg timer script, where I try to kill the egg after the worm has hatched, something about 'closing a block'.
malkin
 
Posts: 131
Joined: Sat Feb 11, 2012 3:55 am

Re: Albian Glow-Worm convert

Postby Amaikokonut » Mon Feb 04, 2013 11:12 am

Huh, if you let it scroll through all the text when you get the error, does it give any more detail? It does scroll a bit slowly.

In the egg timer script, at the end of the hatch routine, it looks like you need to add in an endi before the retn, to close out the "doif va66 ge 30 and fall = 0" bit.

Also (I just happened to see this because it highlighted red when plopping the script into that caos tool), in your worm timer, the "drown in water" segment that reads "doif rtyp = 8 or rtyp = 9" should read, "doif rtyp room targ = 8 or rtyp room targ = 9" . RTYP just kind of has a weird syntax to it.

You poor creature, I commend your efforts in development without the caos tool. I would never have the patience for it :P
Amaikokonut
Site Admin
 
Posts: 171
Joined: Wed Feb 08, 2012 3:34 pm

Re: Albian Glow-Worm convert

Postby malkin » Mon Feb 04, 2013 7:25 pm

Thank you so much! :D Now the eggs are generated by the patch and they fall to earth. Trouble is, they don't seem to be hatching, even if I leave them out overnight... :oops:
Attachments
GB_PP_Albian_Glow_Worm.cos
(4.23 KiB) Downloaded 6695 times
malkin
 
Posts: 131
Joined: Sat Feb 11, 2012 3:55 am

Next

Return to The Greenhouse Laboratory

Who is online

Users browsing this forum: No registered users and 1 guest