Project Needs Python Help!

Discuss the Star Trek mod(s) for the Vega Strike Engine

Moderators: tillias, Jennos, peteyg

Post Reply
tillias
Black Hole Hunter
Posts: 238
Joined: Wed Jan 25, 2006 5:37 am
Location: Russian Federation, Voronezh
Contact:

Project Needs Python Help!

Post by tillias »

Hi!

After more then 1,5 years of collecting Trek-3dModels, fixing, arming and other stuffage we started working over dynamical missions for VegaTrek.

I've no knowledge of Python at all so I ask some help in creating our first mission.

To our convinience I've painted mission plan:

1. When mission starts, player's ship is placed into point (X0, Y0, Z0) in terms of 3d-space.

2. Somewhere in space there is located some planet ( coordinates X1, Y1, Z1 ).

3. Planet has radius Rs ( abbr. Radius small )

4. The goal of mission is to put player's ship very close to planet ( under radius Rb )

--
The best analogy is scanning mssion. E.g. in order to scan some object, you need to get to some critical distance to object. Then mission is accomplished
You do not have the required permissions to view the files attached to this post.
Last edited by tillias on Mon Nov 05, 2007 10:40 am, edited 1 time in total.
God bless you!
tillias
Black Hole Hunter
Posts: 238
Joined: Wed Jan 25, 2006 5:37 am
Location: Russian Federation, Voronezh
Contact:

Post by tillias »

So is it possible to make such a python-mission, which scans how close to target object ( let it be some planet ) player's ship is and if it is close enough there appear some poup-up mesage, like "Mission is accomplished"?
God bless you!
Dilloh
Elite Hunter
Elite Hunter
Posts: 1149
Joined: Mon Aug 14, 2006 3:56 pm
Location: Black Forest, Germany

Post by Dilloh »

From my limited knowledge I assume such a kind of mission already exists - like you mentioned the scan mission (which itself is a cleansweep without enemies).

Cargo missions within campaigns work the same way, I guess having no cargo would result in a mission success while "just" in orbit.
tillias
Black Hole Hunter
Posts: 238
Joined: Wed Jan 25, 2006 5:37 am
Location: Russian Federation, Voronezh
Contact:

Post by tillias »

Dilloh wrote:From my limited knowledge I assume such a kind of mission already exists - like you mentioned the scan mission (which itself is a cleansweep without enemies).

Cargo missions within campaigns work the same way, I guess having no cargo would result in a mission success while "just" in orbit.
Can you point me to module's sources please?
God bless you!
Dilloh
Elite Hunter
Elite Hunter
Posts: 1149
Joined: Mon Aug 14, 2006 3:56 pm
Location: Black Forest, Germany

Post by Dilloh »

Note that I'm always refering to PR1.2 modules, but there should be a lot of similarities.

/modules/cargo_mission.py

Code: Select all

def __init__ (self,factionname, numsystemsaway, cargoquantity, missiondifficulty, creds, launchoncapship, time_to_complete, category,jumps=(),var_to_set=''):
cargo_mission doesn't seem to have a distance var, so it either needs to be added or we'll try another kind of mission which is already there.

/modules/cleansweep.py

Code: Select all

def __init__(self,numsystemsaway, num_points,distance,creds,jumps,donevar,minships,maxships,encounterprob,capshipprob,faction, forceattack,canrunaway):
An example on how to use this in a static campaign:

Code: Select all

'cleansweep',(0,8,50,0,('Gemini/Newcastle','Gemini/Metsor',),rf.name+"_mission",1,2,.9,0,['unknown','retro','pirates'],1,1),
Note I might be totally wrong with "distance" being the scanning distance. You should try to create a cleansweep mission which has no foes in first case, and modify it long enough until you have a suitable state.
lacy1809
Atmospheric Pilot
Atmospheric Pilot
Posts: 1
Joined: Sat Mar 09, 2019 6:12 am

Re: Project Needs Python Help!

Post by lacy1809 »

Hello All,

I am newbie to python. And i'm practicing at home to see the youtube videos.
I was trying to use a=zeros(5) in python, but getting the error. Please check it and help me to solve

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'zeros' is not defined

Please help me with this or suggest me any of the python tutorial where i can learn the deep concept of python.

Thanks in advance!
shadowmane20
Trader
Trader
Posts: 26
Joined: Sun Feb 10, 2019 11:12 pm

Re: Project Needs Python Help!

Post by shadowmane20 »

You could just dig in to the documents for this game. Specifically working with scrypting missions, campaigns and quests. There's tons of python used here, and most of the python scripts in this game have helpful comments to tell you what stuff does.
Post Reply