Members | Sign In
All Forums > Mission Scripting
avatar

Map Extension idea. Missions with multiple Grids.

posted Jan 28, 2013 23:54:13 by lucas99801
So I've been checking out the mission editor and began contemplating the idea of a multi-grid mission. What I mean by that is, if the Artemis approaches the right side of the Grid (Column 5), when they reach the edge, they enter the left side of a new grid (Column 1).

Each time this happens, the grid would be re-generated, all enemies in the initial grid would be removed, and the new grid would be populated.

I semi-borrowed this idea from Capt. Xavier Wise based on his awesome Warp point in the mission he is currently developing.

What I'm wondering is, would there be a way to make this scripting any easier? Currently the only way I see it to be done is to have a separate creation and death event for each enemy, and a failsafe to progress the creation of the sector in case that enemy was destroyed.

In the code below, Each enemy is given a death variable (0.0 = living, 1.0 = destroyed by player/other). The location counter acts as a step function to coordinate events, and each event increments the counter according to what should occur next.

I included the Location stepper because I couldn't think of any other way to populate a grid based on previous events, if any of you awesome people have ideas as to how I could clean this process/idea up I would appreciate it!

Here's a dropbox link to the file.

https://dl.dropbox.com/u/10193809/web/MISS_Map_Extension.xml
<mission_data version="1.7" background_id_arme="">
<start name_arme="Start">
<create type="player" x="50000" y="0" z="50000" name="Artemis" />
<set_difficulty_level value="5" />
<set_skybox_index index="9" />
<big_message title="Unnamed mission" subtitle1="by Unknown Author" subtitle2="adventure for Artemis 1.7" />
<set_timer name="start_mission_timer_1" seconds="10" />
<set_variable name="chapter_1" value="1" />
<set_variable name="Location" value="1.0" />
<set_object_property property="energy" value="4000" name="Artemis" />
<set_variable name="aDead" value="0.0" />
<set_variable name="bDead" value="0.0" />
<set_variable name="cDead" value="0.0" />
<set_variable name="dDead" value="0.0" />
</start>
<folder_arme name_arme="Sector1" id_arme="87ef0b47-a402-4f10-9144-e1a98186a3a3" expanded_arme="" />
<event name_arme="CreateA" id_arme="36ca335d-3a1e-41f4-a17b-c350f1e8b419" parent_id_arme="87ef0b47-a402-4f10-9144-e1a98186a3a3">
<if_variable name="aDead" comparator="EQUALS" value="0.0" />
<if_not_exists name="A" />
<if_variable name="Location" comparator="EQUALS" value="1.0" />
<set_variable name="Location" value="2.0" />
<create type="enemy" x="58400.0" y="0.0" z="22800.0" angle="0" name="A" hullID="2000" fleetnumber="-1" />
</event>
<event name_arme="CreateAFailsafe" id_arme="b2936cfd-a8a4-4a74-b8b5-2f2cf60ffdc8" parent_id_arme="87ef0b47-a402-4f10-9144-e1a98186a3a3">
<if_variable name="aDead" comparator="EQUALS" value="1.0" />
<if_not_exists name="A" />
<if_variable name="Location" comparator="EQUALS" value="1.0" />
<set_variable name="Location" value="2.0" />
</event>
<event name_arme="DeathA" id_arme="665444a8-327c-43b8-a1df-c1a90baddaad" parent_id_arme="87ef0b47-a402-4f10-9144-e1a98186a3a3">
<if_variable name="Location" comparator="EQUALS" value="2.0" />
<if_not_exists name="A" />
<set_variable name="aDead" value="1.0" />
</event>
<event name_arme="East" id_arme="cb32e85f-03be-486b-9081-4835289297b8" parent_id_arme="87ef0b47-a402-4f10-9144-e1a98186a3a3">
<if_object_property property="positionX" name="Artemis" comparator="LESS" value="200.0" />
<if_variable name="Location" comparator="EQUALS" value="2.0" />
<set_variable name="Location" value="11.0" />
<destroy name="A" />
<set_object_property property="positionX" value="99800.0" name="Artemis" />
</event>
<folder_arme name_arme="Sector2" id_arme="f560ce73-6d17-4460-acf6-be4138b4d9df" expanded_arme="" />
<event name_arme="CreateB" id_arme="4a207900-00e2-4be7-a3d7-328d69134fff" parent_id_arme="f560ce73-6d17-4460-acf6-be4138b4d9df">
<if_variable name="bDead" comparator="EQUALS" value="0.0" />
<if_not_exists name="A" />
<if_variable name="Location" comparator="EQUALS" value="11.0" />
<set_variable name="Location" value="12.0" />
<create type="enemy" x="4000.0" y="0.0" z="46000.0" angle="0" name="B" hullID="2000" fleetnumber="-1" />
</event>
<event name_arme="CreateBFailsafe" id_arme="2b7f8531-762d-45be-8067-95da93251793" parent_id_arme="f560ce73-6d17-4460-acf6-be4138b4d9df">
<if_variable name="bDead" comparator="EQUALS" value="1.0" />
<if_not_exists name="A" />
<if_variable name="Location" comparator="EQUALS" value="11.0" />
<set_variable name="Location" value="12.0" />
</event>
<event name_arme="DeathA" id_arme="3c7b7eff-5263-46b5-afec-474657367cb6" parent_id_arme="f560ce73-6d17-4460-acf6-be4138b4d9df">
<if_variable name="Location" comparator="EQUALS" value="12.0" />
<if_not_exists name="B" />
<set_variable name="bDead" value="1.0" />
</event>
<event name_arme="West" id_arme="ed5d96ab-4581-417b-84a4-ae375b2bd367" parent_id_arme="f560ce73-6d17-4460-acf6-be4138b4d9df">
<if_object_property property="positionX" name="Artemis" comparator="GREATER" value="99900.0" />
<if_variable name="Location" comparator="EQUALS" value="12.0" />
<destroy name="B" />
<set_variable name="Location" value="1.0" />
<set_object_property property="positionX" value="200.0" name="Artemis" />
</event>
</mission_data>
[Last edited Jan 28, 2013 23:55:15]
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
page   1
6 replies
avatar
Mike_Substelny said Jan 29, 2013 01:00:13
I did this two years agao with "Truce or Consequences," a mission in which Artemis must chase a super-powerful Skaraan across many sectors. Destroying one set of objects and creating another works pretty well. When the players enter the new sector the server updates instantly but it takes a few seconds for the consoles to see the new map.

To accomplish this, "Truce or Consequences" has 2,663 lines of code that took four months to write and debug. A handful of people got to play it before Artmis 1.60 came out and broke all the mission scripts that existed at that time. I keep meaning to go back and re-write it - - - now I could probably do it in three months, if only I had three months to kill.
[Last edited Jan 29, 2013 01:03:00]
"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 Jan 29, 2013 01:23:07
That would be some major dedication.

The destruction and creation does work well, keeping track of which ships have been destroyed is the obnoxious part. I'll keep playing with this idea, and if I ever spend enough time to match your 2,663 I'll let you know, haha.
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 Jan 29, 2013 02:07:37
You can keep track of destroyed ships, stations, and whales using variables. But there's nothing you can do about mines. The script has no way of knowing which pre-existing mines have been destroyed, or which new mines were laid by players.
"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
TreChipman said Jan 29, 2013 13:08:17
I had a pretty ambitious project going on here (note: I haven't tested it in 1.7, but IIRC, it worked in 1.66); the idea was to create a open world of 20+ maps, many of which would contain pickup missions. All of the map data is stored in a database and compiled by a script. Now that we can actually use variables for values, I should dust it off and play around with it some more.
I'm not a mad scientist. I'm an angry one. You'd be wise to fear the latter.

Visit Artemis Command!
avatar
lucas99801 said Jan 29, 2013 23:00:52
Yeah, I got death tracking down with variables, was jut hoping i could do it in an easier form. And Tre I will check that out and see I'd there's anything I can chime in on
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 26, 2013 04:39:23
Mike, popping back in this thread to say, "After writing a Jump Drive snippet that consisted of 1899 lines I understand how daunting your 2000+ line mission must have been. Mine took at least 10 hours of programming/debugging and that was with the help of the mission editor and code generation via Excel. You, sir, are a trooper."
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: