Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.

To get the latest in Freelancer news, mods, modding and downloads, go to

Lightning guns... How do I make one?

The general place to discuss MOD''ing Freelancer!

Post Thu May 24, 2007 11:12 am

Lightning guns... How do I make one?

Hey folks...

A few nights ago I got the idea of making a lighting gun!

My idea is to use the tractor beam effect as the projectile!
But... This didn't seem to be as easy as I thought!

I did do my searches here on lancers to find something that might give me a lead... No succes!

So if there's anyone out there who could either point me to a post that might give me an answer, give me an idea how to or even write the code I will be most thankfull!

I don't bother to post the code I have made so far since it's not working! (Then I wouldn't have made this post either... Hehehe)

Hope someone here can help me...

Thanks in advance!

Post Thu May 24, 2007 11:29 am

I assume you are primarily talking about the weapon effect.
I recently modded a repair turret with such an effect. I used a hidden effect in FL (maybe from the beta, whatever):

nickname = lightning_eff
effect_type = EFT_WEAPON_PROJ
vis_effect = gf_bolt04
vis_generic = gf_bolt04

This is how it looks: Click here

You also see the flaw in this video, the projectile is a very long beam that does not stop on impact.. (hm thinking about it I should have experimented with it a little longer, maybe vis_beam instead of vis_generic would work in a different way.. or do missing impact effects affect the lifetime of the beam?..not sure)

Edited by - w0dk4 on 5/24/2007 12:29:14 PM

Post Fri May 25, 2007 1:18 pm



i thought unsigned varibles could not be used!!
how did you make a repair turret?!?!?!!?

and i just saw that other vid with the osiris and mobile respawn.....

how do you do these things!?!? what mod are these in???

Edited by - sona1111 on 5/25/2007 2:22:16 PM

Post Fri May 25, 2007 8:57 pm

thats some nice guns son hooooweeee

Post Sat May 26, 2007 8:35 am

Of course, you now have us all curious as to how to make a repair turret. ;P

My current utilization of a Repair ship - something with no guns, and 5 cargo space, but 800 Nanobots / Shield batteries. Look at it. The poor thing is longing for a repair turret. ;_;

Edited by - fox Unit 01 on 5/26/2007 9:35:43 AM

Post Sat May 26, 2007 10:29 am

you could do that with missles shooting nanobots, and a jetlike thing, ect ect ect.

please tell.

Post Sat May 26, 2007 12:35 pm

hi, I did this with just some modifications to the FLHook source (also the other stuff shown on YouTube)

I may release them on the FLHook Developer forum as developer mods so you can use them, but right now I have not got the source with me.

PS: All those things are implemented and in use on the Hamburg City Server (HC optional Mod)

Edited by - w0dk4 on 5/26/2007 1:35:11 PM

Post Sat May 26, 2007 4:00 pm

does that work in sp? i have no experience with mp or flhook

Post Sat May 26, 2007 5:46 pm


I've always thought a repair turret should "repair" .
Do you have any information you can post on that?

Post Sat May 26, 2007 6:50 pm

>does that work in sp? i have no experience with mp or flhook

No, just multiplayer as I coded it for my server.
What I would find more interesting is the mobile respawn shown here: Click here

Post Sat May 26, 2007 8:41 pm

w0dk4, I like your style.


Post Sat May 26, 2007 11:05 pm

Any idea on how the mobile respawn works? I figure they move a custom base to the same location as the player carrier when someone wants to launch. To that end, I've been toying with FLHook's source and what's been holding me up is arbitrarily moving stuff on the fly. I think things actually do move according to the server (by calling pub::SpaceObj::Relocate), but the client doesn't think it moves and so I end up seeing no change in the base's location. It's also possible that I'm attacking this in a totally wrong direction.

Post Sun May 27, 2007 6:02 am

Yeah I also tried it the nasty way in the first place.. moving the base on the server before the client launches, but that didnt work for me as well (though I never got the Relocate function to work)

You have to do it with the launch_pos@CEqObj IMPORT from common.dll.
It gets called during the player launch procedure and this call determines the location where the client will spawn (unless it is not a docking ring your launching from, you need to make dockrings stations on the client so that it works there as well)


Post Sun May 27, 2007 5:04 pm

Alright, I'm still missing something here. From what I've gathered, CEqObj is a struct that provides a bunch of information about a particular object in space. My problem is that I can't call CEqObj::launch_pos() directly (the game crashes), so I'm guessing that I need to get a CEqObj pointer to the base in question and then call launch_pos of that:

--- originally I tried this:

Vector v; Matrix m;
launch_pos(v, m, baseID);

--- but I think I need something like this:

CEqObj *ptr = some_function(baseID, other_parameters);
Vector v; Matrix m;
ptr->launch_pos(v, m, int);

Am I correct in thinking this? And if so, what shoud some_function be? While I'm at it, I'm kind of a noob at importing dll functions. I tried duplicating the same style used elsewhere in common.h:

struct IMPORT CEqObj
virtual bool launch_pos(class Vector &, class Matrix &, int) const;

but it doesn't want to cooperate. Maybe it's not a struct at all (a class?), or maybe I'm missing something else? I'm at a loss on this one, so any guidance would be most appreciated.

Another question, what on earth is the third argument of launch_pos? In common.dll t's listed as an integer, so originally I figured it would be the hash of either the base or the station. However, since that doesn't seem to work I'm no longer sure.

Also, launch_pos is listed as a const in common.dll; if this is true, I'm not sure why using the function would change anything (though it obviously must, since I've seen it in action).

One final question for now, where you do call launch_pos? I figured it would go in either BaseExit or PlayerLaunch (most likely the latter), but since you have the answer already I might as well ask. Thanks for everything, by the way; this is really amazing stuff.

Post Sun May 27, 2007 5:31 pm

As I said I dont currently have the source with me unfortunately. But I can surely post a working mod with source included once I have it back.

Short notes: You need the right class pointer so that you can call the member function. If you hook the launch_pos Import in server.dll, you still must use assembly to make it work right (look at the damage hooks in HkCbDamage.cpp, once you have figured out the naked style function calling, you must push the ecx register and then call your own function so you have access to the class)

The launch_pos function is called withing the PlayerLaunch function. Its a bit tricky to implement it without the server crashing and my solution is not professional at all ..
But well it works so I dont bother anymore

Return to Freelancer General Editing Forum