Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Best way to go about this?

Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
12-15-2005 01:58
I'm writing a "programmable" robot of sorts, and by programmable I mean the owner would say "forward 3, wait 2, look left, forward 1, turn around, wave" and the robot will walk forward for 3 seconds, wait 2 seconds, turn to it's left, walk forward again for 1 second, turn completely around and then wave.

The animation and movement I can code fine, but it's getting the robot to read the directions and then execute them in proper order that's been giving me a headache. The main problem seems that I am running into stack-heap collision errors with very long sets of commands (a whole chat line worth), and was wondering if I should instead write a seperate script for each command, and then use llMessageLinked to call for each command script when it's needed, or if there isn't some better way to avoid the stack-heap errors. in general I don't like relying on multiple scripts listening for messages as I'm trying to abide by the "less listeners = less lag" rule.
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
Jokey Domela
Registered User
Join date: 27 Jul 2005
Posts: 83
12-15-2005 04:07
well the way you're inputting the directions, IE: forward 3, stop 2, etc, etc is already a nicely formatted CSV list.

llCSV2List would work nicely here. You may want to do a little data validation to make sure the user chatted the data properly. Then just loop over your list 1 index at a time...