Project Needs Python Help!

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

Moderators: tillias, Jennos, peteyg

Project Needs Python Help!

Postby tillias » Mon Nov 05, 2007 3:37 am

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
Attachments
1.jpg
Last edited by tillias on Mon Nov 05, 2007 3:40 am, edited 1 time in total.
God bless you!
User avatar
tillias
Black Hole Hunter
 
Posts: 238
Topics: 42
Joined: Tue Jan 24, 2006 10:37 pm
Location: Russian Federation, Voronezh

Share On:

Share on Facebook Facebook Share on Twitter Twitter Share on Digg Digg

Postby tillias » Mon Nov 05, 2007 3:39 am

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!
User avatar
tillias
Black Hole Hunter
 
Posts: 238
Topics: 42
Joined: Tue Jan 24, 2006 10:37 pm
Location: Russian Federation, Voronezh

Postby Dilloh » Mon Nov 05, 2007 5:06 am

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.
User avatar
Dilloh
Elite Hunter
Elite Hunter
 
Posts: 1149
Topics: 25
Joined: Mon Aug 14, 2006 8:56 am
Location: Black Forest, Germany

Postby tillias » Mon Nov 05, 2007 5:59 am

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!
User avatar
tillias
Black Hole Hunter
 
Posts: 238
Topics: 42
Joined: Tue Jan 24, 2006 10:37 pm
Location: Russian Federation, Voronezh

Postby Dilloh » Tue Nov 06, 2007 5:23 am

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.
User avatar
Dilloh
Elite Hunter
Elite Hunter
 
Posts: 1149
Topics: 25
Joined: Mon Aug 14, 2006 8:56 am
Location: Black Forest, Germany

Re: Project Needs Python Help!

Postby lacy1809 » Fri Mar 08, 2019 11:13 pm

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!
lacy1809
Atmospheric Pilot
Atmospheric Pilot
 
Posts: 1
Joined: Fri Mar 08, 2019 11:12 pm

Re: Project Needs Python Help!

Postby shadowmane20 » Sat Mar 09, 2019 12:31 pm

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.
shadowmane20
Trader
Trader
 
Posts: 26
Topics: 5
Joined: Sun Feb 10, 2019 4:12 pm



Return to Star Trek Universe

Who is online

Users browsing this forum: No registered users and 2 guests