Forums » Community Projects

Pirate's Toolkit

«1234»
Jul 31, 2007 Scuba Steve 9.0 link
I'll, uhh, fix that sometime. And by fix, make it display less broken and see if I can display it only when someone is in range.
Aug 01, 2007 drazed link
I was gonna wait for one of you guys to release the updated kit for linux with require, but I couldn't wait no more... I put the line in and it worked without a problem... And I'm working on my own addons now =)

here's the steps I took...

1. rename the folder AAAufuncs to ufuncs
2. add the following to the main.lua of the addons that use ufuncs: require "ufuncs"
3. profit!!

I would suggest making this standard in the kit, and renaming AAAufuncs to just ufuncs, even on non-linux machines. If you're using the "ufuncs" library in your addon you should always make sure require is in there =)
Aug 02, 2007 samuel.penn link
I'm probably just being stupid, but this doesn't work for me (Gentoo64 as well). Where does the require "ufuncs" go? Before the declare or after it? I'm assuming it's a line by itself. Yes, I've renamed AAAufuncs to be ufuncs.

I've also tried require "addons/ufuncs/main.lua" and other combinations, but that doesn't work either. I don't see an error saying the require has failed to find anything.

btw, is there any documentation on writing addons?
Aug 02, 2007 drazed link
Sam, the `require "ufuncs"` line comes before the declare line, and on a line by itself. You need to put that line in files like addons/MakeFriends/main.lua and addons/Autonave/main.lua, not in the ufuncs/main.lua file itself. Require tells the file that it needs to have ufuncs loaded before it does the rest of the file.

If you want to write your own lua scripts I suggest going to the following 2 sites and reading through them. The first is an online lua manual, the second is the VO lua function index, which you will need to use for all of VO's triggers.

http://www.lua.org/pil/
http://www.vo-wiki.com/racecar/index.php?title=Function_Index
Aug 02, 2007 Scuba Steve 9.0 link
REQUIRE DOESN'T WORK BLARGH RAYBONDO >:|

Edit: Yeah, require still doesn't work on my machines. So much for that. Once I can rely upon it more than I can rely upon renaming it AAAufuncs, I'll put it in, but I can't even load my files at this point.

And just to be a dick, guys is just me and I already knew about require and was intending on putting in when it works properly. Did not know it works on Gentoo64 though, Drazed.
Aug 03, 2007 drazed link
OK, maybe I was wrong... seems that it works because I changed the folder name, when I removed all the "require" lines it still worked, as long as it's ufuncs and not AAAufuncs... seems gentoo64 loads the files alphanumerically backwards? Putting the require line in doesn't break anything on gentoo64 though =p
Aug 03, 2007 samuel.penn link
But drazed, I'm using Gentoo64 as well, and it doesn't work :-) I've renamed it AAAufuncs to ufuncs, and I've placed the require line in all the main.lua of the other functions, but it still don't work. So I was doing what you suggested drazed, but it doesn't work on all Gentoo64s. And yes, I originally tried it with just AAAufuncs.

Maybe it's file system dependant, though I thought that would be hidden by the OS? I could try a few more things tonight, but I'm at work now.

Thanks for the links drazed, I'll have a look at them.
Aug 03, 2007 drazed link
Just out of curiosity Sam, what type of processor you have? I'm on AMD64
Aug 03, 2007 Scuba Steve 9.0 link
The require line doesn't break anything because(as far as I know) this function does exactly when require() does now. On the upside, require() is at least declared.

function require(string)
     return nil
end

(i.e., it does nothing.)

As far as Gentoo64 being weird, well, it's being weird. I don't think, but am not entirely sure, that there was any problem with AAAufuncs on any other system.
Aug 03, 2007 samuel.penn link
Linux fenris 2.6.17-gentoo-r8 #3 SMP PREEMPT Tue Jun 26 18:12:46 BST 2007 x86_64 AMD Athlon(tm) 64 Processor 3200+ AuthenticAMD GNU/Linux
Aug 03, 2007 samuel.penn link
Okay, I think I've got it fixed. I've only tested it on the Autonav so far, but that's started working.

In the Autonav/main.lua, I've stuck:

if (not (ufuncs)) then
ufuncs = {}
end

just after the function declaration, but before the test for ufuncs.AUTO_NAVLoaded

I'm assuming that it creates enough of a ufuncs to get things working, and that it'll be filled in when ufuncs is declared for real.

I'm now going to try it on the rest.
Aug 03, 2007 samuel.penn link
The fix doesn't work for everything. For example, AlertMachine calls some ufuncs methods (well, ToggleStateToBool) as soon as it is loaded, so requires a real definition of ufuncs. Commenting this out (and just setting the status to true), allows it to work however.

Thanks to drazed for confirming that AlertMachine did still work after my fix, when he popped into the sector and started shooting my convoy :-) I was too busy checking the output and looking at the code to notice however!
Aug 03, 2007 drazed link
DISCLAIMER:

/me is NOT a pirate!!!

I shot the convoy because it shot at me first, dirty BioCom NPC's deserved it too =p
Aug 04, 2007 samuel.penn link
I'll back drazed up on that one. Convoy still gave me 750K for a single WH hop, so I've really nothing to complain about.
Aug 06, 2007 Syylk link
Little problem with cfire: "/lua cfire.open()" opens a very small GUI, and I can't figure out the text on the right side and on the bottom buttons.

It can be worked around by fiddling with GUI size, but it'd be nice to have it resizable/resized (like MakeFriends has been, at some point).

Thanks for sharing your impressive work, Steve.
Aug 06, 2007 MSKanaka link
If you want to be able to open the cfire panel from a regular chatline, add this to the cfire.lua file:

RegisterUserCommand("cfire", cfire.open)

Then you can open the panel by typing /cfire into a chatline.
Aug 06, 2007 Scuba Steve 9.0 link
Odd, Penn. On my system(Wintel XP) if you try to test a global variable for nility that does not exist then a lua error pops up and informs you that you're trying to read an undeclared variable.

Edit: Also, if (not (ufuncs)) then is the same thing as if(not ufuncs) with less parentheses. Or should be. That might be the cause of the undeclared var thing.
Aug 11, 2007 Scuba Steve 9.0 link
Oh, err, last night I updated this so that AlertMachine works again. DangerFlash has been removed because it's stupid.
Aug 13, 2007 Scuba Steve 9.0 link
Added a pair of new addons and a function(ufuncs.GetUberParent, a recursive iup.GetParent) into ufuncs.
Aug 20, 2007 JestatisBess link
So is it possible to change the time from gmt to your time zone?

BTW nice work man