Members | Sign In
All Forums > Mission Scripting
avatar

examples of use - genericMesh and monster?

posted Dec 09, 2011 23:26:51 by DrTwitch
would anyone be willing to supply an example of how to use the genericMesh? I can't see much in the example missions...

I was hoping for someone to maybe have a create example

maybe an asteroid with a spin and color?

what would a shielded asteroid look like?

hasfakeShieldsFreq?

There was also an attribute for hullRace that i can't figure out.

and i realllly would like to know what the monster would work like. I am guessing it is basically another ship? but who does it behave?
---- ---- ----
here come the drums
page   1 2 next last
24 replies
avatar
Vorus said Dec 10, 2011 04:11:47
To use a genericMesh as an asteroid for example, it should be like this:

<create type="genericMesh" x="1000" y="0" z="1000" meshFileName="dat/asteroid.dxs" dat/textureFileName="asteroid.png" hullRace="Asteroid" hullType="Made of Rock"/>

Now, this will create an asteroid, using the mesh and texture I pointed to, and it will be named "Asteroid Made of Rock". So, if you wanted it to be asteroid shaped, but use Kralien ship textures, you;d just change the texture to:

textureFileName="dat/2A_diffuse.png"

And if you wanted it to claim to be a Kralien asteroid, you'd change the HullRace to:

HullRace="Kralien"

And so on. The mesh and texture names must be the path to those files, and the hullRace and hullType can just be any text. So, you could just as easily have it say "I'm an asteroid, stupid-head" if you wanted to. It's just going to show up as "OBJECT" on LRS and Tactical screens, but SCI will be able to see its real name.

I don't know what the ColorRed, Green, and Blue do, they don't affect the actual color of the object, nor its icon color. (Maybe they don't do anything yet, or I just missed it.) Nor have I messed with the shield things yet. I would assume that since they are "fake" shields, the object won't really have shields, but it will appear to have them according to SCI, but I'm not really sure.

I don't really know of a good way to make it spin. I have made planets spin, but it's a REALLY long and ugly block of code. I know of a THEORETICAL way to make things spin, but I've never been able to get it to work. I have the feeling Mike Substelnby has, and he probably thinks its easy, but that's why he's so much better at mission writing than I am. :P

As for making a monster, I'm not sure that would actually work, since the monster doesn't just use a single piece of mesh, it's actually several copies of a piece, and they rotate around each other. Plus, the monster has special AI too, that I don't think we have access to yet.



<EDIT> Gah! I JUST NOW noticed that we actually can create monsters. I was wondering how Mike did it in the Pegasus Passage. Sweet!
[Last edited Dec 10, 2011 04:21:52]
-----------
Khomerex nal Khesterex

The unofficial Artemis Wiki, your best source for Artemis Information
avatar
Mike_Substelny said Dec 10, 2011 07:34:06
You can make generic meshes spin by putting values in the three variables pitchDelta, rollDelta, and angleDelta.

AngleDelta is on the same plane as Artemis steering, so if you put a value here the mesh rotates like a ship turning (i.e. north is up). Put a little something in pitch and/or roll and the mesh will have an inclination (i.e. north is at some other angle).

The colors red, green, and blue affect the wedges displayed on long range scan. By mixing values in all three you can make the wedge any color. So if you want to chase purple and orange blips across the sector you can do it.
"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
Vorus said Dec 10, 2011 14:00:39
You can make generic meshes spin by putting values in the three variables pitchDelta, rollDelta, and angleDelta.

Woah, I missed those too! I should really read the documentation slower. There's also a pushRadius, is that what I think it is, like for making the interaction area larger or smaller?

The colors red, green, and blue affect the wedges displayed on long range scan.

I tried making it all blue, and and I didn't see any difference. The icon is supposed to change? Just on LRS, or everywhere?
[Last edited Dec 10, 2011 14:00:49]
-----------
Khomerex nal Khesterex

The unofficial Artemis Wiki, your best source for Artemis Information
avatar
DrTwitch said Dec 10, 2011 20:59:44
going to have to confirm an issue with colors on my system.

i just get a purpleish color on LRS and all consoles. aloe the object name gets covered up by the circle icon :(

i also can't seem to make the
pitchDelta
rollDelta
angleDelta
function (i am presuming that this is a spin in place option)
using the asteroid.dxs mesh.

have not tested the push radius yet.
---- ---- ----
here come the drums
avatar
ThomRobertson said Dec 11, 2011 19:41:03
hmm. The mesh and texture of a genericMesh is SUPPOSED to come from the specific mission directory, not /dat. This is an oversight on my part, that I'll fix soon.

The icon is supposed to change? Just on LRS, or everywhere?


Yes, on the main screen tactical and LRS, and the client LRS and tactical views. If it's not, please let me know.
Creator of Artemis
avatar
DrTwitch said Dec 11, 2011 22:31:22
hmm. The mesh and texture of a genericMesh is SUPPOSED to come from the specific mission directory, not /dat. This is an oversight on my part, that I'll fix soon.



but i LOVE that one - i like grabbing items out of the default directory as more objects and images are added to the main dat library.

I actually wish that the sound files worked that way as well, i liked playing the alert sound and other things.
---- ---- ----
here come the drums
avatar
TreChipman said Dec 12, 2011 00:53:33
Yes, I'd keep it the way it is currently, and let mission designers access mission-specific models/sounds/whathaveyou via something like "textureFileName=/Missions/MISS_whatever"; that way you won't have to re-upload commonly used resources that are already present in the game.
I'm not a mad scientist. I'm an angry one. You'd be wise to fear the latter.

Visit Artemis Command!
avatar
DrTwitch said Dec 12, 2011 03:07:58
whadda ya say Thom?
can we leave it "broken"?

---- ---- ----
here come the drums
avatar
DrTwitch said Dec 12, 2011 03:20:57
about colors for genericMesh object markers...

Yes, on the main screen tactical and LRS, and the client LRS and tactical views. If it's not, please let me know.


in our hands (v1.55)
created these objects. (note they appear OK,

<create type ="genericMesh" x="89200" y="-100" z="50150"
name="Object1"
angle="90"
meshFileName ="dat/asteroid.dxs"
hullRace="Asteroid"
hullType="Made of Fire"
textureFileName="dat/fire.png"
blocksShotFlag="1"
pushRadius ="0"
pitchDelta="45"
rollDelta ="45"
angleDelta ="45"
artScale ="0.1"
ColorRed=".9"
ColorGreen =".9"
ColorBlue=".9"
hasFakeShldFreq ="0"
scale ="2"
/>

<create type ="genericMesh" x="89400" y="100" z="50250"
name="Object2"
angle="45"
meshFileName ="dat/fireship1.dxs"
hullRace="Largish"
hullType="Debris"
textureFileName="dat/fire.png"
blocksShotFlag="0"
pushRadius ="0"
pitchDelta="2"
rollDelta ="2"
angleDelta ="2"
artScale ="1"
ColorRed=".1"
ColorGreen =".1"
ColorBlue=".1"
hasFakeShldFreq ="1"
scale =".5"
/>

I attached images, the LRS and Tactical of all stations (as well as the VIS corner scan) show a purplish default color. i hope i am just doing something wrong. (the pitch, roll and angle dont seem to work) (i threw "scale" in, in the vauge hope that i could start making variations of planets, no such luck.




---- ---- ----
here come the drums
avatar
Vorus said Dec 22, 2011 23:58:24
Am I doing something wrong here? I can't seem to get the spinning to work. I've tried values of 1.0 and 30, but the thing just sits there

<create type ="genericMesh" x="74000" y="250" z="11500" meshFileName="dat/Missions/MISS_RoutineChaos/ItB_Planet.dxs" textureFileName="dat/Missions/MISS_RoutineChaos/planet5.png" hullRace="Arid" hullType="Moon" angleDelta="30" artScale="12.0" pushRadius="1000"/>
-----------
Khomerex nal Khesterex

The unofficial Artemis Wiki, your best source for Artemis Information
avatar
Mike_Substelny said Dec 23, 2011 00:52:52
Vorus, you need to make them separate statements. Fortunately I am working with some mesh code right now so I can give you an example. The following is a special effect for a new doomsday weapon I'm giving the bad guy in "Truce or Consequences." Here I have made it into stand alone code in the start block. Normally you would put this in an event block triggered by certain circumstances. It's a quick effect that plays in a few seconds. This start block is all you need to see it in action.

<start>
<create type ="player" x="98000" y="0" z="85300" name="Artemis" angle="85"/>
<create type ="genericMesh" meshFileName="dat/asteroid.dxs" textureFileName="dat/nebula1.png" colorRed="1" x="79200" y="-100" z="85300" name="T"/>
<set_object_property name="T" property="artScale" value="6"/>
<set_object_property name="T" property="angle" value="1.505"/>
<set_object_property name="T" property="rollDelta" value="2"/>
<direct name="T" targetName="Artemis" scriptThrottle="25"/>
<direct name="T" targetName="Artemis" scriptThrottle="25"/>

<create type ="genericMesh" meshFileName="dat/asteroid.dxs" textureFileName="dat/nebula1.png" colorRed="1" x="78600" y="100" z="85300" name="U"/>
<set_object_property name="U" property="artScale" value="5"/>
<set_object_property name="U" property="angle" value="1.505"/>
<set_object_property name="U" property="rollDelta" value="2"/>
<direct name="U" targetName="Artemis" scriptThrottle="25"/>
<direct name="U" targetName="Artemis" scriptThrottle="25"/>
<create type ="genericMesh" meshFileName="dat/asteroid.dxs" textureFileName="dat/nebula1.png" colorRed="1" x="78200" y="100" z="85300" name="V"/>
<set_object_property name="V" property="artScale" value="4"/>
<set_object_property name="V" property="angle" value="1.505"/>
<set_object_property name="V" property="rollDelta" value="2"/>
<direct name="V" targetName="Artemis" scriptThrottle="25"/>
<direct name="V" targetName="Artemis" scriptThrottle="25"/>
</start>

It requires no files other than those that come with Artemis, and it's a pretty terrifying thing to see on your forward view screen!

I'm having a bit of trouble with getting it to pitch and roll. Those functions seem to work fine while stationary, but I'm still working on getting the effect to work when the object is in motion.
"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
Mike_Substelny said Dec 23, 2011 00:56:09
Thom, the map icon colors changed (and had facings) when I was working with the beta software. In the production software everything is represented by pink circles.

It would be nice if we could select between facing (wedge) or circle map icons.
"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
Vorus said Dec 23, 2011 02:43:15
Vorus, you need to make them separate statements.

Darn it, I was thiiiis close to trying that. I started typing the second statement, and then I stopped, thinking to myself, "Wait, my genericMesh doesn't have a name, that can't be the right way to do this." Thanks, I figured you'd bail me out.

Also, your code blocks remind me of the penultimate mission in the game Homeworld, sounds very cool.
-----------
Khomerex nal Khesterex

The unofficial Artemis Wiki, your best source for Artemis Information
avatar
Vorus said Jan 01, 2012 01:12:40
Did you ever get your doomsday weapon to work? I'm trying to make a moving asteroid, and I can get it to turn, roll, and pitch just fine, but the dumb thing won't MOVE anywhere. It sounds like you got yous no move, so I don't see why mine won't.

<create type ="genericMesh" x="74000" y="0" z="24500" meshFileName="dat/asteroid.dxs" textureFileName="dat/asteroidTexture.png" hullRace="Small" hullType="Asteroid" name="Asteroid"/>
<direct name="Asteroid" targetName="player" scriptThrottle="25"/>


I've tried doubling up tho direct command like in your example, in case that was intentional on your part, I've tried giving it a topSpeed value first, everything I can think of, the stupid thing just stares at me . . .


<EDIT> Even more annoyingly, copying and pasting your code into my mission results in exactly what it should, a big black ball of death that crashes into me. (It does fly a bit oddly, skirting the edge of the map before hitting me) So why won't mine move? Clearly, Artemis likes you better. :P
[Last edited Jan 01, 2012 01:26:32]
-----------
Khomerex nal Khesterex

The unofficial Artemis Wiki, your best source for Artemis Information
avatar
Martok42 said Jan 03, 2012 03:57:12
Um, not that I have any actual experience messing with Generic Meshes, (yet, anyway) but is it possible that you need it to say <direct name="Asteroid" targetName="Artemis" scriptThrottle="25"/> instead of 'player'? Or whatever the player ship is named?
A vital mission, impossible odds and a ruthless enemy, what more could we ask for?

Follow the Star Trek, Into The Breach mod for Artemis: NegativeZone
Login below to reply: