Members | Sign In
All Forums > Mission Scripting
avatar

Planets?

posted Jan 30, 2013 23:19:27 by AshleyNathanielReese
How do I insert a planet into a mission? I would like this planet to be scannable. I would like damage dealt to planet to trigger event.
page   1
7 replies
avatar
TreChipman said Jan 31, 2013 14:20:25
Planets aren't part of the game itself, but there are a ton of them in the Generic Mod, which is available here. Just unzip it into Artemis/dat/mods and you should be fine.


To do what you describe, you'd probably need something like this in your Start tag:



<create type="genericMesh" x="50000.0" y="0.0" z="50000.0" angle="45.0" name="PlanetHollywood" meshFileName="dat/Mods/Generic/models/planet.dxs" textureFileName="dat/Mods/Generic/textures/planet14.png" fakeShieldsFront="1000" colorRed="0.0" colorGreen="1.0" colorBlue="0.0" />


and then events like:


<set_ship_text name="PlanetHollywood" race="TSN" class="Planet" desc="Mostly Harmless" scan_desc="Sensors detect large amounts of Xenonite Ore" />

<event>
<if_variable name="beingHurt" comparator="NOT" value="1.0" />
<if_object_property name="shieldState" comparator="LESS" value="1000" />
(Insert your action here)
<set_variable name="beingHurt" value="1.0" />
</event>



I think that *should* work, but I haven't tested it out. Worst case, you'll have to declare the planet as an object in your vessel data file; you can see an example of three of them by searching for "UID 1001" in this file. Let me know if that helps!
[Last edited Jan 31, 2013 22:12:03]
I'm not a mad scientist. I'm an angry one. You'd be wise to fear the latter.

Visit Artemis Command!
avatar
AshleyNathanielReese said Jan 31, 2013 21:14:59
Added and tested planet object in gamemaster/module3bases. Will the event work in gamemaster mode?
thanks by the way. I cant make scan event work. Is there a condition Im missing? Do I need to include event in "start"?
[Last edited Jan 31, 2013 21:49:10]
avatar
TreChipman said Jan 31, 2013 22:15:53
You might; it also might not be working because the planet is a Generic Mesh and not a ship-- the scan code was added in 1.7 and it's not yet documented in the mission scripting docs. There's more information on how it works here
I'm not a mad scientist. I'm an angry one. You'd be wise to fear the latter.

Visit Artemis Command!
avatar
AshleyNathanielReese said Jan 31, 2013 22:42:05
it says at the bottom " it does not work for neutrals, stations, and of course generic_meshes(since science cannot target them)." Maybe in the future we will be able to scan meshes. Im going to try scripting the damage condition event tonight.
avatar
JSpaced said Feb 01, 2013 10:25:36
Here's what I am going to do for my own scannable planets:
Insert a neutral at the same point as the planet. Set an event to physically lower the neutral on the Y Axis (there's a code snippet for that, thank you Steve:)
<event> <!-- within one tic -->
<if_object_property property="positionY" name="NEUTRAL1" comparator="NOT" value="-500" />
<if_object_property property="positionY" name="NEUTRAL1" comparator="GREATER_EQUAL" value="-490" />
<if_object_property property="positionY" name="NEUTRAL1" comparator="LESS_EQUAL" value="-510" />
<set_object_property property="positionY" value="500" name="Neutral1" />
</event>

THEN use the Set Description command to change the appearance on the science console.
<set_ship_text name="Neutral1" race="M-Class" class="Planet" desc="Unexplored Planet" scan_desc="Primitive cultutre, pre-warp. Consistent with Earth Iron Age." />

THEN use the artscale property to make our neutral ship tiny, set the collision radius to 0 and finally cripple its systems using the set_object_property command OR the AI direct command.


You may have to go through and see if there's anything else to make the neutral ship a hunk of unresponsive rock, then drop your generic mesh planet on top of that and in theory: scannable planet. (I hope. I'm off to go and test this now.)

By the way if anyone comes up with anything better, I'm all ears!3
[Last edited Feb 01, 2013 10:26:59]
"We should give him the send-off he deserves. He died saving us all. Prepare a Rocket-Shed for immediate launch."
avatar
Mike_Substelny said Feb 02, 2013 02:35:43
Have you succeeded in making artscale tiny? That used to work, but it isn't working for me anymore.
"Damn the torpedoes! Four bells, Captain Drayton!"

(Likely actual words of Admiral David Farragut, USN, at the battle of Mobile Bay. Four bells was the signal for the engine room to make full steam ahead).
avatar
JSpaced said Feb 02, 2013 16:02:07
Oops, have just remembered it only affects generic meshes. Not sure then. Maybe we're talking a new race/ship type in vessel data with no speed, no weapons etc?
"We should give him the send-off he deserves. He died saving us all. Prepare a Rocket-Shed for immediate launch."
Login below to reply: