Page 2 of 2

Posted: Mon Aug 11, 2008 2:39 am
by Aury
:D I'm certainly going to have to use these soon!

Posted: Mon Aug 11, 2008 3:59 am
by Periculi
:lol:

(filter (sysGetNodes) node (eq (count (sysGetStargates node) ) 2))

Which returns SE as well thanks to Debug gate. :evil:

Posted: Wed Aug 13, 2008 8:50 pm
by obsidean
I tried making an ore scanner using your code, but it's simply either not finding the asteroids, or not showing the nearest one. According to Periculi the code works just fine on his machine, but all it does on mine is output the "ore found" message and that's it. If you guys have any idea how to make it work let me know.

There's the extension I made
http://neurohack.com/transcendence/foru ... php?t=1723

It might have something to do with my windows version but the only things that's given it any problems before was system26.

Posted: Sun Aug 17, 2008 6:56 pm
by Retroactive
I won't pretend that I understand the script all that well, but is there any limit in the code that would prevent the AI from using a script like this? Say, on a police ship that would fly out from Commonwealth stations to meet incoming vessels and scan them for contraband at close range? Or shifty privateers who only attack you if your armor and shields are below a certain level?

Posted: Sun Aug 17, 2008 7:11 pm
by Betelgeuse
Nope enemy ships can also use this kind of stuff. (anywhere you can put code you can use filter)
For things like police ships I would give them a timed event so they would check every so often.

But I do like the idea of having privateers going after weak ships or even you could make wreck looting or destroying ships.

Posted: Sat Aug 23, 2008 1:22 pm
by Betelgeuse
a new use for filter that I just used in my tinkerer plus one mod.

to test if every element in a list is true for a condition you just

(eq (count (filter myList element condition)) (count myList))

and now you have a conditional to test if every element in a list passes a condition 8)

Posted: Sat Sep 27, 2008 7:10 pm
by F50
I would like to use (sysFindObj) and or (filter) to find a planet/star with a certain name, how would I go about doing that?

Posted: Sat Sep 27, 2008 7:30 pm
by Betelgeuse

Code: Select all

(filter (sysFindObj gplayership "t") spaceobject (eq (objGetName spaceobject) name)  
where name is the name you are looking for would return a list of everything with that name
or use sysGetObjectByName. (that would seem easier)

Posted: Sat Sep 27, 2008 11:30 pm
by F50
Betelgeuse wrote: or use sysGetObjectByName. (that would seem easier)
There's a special function for that? :oops:

Here I thought I would have to figure out sysFindObj or do something a bit more difficult. Thanks, and sorry.