PR1.2 mission scripting - plunder and rescue missions?

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
Dilloh
Elite Hunter
Elite Hunter
Posts: 1149
Joined: Mon Aug 14, 2006 3:56 pm
Location: Black Forest, Germany

PR1.2 mission scripting - plunder and rescue missions?

Post by Dilloh »

Hello everybody,

I'm currently writing some campaigns for PR1.2, and I know how to implement the most important mission types like e.g. bounty missions:
'bounty_leader',(0,0,0,False,6,'kilrathi',(),priv.name+"_mission",'','grikath',False,'','grikath',["com message"])
I know that there are other missions, namely e.g. defend missions and plunder missions (those are the "bag a merchant and deliver the cargo to us" missions).

Can anybody tell me how the line for those missions would/should look like, so I can implement it into a mission loader?

Thx in advance!
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

The way to do it is to open the python file that you want the mission from.
defend.py wrote:class defend (Director.Mission):
def __init__ (self,factionname,numsystemsaway, enemyquantity, distance_from_base, escape_distance, creds, defendthis, defend_base,protectivefactionname='',jumps=(),var_to_set='',dynamic_flightgroup='',dynamic_type='', dynamic_defend_fg='',waves=0, greetingText=['We will defeat your assets in this battle, privateer...','Have no doubt!']):
So you can see the "defend" is the class name to put in quotes, then a tuple containing the arguments to init.
'bounty_leader',('kilrathi',0,2,5000,10000,0,'refinery',(), priv.name+"_mission",'','',0,["com message"])

I might be wrong in some of the specifics... look in the "initrandom" and the ".mission" files for what the specific arguments mean. Also, compare the names to other missions that have examples (look what bounty_leader uses dynamic_fg for)

It's the exact same format as the mission computer, dynamic_mission and mission_lib uses... So you will have to look there for examples.
generateDefendMission() in dynamic_mission.py
Dilloh
Elite Hunter
Elite Hunter
Posts: 1149
Joined: Mon Aug 14, 2006 3:56 pm
Location: Black Forest, Germany

Post by Dilloh »

Thanks again ace :D I sometimes wouldn't know what to do without you.

Yeah, I already looked up the relevant files and tried to put something together, ending up in the game crashing.

The problem is, my mother language is not exactly english, nor python.

Thanks for the tips however, I now know that I'm on the right way.
Post Reply