Members | Sign In
All Forums > Mission Scripting
avatar

How to implement dropping "loot"

posted Apr 19, 2013 15:06:55 by zthumser
First off, I just started playing with the mission scripting last weekend, so if I ask something stupid, I apologize.
Here's the goal: When a particular ship dies, I want to leave an anomaly at that location. The problem is, if the ship's non-existence is my condition to trigger the event, then it's gone as a reference. I don't see how I can "capture" something's position as a persistent variable; I could create the anomaly anywhere then move it to the object, but the object is already gone as a condition. Unless <set_relative_position name2="object1" distance="0" angle="0.0" name1="object2" /> would use object2's last known location, but I don't think so.
I thought maybe I could continuously update the object's position to the enemy, but have it at a y-value of 100000, effectively "above" the battlefield, then upon the enemy death just drop it straight down to y=0, but again, won't set_relative_position update the anomaly to the enemy's y-value?
What's the best way to get the effect I'm looking for? Thanks.
page   1
12 replies
avatar
Mike_Substelny said Apr 19, 2013 17:14:07
Have a generic object maybe even an invisible one, follow the ship around. Do this by using set_relative_position constantly. Then, when the ship no longer exists the object will stop moving. Create the anomaly on top of the generic object and destroy the generic object.

You could even make the generic object look like an anomaly, with bits poking out of the ship's hull. You could even name it "Anomaly."

Of course once you've got that you don't even need the anomaly. When the players get close destroy the object and give them energy (or torpedoes, or whatever).
"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
zthumser said Apr 19, 2013 18:10:23
I see. I like it, thanks. Yeah, it really doesn't need to be an anomaly, that just seemed like a good way to do it. I need to understand better how to use generic objects, how they show up on the map, how to set appearance/invisible, etc. That's one of the sections of the scripting that I haven't really tackled yet.
Follow-up question(s): Is having a constantly executing event something to be avoided, when possible? Will it cause performance issues; is it better to add a short timer when possible? If I have multiple events triggering constantly, will they interfere? Or is this something that's totally fine and I don't need to worry about it? Thanks.
avatar
Mike_Substelny said Apr 19, 2013 18:22:01
Is having a constantly executing event something to be avoided, when possible? Will it cause performance issues; is it better to add a short timer when possible? If I have multiple events triggering constantly, will they interfere? Or is this something that's totally fine and I don't need to worry about it?


I do it all the time. I don't think the game cares. The downside is that it makes debugging very difficult, since the F7 check for what actions are being triggered is flooded with the recurring action(s).
"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
lucas99801 said Apr 22, 2013 08:07:01
F7 check?
Hosting a Mumble (Murmur) server @ tsnfenrir.no-ip.org
Having trouble connecting to the TeamSpeak channel: http://tsnfenrir.no-ip.org/ts3
Helm Script for Numerical heading input: https://dl.dropbox.com/u/10193809/ArtemisHelmFSW.zip
Twitter: @lucas99801
Facebook: /lucastarnold
avatar
Mike_Substelny said Apr 22, 2013 11:07:17
While your script is running you can press F7 and the main screen will cycle through the latest events triggered, the values of some variables, and the status of your timers.
"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
lucas99801 said Apr 22, 2013 11:09:21
That's extremely useful!
Hosting a Mumble (Murmur) server @ tsnfenrir.no-ip.org
Having trouble connecting to the TeamSpeak channel: http://tsnfenrir.no-ip.org/ts3
Helm Script for Numerical heading input: https://dl.dropbox.com/u/10193809/ArtemisHelmFSW.zip
Twitter: @lucas99801
Facebook: /lucastarnold
avatar
martinvsamuelsson said Apr 22, 2013 13:58:26
Wow, how could I have missed that?!
makes things a bit easier :P
avatar
Mike_Substelny said Apr 22, 2013 14:06:32
Another trick for your generic object: if you don't want the players to see its position symbol on their scanners then set its color to r=0, g=0, b=0. That makes it black.
"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
lucas99801 said Apr 22, 2013 15:07:12
Russ, it looked like Zach had already set the color to black, but since it was tracing on top of the enemy it was still visible. Red may be a better option?
Hosting a Mumble (Murmur) server @ tsnfenrir.no-ip.org
Having trouble connecting to the TeamSpeak channel: http://tsnfenrir.no-ip.org/ts3
Helm Script for Numerical heading input: https://dl.dropbox.com/u/10193809/ArtemisHelmFSW.zip
Twitter: @lucas99801
Facebook: /lucastarnold
avatar
zthumser said Apr 22, 2013 17:05:27
So, it worked okay. A very dark blue might actually work better than a pure black, as that's the background of science and LRS. It doesn't really conflict with an existing ship, but if said ship cloaks it creates a very subtle "tell" if you're looking closely. Naming the object something like " " (a set number of spaces) lets you have a named object whose name is completely invisible on all screens. Is there a way to set what kind of icon it gets on science and LRS, or am I confined to the small open circle?

Edit: Oh, and the F7 thing was incredibly useful news to me, too.
[Last edited Apr 22, 2013 17:06:16]
avatar
lucas99801 said Apr 22, 2013 17:10:32
I've created on object where only the name is visible on science, I'll have to see how i did that..
Hosting a Mumble (Murmur) server @ tsnfenrir.no-ip.org
Having trouble connecting to the TeamSpeak channel: http://tsnfenrir.no-ip.org/ts3
Helm Script for Numerical heading input: https://dl.dropbox.com/u/10193809/ArtemisHelmFSW.zip
Twitter: @lucas99801
Facebook: /lucastarnold
avatar
lucas99801 said Apr 22, 2013 17:28:22
Okay, upon playing the mission again, it's not that the object is invisible, just that the apparent circle is at an extremely reduced size, I'm assuming the size of the circle given is relative to the size of the dxs mesh.

<create type="genericMesh" x="19900.0" y="1500.0" z="47522.0" angle="270" name="Assault Team 1" meshFileName="dat\drone1.dxs" textureFileName="dat\artemis_illum.png" />
Hosting a Mumble (Murmur) server @ tsnfenrir.no-ip.org
Having trouble connecting to the TeamSpeak channel: http://tsnfenrir.no-ip.org/ts3
Helm Script for Numerical heading input: https://dl.dropbox.com/u/10193809/ArtemisHelmFSW.zip
Twitter: @lucas99801
Facebook: /lucastarnold
Login below to reply: