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
The-Starport

Help understanding some code

Advertise for Modelers, Programmers, Webmasters, INI Editors, Script Experts, Adventurers, Servers, or anything that has to do with a project

Post Thu Dec 02, 2004 3:22 am

Thats great, im glad some people are thinking logically, as before - some people would automatically assume NO! CANT! WONT! SHANT! NEVER! IMPOSSIBLE! I think its all very possible indeed, it just depends completly upon how the problem is looked upon.

Moaning Over

If we can establish a method to have more than 1 escort following you around then that is excellent progress, I tried it last night but never got it (will continue on it when i get home). If and probably when this is achieved, it would be important to look at different ways to trigger these events. As mention before - if we look at this in a fashion such as:

If Commodity in Cargo = True then Spawn Escort = True

When that is achieved then I believe it to be the foundation of many other possibilities. Everyone has dreamed (im sure) of being able to build a personal station, in real-time in the game. Using the same methods as we are trying as of now, this could also be achievable.

This is bound to be attracting interest by now, if other people work on this, then you have true progress, not a half baked potatoe but something that is solid and capable

Post Thu Dec 02, 2004 3:26 am

What I mean by the commodity is this: Put a new commodity into a list of commodities currently available at a certain planet or spacestation, call it Escort Pilot

When you launch to space figure the code out so that if the commodity in the cargo = true, then spawn the escort. If on the other-hand you dont have the commodity in the cargo then escort spawn = false

Hope that helps

Post Thu Dec 02, 2004 3:56 am

See now there's a point too. If you can achieve a more in depth degree of open endedness by hiring escorts, then you could take it up another notch, another step and create a freelancer bar- sometyhing I've never come across whereby instead of the ship dealer menu, you have a sword icon signifying "Mercenaries/Escorts." If that could be created, then this could create an interface whwereby you could buy an escort (who would technically for code purposes be a commodity if it'll work) and basically make the game world just that little bit better.

I love the idea of having escorts helping you out, especially if you play as a freighter transfering cargo about, or even just if you're a newbie that needs a hand finding his/her feet against would-be PVPers. Certainly the code is in there for it, just check the mission .INI files and I'm sure you can find a lot of the scripts and triggers for this kind of thing.

Thinking about it logically, it would be possible I think to create a group called "Escort" and an alignment of "Neutral" which would allow the purchased merc to attack anything that opens fire on you specifically. Also, maybe then in later updates or versions then you could have specific types of mercenary, for example Bounty Hunters, or Corsairs as sellswords, each with their own agenda and fighting style. Sure, there's bound to be teething problems, but it looks plausable and seems straightforward enough, especially if a coder is willing to try.
Using King or Juni as an example would work well given that their code is the most frequent in the game source in terms of triggers and scripts pertaining to following a character. If people could work from that source, I'd say there's a great opportunity to perfect the two escort formation and make the game that much more rewarding.

I also really like the idea of purchasing or buying your own space station- your own wee plot of space within which you could upgrade it, hire people to guard you and basically have a base of operations. I know this seems far fetched, but the key here I feel is immersion, this game shouldn't be just about blowing up your fellow man, but about Roleplaying and being rewarded for the long hours of play with more than a new pair of blasters and maybe a few salvaged commodities. (Not saying I dislike the game as is, I'm just saying that this game has the potential to be even more great than it is now!)


Edited by - Muramasa-Edge on 12/2/2004 4:02:42 AM

Post Thu Dec 02, 2004 4:11 am

I've now got Juni escorting you as well as King, and I've made them virtually indestructable by giving them a ridiculous amount of hull strength. I'm going to make it so that every so often, every 5 or 10 minutes or so, they regenerate back to full health. So basically they'll never die.
I've still got problems with the formations, I want them to drop out of formation only when you attack an enemy, and not the other way around, but I can't get this to work.
I had a quick go at the commodity idea, buying escorts, but it didn't work. I'm almost completely sure that it's possible, though, so I'll have another try later.

Post Thu Dec 02, 2004 7:49 am

Well in terms of a specific story line then perhaps you wouldnt wish your escort pilots to break form as this might slow the storyline down at certain stages. On the otherhand, if you arnt following the story line and lets say that we do get the commodity thing working, they should break form when danger has been detected.

I simply cannot wait to see if the commodity feature works out, that will be simply unbelievable and would make non-believers really believe as well for that matter

Post Thu Dec 02, 2004 8:08 am

If you're making a specific storyline you would tell the escort(s) to break formation when you get within a certain distance to the waypoint, at this point you'd also make your enemies spawn. Obviously, you can't do this with random encounters, because the enemies could turn up anywhere, at any time.
Actually, I think random encounters are turned off (there's a bit of code for it) in all the story missions, and all the npcs that you see are being told what to do in the ini file for that mission.

Post Thu Dec 02, 2004 9:25 am

I know I sounded confident above, but I'm not sure anymore whether this buying mercenaries idea is possible. Earlier I found some code saying "Cnd_Lootaquired" so I thought I'd be able to activate a trigger when you have a specific commodity. Problem is that this loot needs to be defined as "msnloot" somewhere in the mission code, so just buying a commodity from a planet couldn't work.

Another thing i noticed, in the current code, your escorts will only break formation and rejoin once, after that they will stay in formation all the time, so I need to find some way of sort of reactivating triggers, which I thought I had done, but I obviously hadn't.

Also, you're permanently stuck at rank zero, because you can never complete the first mission, so I'd need to go through the market_misc.ini to set all weps and ammo so they can be bought at rank 0, which isn't too hard, but a little tedious

I'll keep working on these things, but it's proving to be a lot more difficult than I thought it would be at first.

Edited by - Marauder on 12/2/2004 9:26:54 AM

Post Thu Dec 02, 2004 9:32 am

Sounds like some kind of loop command is required for the escorts then. The only immediate example that I can conjure up in my head relating to looping would be for example when King gives you a command.

He would give a command such as, goto x location. If however you fail to carry out his order, the process is looped so he tells you again, and again, and again.

Something in the code must be telling him to repeat this command and also in X ammount of time, Im assuming that it is indeed a looping function, perhaps if that was tracked down then maybe it could be used in one way or another for the escort problem.

Maybe....

If the buy mercenaries idea isnt going to function using the previously thought of method, then what about this method instead...

Ok, lets go back to the missions where you need to tractor beam an escape pod. When you return to the planet, the mission is triggered complete. However, if you decide to drop the escape pod before docking, a message is triggered saying something like "Tractor in the Escape Pod to Complete the Mission"

Could it be possible to keep the Escort Commodity but add a trigger in so that when you dump it in space, it spawns into an Escort? This would be less conveniant, but it could be one other possibility.

Edited by - Freedom9 on 12/2/2004 9:39:51 AM

Post Thu Dec 02, 2004 9:47 am

After a little more testing it turns out that they do still break formation the second time. For some reason they didn't before, even though I haven't made any changes. I'd still like to find a better way of telling them when to break formation, though.

If you want to try it as it is at the moment, or want to look at the code, you can download it here:

http://www.freewebs.com/marauderfl/king%20escort.zip

All jump gates/holes are unlocked, and you have Juni in a defender, and King in an Anubis escorting you.

I don't think there's any code that activates a trigger if you drop a commodity, another way of getting around this I've been thinking of is having a mercenery in the bar who you can talk to and he/she will offer to escort you, I think this could be done, and it would be pretty cool, but I'm not sure if I could make it so it costs money to hire them.
Actually, this might not work, because if you accept the mercenaries offer, it will probably make the game think you're already on a mission. and so you won't be able to take any other missions.


Edited by - Marauder on 12/2/2004 10:02:10 AM

Post Thu Dec 02, 2004 9:55 am

I'll take a look at this. At the very least, it might be a more elegant route to OpenSP... which I might find rather useful, as current OpenSP solutions are all broken very badly by my mod

Post Thu Dec 02, 2004 10:01 am

Thats an interesting idea regarding the Bar. I wouldnt have thought of that.

If the NPC in the bar was faction status dependant (I think the magority of them are) then that might work well. For example if its a bounty hunter guy then you would need to have a friendly status with the bounty hunters in order to talk to him.

Its much more limiting than previous thoughts but that would be an excellent start.

[in reply to previous edit @ marauder

Yeah your right, it would assume your on a mission.

When your doing missions in the game, sometimes they will send alert fighters to aid in your task of completing the mission. Perhaps it could be worked out so that rather than these fighters returning to base, you could instead assume command of them. Its a fairly lightweight idea though and if it did work, you would need to tie-in some kind of storyline or downside to make it in any way relevant or purposefull


My brain needs to recharge now but I'll keep thnking






Edited by - Freedom9 on 12/2/2004 11:46:48 AM

Post Thu Dec 02, 2004 1:11 pm

I wouldn't know how to do anything that alters the random missions that you pick from the bar, I think that they must be hardcoded, so I doubt we could make fighters that come during these missions stay with you.

What I need is some ideas of how the player could choose to have an escort, at the moment they just spawn when you launch, but it would be better if they spawned only if the player performs a certain task, like your idea of buying a commodity. At the moment, though, I can't think of anything.

Post Thu Dec 02, 2004 2:44 pm

What we do know, is that you can spawn escorts at the point of launch from manhatten. Can you script this so that it will only occur at a particular planet or station?

If so...

Create three basic outpost stations, call it The Rookie Base, The Veterens Base, the Aces Base (no bar, no ships, no commodities, no nothing). When you dock and then leave from these stations you will be greeted by a number of escort pilots, of which are dependant upon what base you went to

Perhaps that might work, but there still needs to be a way of deducting cash from the player. For all good sides there must be a bad side

[Continued

Ah!! heres a further idea.

In order to gain access to each station, you need to perform a task before you are allowed access, once this task is achieved, you are granted access to that particular station and are allowed the escorts for free.

The stations should be located in the most god-awful places, so that its not in the players interests to take constant advantage of the facility.

Tasks...

If level = 10 then the rookie base unlocks?
if level = 30 then the vet base unlocks?
if level = 60 then the ace base unlocks?


Edited by - Freedom9 on 12/2/2004 3:01:11 PM

Post Fri Dec 03, 2004 3:42 am

About the idea of unlocking bases when you reach a certain rank, I can't do this, because at the moment I can't get the player to go any higher than rank 0. And in single player you can only go up to rank 38 (I think), and this mod could never be made to work in multi-player.

I could possibly get the idea of talking to someone in the bar to (sort of) work by spawning ships if you reject the mission. Then it won't think you're already on a mission. But if you accept the mission you would mess it all up, so once you've clicked on the mercenary, you wouldn't have any choice but to have him/her as an escort.

About the spawning when leaving planets/bases, I was thinking of doing something like this when it was just King escorting you. So if you went to Planet New London he would upgrade his ship and weps, then upgrade again if you went to New Tokyo, then New Berlin, then maybe Freeport 9.

Edited by - Marauder on 12/3/2004 3:45:36 AM

Post Fri Dec 03, 2004 3:58 am

Hey... for MP... you might want to check out the existing Random Mission code. It's a scary, convoluted mess by comparision with SP, though, and would involve some deep delving into common.dll (which is where, I understand, a lot of the definitions for certain mission interactions are).

Return to Help Wanted/Available Section