New mission: Scanner

This forum area is to share and discuss modding projects, models, music and other modding activities of Pioneer. Please use the 'Alpha Mods' or 'Beta Mods' folders to upload your files in the Pioneer section in the download area.
Post Reply
Starblade
Private
Posts: 9
Joined: Tue Feb 12, 2013 12:23 pm

New mission: Scanner

Post by Starblade »

I have been thinking about this mission type for quiet some time. I really think 90 % of this can be accomplished with code reused from other missions, mainly Assassination. The goal is to scan another ship for illegal goods. I do not know Lua or C otherwise I would have done it myself. Even so here is the pseudo-code if anyone wants to take a shot at this. Like I said most of this can be done using code from other missions to generate the mission, spawn the target ship + cargo and the police. Have fun :-) Mission type : Cargo Scanner Generate Mission, messages and GUI; ((using the same code for other mission, Assassination as a template?))Test if scanner equipment is present; ((using the same code for Delivery or Taxi to check if player has free space or enough cabins, but this time if scanner is part of the player's ship))If { scanner is not present; then Message "You are not equipped for this mission"; Aborts mission; Else Mission details are added as other mission;}Once in Target system generate Target ship to be scanned and cargo ((or this is done when the mission is accepted??)Commence scanning;If { cargo == legal; then Message "Mission Completed"; credits added; End Of mission;}Commence scanning;If { cargo == illegal; then spawn police; (( using the same script as when player fires near a station, but now police hostile to the smuggler, not to the player)) smuggler hostile to police; police hostile to smuggler; policed neutral to player; Message "Mission Completed"; credits added; End Of mission;}=================================================================================***Another variant of the mission Cargo Scanner**** *** The difference is that this mission is given by the Police from the Police screen only , has a higher probability that cargo is illegal and leads to a bigger reward if smuggler ship is destroyed. Smuggler ship should also be better equipped for combat or perhaps have more shields, better hull**** Generate Mission, messages and GUI __from the Police Screen__;Reward can be money OR clean criminal record OR police will pay/clean a fine;Test if scanner equipment is present;If { scanner is not present; then Message "You are not equipped for this mission"; Aborts mission; Else Mission details are added as other mission;}Once in Target system generate ship to be scanned and cargo __with 80 % changes cargo is illegal__ or perhaps cargo is always illegal ;Commence scanning;If { cargo == legal; then Message "Mission Completed"; credits added; End Of mission;}Commence scanning;If { cargo == illegal; then spawn police; smuggler hostile to police; smuggler hostile to player; police friendly OR neutral to the player; credits added or clean police record or fine is paid; Message "Mission Completed"; End Of mission;} (im not sure if the below can be already implemented in the game, it forces combat and player must hang around to collect more money)If { cargo == illegal AND player destroys smuggler ; or police destroys smuggler while player in system (not hyperdriving) ; Message " We have stopped the flow of illegal goods. Thanks for your help. Here is a bonus: Mission Credits = Mission Credits*2" Police returns to base; End Of mission;} 
fluffyfreak
Private
Posts: 1292
Joined: Sun Nov 27, 2016 12:55 pm

RE: New mission: Scanner

Post by fluffyfreak »

You pseudo code isn't far off being the Lua that would be required :) there is a reason that it's known as one of the simplest and easiest languages to use.
Starblade
Private
Posts: 9
Joined: Tue Feb 12, 2013 12:23 pm

RE: New mission: Scanner

Post by Starblade »

Im not a programmer even if i work in IT but know the basis of programming, flowcharts, etc. I do not know Lua, but i really hope someone who knows can pick up this pseudo code (since you say it is not far from the actual code required) and add the parts that are already done for other missions and assemble it. If someone implements this, i may have another mission (even missions) type planned for the future.
Post Reply

Return to “Pioneer Mods”