Members | Sign In
All Forums > Mission Scripting
avatar

Other Races as Allies

posted Mar 13, 2013 06:05:54 by lucas99801
Is this possible? I've tried playing around with Hull/Race Keys to get, say an Arvonian Carrier or Torgoth Behemoth as a friendly unit, or even a neutral unit (that may be later reclaimed by enemy fleets) but have not been able to determine a method for either scenario, any suggestions?
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
10 replies
avatar
CaptainZach said Mar 13, 2013 15:22:08
Neutral is effectively friendly in Artemis. What you may need to do is use hullID instead of hull/race keys, the hullIDs are in vesseldata.xml in your Artemis install folder. Example, here is a Torgoth configured as a neutral vessel:

<create type="neutral" hullID="4002" x="0" y="5000" z="0" angle="270" name="Friendly Torgoth" />

At that point you can add_ai, etc, and the game will treat it as a neutral vessel. You can make enemy TSN ships too (though there seems to be a bug in the game involving the AI of said ships). There's no way to quickly make the ship "switch sides", to do that you would need to create a new enemy vessel, destroy the old one, and copy it's positionX and positionY values to the new ship.
[Last edited Mar 13, 2013 15:22:30]
avatar
crazymatt007 said Mar 13, 2013 20:42:10
I've already mentioned something along these lines in this thread of the development forum, where it's been buried by other suggestions. My thoughts were to have multiple teams rather than simply two sides, and be able to make and break alliances dynamically throughout a game session. I'm sure the difficulties in reprogramming the AI for this kind of gameplay would not be trivial, but considering how many real time strategy games there are that effectively solve the same problems, it's certainly doable.

Edit: Thom has heard our requests, and responded with his version 2.0 to-do list!
[Last edited Mar 14, 2013 05:41:03]
avatar
Captain said Mar 14, 2013 05:20:35
With 2.0 thom is implementing an enemy variable which allows you to set ships as allies or enemy's. With a little scripting you would be able to have ships change sides if certain conditions are met. Do I would wait till 2.0 if I were you.
To Mankind
And the hope that the war against folly may someday be won, after all

Isaac Asimov
avatar
CaptainZach said Mar 14, 2013 05:57:56
Welllllll 2.0 is still quite far from being finished, since it was announced just a few hours ago. It's gonna be a little while before it's finished. ;)
avatar
Captain said Mar 14, 2013 12:39:29
Fine then. Code it so ships can't "see" you or stations. That way they won't attack. (Basically set code so the travel in one direction and don't respond to anything) then send a message where if you do something they will help you. (Here is where I don't know if it will work) once you do thing set ship to attack allies. That's the only way I can think of it working. I would still wait for 2.0 personally as scripting will be easier.
To Mankind
And the hope that the war against folly may someday be won, after all

Isaac Asimov
avatar
CaptainZach said Mar 14, 2013 14:53:06
You don't even have to do that. Any neutral ship behaves as a neutral (default: gradually head towards a randomly determined exit point), unless you give it the AI command to go somewhere or do something else. Neutrals act like friendly vessels unless you tell them otherwise, and only enemies will attack stations.

When you give something the hullID instead of hull/race keys, it behaves like that type of ship (neutral or enemy), but using the vessel (from vesseldata.xml) you assign.

EDIT: I'm not discounting that 2.0 is going to be great, or that it may include much better scripting options. This is what you can do with mission scripting right now (seeing as this is the mission scripting forum), if anyone wants to utilize this concept in a script now. :)
[Last edited Mar 14, 2013 14:59:13]
avatar
Captain said Mar 14, 2013 18:08:19
Can you even set a ship as neutral if it is an enemy?
To Mankind
And the hope that the war against folly may someday be won, after all

Isaac Asimov
avatar
CaptainZach said Mar 14, 2013 18:26:36
Absolutely! Here's the code I posted, taken directly from a script I'm finishing:

<create type="neutral" hullID="4002" x="0" y="5000" z="0" angle="270" name="Friendly Torgoth" />

'type="neutral"' means the vessel will act like a neutral, and 'hullID="4002"' means the ship uses the Torgoth Behemoth from vesseldata.xml. It looks like a Behemoth, but will act a like a neutral because type="neutral". You can use any ship you want from vesselData and it will STILL act like a neutral. I've gotten mixed results using race/hull keys to accomplish this, but directly assigning the hullID has worked every time.

Note that this is only for mission scripts - you won't see neutral Torgoths puttering around in Invasion mode! Also, the ship will have the same properties as the ship listed in VesselData.xml, so if it has the AI "FOLLOW_COMMS_ORDERS", you can tell it to attack things.

In one of my scripts, there is a renegade TSN ship, created like this:

<create type="enemy" hullID="0" x="0" y="0" z="0" angle="270" name="TSN Belisarius" />
<add_ai name="TSN Belisarius" type="ELITE_AI" />
<add_ai name="TSN Belisarius" type="TARGET_THROTTLE" targetName="Artemis" value1="1" />
<set_object_property name="TSN Belisarius" property="eliteAbilityBits" value="48" />

To break it down, I'm adding a ship with hullID "0" (TSN Light Cruiser), as type "enemy", so it is hostile and will engage neutrals, stations, and players. It has two elite abilities, High-Energy Turn and Warp (to simulate as though it has the same capabilities as Artemis), and has the AI to use them, and target Artemis.

EDIT: I forgot to mention: adding an enemy vessel like this was working up until the most recent version of the game. There is a bug that prevents the ai from directing an enemy TSN vessel around, but it will still attack if you don't assign it an AI.
[Last edited Mar 14, 2013 18:27:27]
avatar
Mike_Substelny said Mar 15, 2013 02:31:04
Captain Zach: Doesn't a neutral destroyer as enemy behave differently from a "player" ship as enemy? I think you can get a neutral destroyer to attack the players but i'm not absolutely certain.
"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 Mar 15, 2013 03:42:30
I don't really see mission scripting getting any easier until Thom goes to a format other than XML, something closer to a modern programming language would be better IMO, where statements would be evaluated in sequential order while having the ability to call upon functions, methods, and variables in many different ways. The current limitation of variables limits the potential of the scripting interface greatly.

Regarding the original intent of this post, I still haven't had a chance to write a new mission script or add this code to an existing one. I did however have a 1.700 script that included two Rogue TSN fleets, which were very easy to program, not sure why I didn't see Capt. Zach's solution before I posted this, as I reversed the process to create the enemy TSN vessels.
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: