Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Nighthawk

Registered:
Posts: 141
Reply with quote  #1 
can you force a specific ship (hull?) for the player at the beginning of a mission?
so far I've been able to load other ships with random IDs, but I can't find anything related to the same thing for the player.
cxfAtheus

Registered:
Posts: 334
Reply with quote  #2 
I've never seen anything that forces a hull-type. So far as I know, the only ways to force a hull-type are to yell at them until they pick the right ship, or delete all of the ship types out of the vesseldata file except the one you want. 

Actually, I don't know much about how to do this, but you could probably write a batch file (or something like that) that would pick a copy of the vesseldata that only has the hull-type you want when you run a specific mission (instead of the regular vesseldata file).

Someone else might be able to help you with that. Short of that, though, it seems like you're stuck telling them what to pick.
Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 2,990
Reply with quote  #3 
This comes up all the time. At script launch you can check the number of Homing, EMP, Mine, and Nuke torpedoes aboard. If any of the numbers doesn't match the ship you want players to use then put a big message on the main screen and abort the script.
__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
Nighthawk

Registered:
Posts: 141
Reply with quote  #4 
Quote:
Originally Posted by Mike Substelny
At script launch you can check the number of Homing, EMP, Mine, and Nuke torpedoes aboard.


....or shield strength maybe?
leaola

Registered:
Posts: 268
Reply with quote  #5 

I used shields

<if_exists name="Artemis" />
<if_object_property property="shieldMaxStateFront" name="Artemis" comparator="NOT" value="80.0" />
<if_variable name="cship1" comparator="EQUALS" value="1.0" />
<if_variable name="wave" comparator="EQUALS" value="15.0" />
<warning_popup_message message="ship one must be a light cruser only" consoles="MHWESCO" />
<end_mission />
<set_variable name="cship1" value="2.0" />

<if_exists name="Intrepid" />
<if_object_property property="shieldMaxStateFront" name="Intrepid" comparator="NOT" value="110.0" />
<if_variable name="cship2" comparator="EQUALS" value="1.0" /><if_variable name="wave" comparator="EQUALS" value="15.0" />
<warning_popup_message message="ship 2 must be a missile cruser only" consoles="MHWESCO" />
<end_mission />
<set_variable name="cship2" value="2.0" />

<if_exists name="Aegis" />
<if_object_property property="shieldMaxStateFront" name="Aegis" comparator="NOT" value="250.0" />
<if_variable name="cship1" comparator="EQUALS" value="1.0" /><if_variable name="wave" comparator="EQUALS" value="15.0" />
<warning_popup_message message="ship three must be a battleship only" consoles="MHWESCO" />
<end_mission />
<set_variable name="cship3" value="2.0" />

<if_exists name="Horatio" />
<if_object_property property="shieldMaxStateFront" name="Horatio" comparator="NOT" value="200.0" />
<if_variable name="cship1" comparator="EQUALS" value="1.0" />
<if_variable name="wave" comparator="EQUALS" value="15.0" /><warning_popup_message message="ship four must be a Dreadnought only" consoles="MHWESCO" />
<end_mission />
<set_variable name="cship4" value="2.0" />

<if_exists name="Excalibur" />
<if_object_property property="shieldMaxStateFront" name="Excalibur" comparator="NOT" value="60.0" />
<if_variable name="cship1" comparator="EQUALS" value="1.0" /><if_variable name="wave" comparator="EQUALS" value="15.0" />
<warning_popup_message message="ship five must be a scout only" consoles="MHWESCO" />
<end_mission />
<set_variable name="cship5" value="2.0" />


ryleyra

Registered:
Posts: 3,214
Reply with quote  #6 
Actually, if you destroy the ship instead of ending the mission, it will kick the ship back out to the ship selection screen. The players will then be able to select the right ship.

<if_exists name="Artemis" />
<if_object_property property="shieldMaxStateFront" name="Artemis" comparator="NOT" value="80.0" />
<destroy name="Artemis"/>

I'm also not sure the warning_popup_message will be displayed if you end the mission.

Unfortunately, this method won't work for any ship, only for the ones named in the mission. Players will be able to get around it by typing in their own name. I'm hopeful that eventually, some way will be come up with to specify a player ship without having to give the name. (Maybe by specifying slot instead)
leaola

Registered:
Posts: 268
Reply with quote  #7 
the pop up lasts long enough to see why the game ended. and if thorn ever makes it by slot I will up date my script.
Nighthawk

Registered:
Posts: 141
Reply with quote  #8 
I change the ship name by code, so it's irrelevant... however, the set of shield and weapons are unique... so I can filter the selection through that, and then set up the properties as I need them.
something I picked up from the Database course at school: sometimes there's no better unique ID than the whole thing.
also, I worked with a group of modders who coded in python, and in python it's styled to first *spawn* the thing, and then *configure it*, in two separate functions, so if the thing doesn't spawn the properties don't return a "missing object" error.
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.