Questions on Campaign writing

Need help testing contributed art or code or having trouble getting your newest additions into game compatible format? Confused by changes to data formats? Reading through source and wondering what the developers were thinking when they wrote something? Need "how-to" style guidance for messing with VS internals? This is probably the right forum.
Post Reply
Baerwulf
Star Pilot
Star Pilot
Posts: 5
Joined: Sun May 23, 2004 11:16 am

Questions on Campaign writing

Post by Baerwulf »

I am currenty writing a campaign for vegastrike and I am stuck on a few points with regard to how the vegastrike engine works

1. How does the engine select which base you are at when you dock with a planet or ship? I want to override the generic base with a campaign specific base and/or create new planets and ships that are campaign specific

2.Can new planets/jump points / capital ships / nebula / wormholes etc. be added to a system created by a system file on the fly (i.e. at a particular campaign node)? and do these remain persistent once created?

3. Can the player be teleported to a new system while docked at a base (capital ship)? without undocking, ie during a campaign node the capital ship you are docked on jumps to a new system?
dandandaman
Artisan
Artisan
Posts: 1270
Joined: Fri Jan 03, 2003 3:27 am
Location: Perth, Western Australia
Contact:

Post by dandandaman »

Great to hear there's a campaigner out there :-)

Now, I've given these answers on the assumption that you are actually scripting these in python, and have a workable knowledge of python. If this is incorrect, don't worry, we can implement this stuff if needed :-) In that case just consider it overview ;-)

In the order of easiest to answer:

2)
They can be created on the fly, though you will probably need to add a new script to campaign_lib.py to achieve this for jump points. You can look at the LaunchWingmen script to see how to do this for regular units, and can use the reference here <http://vegastrike.sourceforge.net/wiki/ ... ndings:CPP> to see how to do it for jumppoints :-) Note that although the functions described in the reference are c++, they are exported and accessible by python scripts.

They may be persistant upon creation, though likely not. Either way, I believe we have the framework in place to make it so should it be required :-)

3)
Yes, they can be. However, it has not been tried by me before, so you may encounter some glitches. Notably the fact that the game is paused while you are docked may prevent the 'teleportation' happening until you undock (instantaneously then, but the delay may be noticable). Whether or not you will need to teleport both the docked and dockee units I'm not sure. You can find the function JumpTo in the reference here <http://vegastrike.sourceforge.net/wiki/ ... ngs:Python>.

1)
I will need some time to look into this ;-) If anyone can jump the gun ahead of me, go for it :-) I think priv did manage to achieve something like this, but not sure.

Hope that helps!

Dan
"Computers are useless. They can only give you answers."
-- Pablo Picasso
dandandaman
Artisan
Artisan
Posts: 1270
Joined: Fri Jan 03, 2003 3:27 am
Location: Perth, Western Australia
Contact:

Post by dandandaman »

1)

This is possible, but requires the system you wish to edit the planet for be static (for units it doesn't matter, they're easy, but for planets it does). For planets you will also need to add an entry to units.csv

Anyway, apparently the way it goes is this:
+ The base scripts are stored in data4.x/bases/

+ Each planet has a script labelled according to its texture name (ie texturename_day.py, texturename_night.py, texturename_sunset.py etc)
What this means is that each planet you want specific control over will require its own texture. Not too big a task (as I assume the number of planets for which this control is needed is not major), as you can almost just copy and paste the old python files for the planet type, but you will also need to edit units.csv to add that planet type. This is easy if you know what you're doing, but obviously is not a long term solution to such a problem. (If anyone knows of a better way that we can do this, let me know!)

+ Each unit type has a script labelled according to its unit and faction name (unitname_factionname.py, or ignoring factions unitname.py)
Here the trick will be to create a python file that checks the name of the unit you are docked to to see if it's the campaign one. If it is then do something special, else do the same as every other unit.

Basically, these scripts are simply run when the player docks. We can't force a different script to load at will, only make sure that the script VS looks for contains what we want it to. However, it might be useful in future to change this...

Hope that helps. If not, at least it's a start. Just post again if more is required! (I know my explanations aren't the most clear, so ask away :-) )

Dan
"Computers are useless. They can only give you answers."
-- Pablo Picasso
Post Reply