Register Calendar Latest Topics
 
 
 


Reply
  Author   Comment   Page 1 of 2      1   2   Next
Dave Thaler

Registered:
Posts: 250
Reply with quote  #1 
I'm looking to create a script for a multi-ship mission for Norwescon (the weekend after Armada). In doing so, I have a number of questions about things that I don't think are possible, but just in case they are, or folks have a suggestion for a workaround, let me know.

1) Is there any way to add another message to set of stock messages possible to send from one player ship to another? (As a workaround, a keypress could be used to send a comms message, but it won't appear in the normal list you get from Player->Artemis).

2) Is there a way to make warning_popup_message use the Fighter console?

3) Is there any way to distinguish *which* ship sent a keypress? (I'm thinking a workaround is to use a warning popup message to only tell one ship about it and hope no one else accidentally hits it.)

4) If more than one console is enabled for getting keypresses, is there any way to distinguish which console sent a keypress?

5) Is there a way to have a Comms message only be visible by one ship?  (I'm thinking a workaround is to use a warning popup message to comms on the one ship.)

6) Is there a way for a script to get or set a property indicating whether Red Alert is on?

7) Is there any way for a script to get or set the Pshock count? mission-file-docs.txt mentions countHoming, countNuke, countMine, and countECM but not anything for pshocks.

8) Is there any way for a script to get or set how many coolant are assigned to a given subsystem?

9) Is there any way to get or set upgrades for a ship? (I'm thinking a possible workaround for adding an upgrade is to create an anomaly of a given type, right on top of a player ship.)

10) Is there any way to tell whether a given console has actually been selected?  (For example, to delay a mission intro text message until someone actually chooses a Comms console.)
Fish Evans

Registered:
Posts: 329
Reply with quote  #2 
1) As of 2.5.101, No there has been a comms redising for the upcoming release but we dont know any details.

2) Currently No

3) No

4) No

5) I belive so.. but im not 100% you can cirtenly direct a warning pop up to a specific ship

Code:

<warning_popup_message message="Test" consoles="E" name="Artemis" />
Or
<warning_popup_message message="Test" consoles="E" player_slot="0" />


6) No

7) Maybe

Code:

<set_object_property property="missileStoresPShock" value="0.0"/>

 
works for stations so try:

Code:

<set_object_property property="countPShock" value="0.0" player_slot="0" />



8) No you can play with the total amount of coolent avalible though.

9) No, need to drop an anomaly of the relivent type ontop of them.

10) Nope
Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 1,410
Reply with quote  #3 
There might be solutions to many of these in the upcoming Artemis release at Armada. I'm not allowed to disclose much because I'm sworn to secrecy, but it's possible that the mission scripts released at Armada will show you how to do some of these things.
__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
Dave Thaler

Registered:
Posts: 250
Reply with quote  #4 
Unfortunately, since I'm targeting this for Norwescon the weekend after Armada and the new version isn't released yet, I need to get it working with 2.5.101.

11) Any way to store the value of a ship's property (angle, energy, etc.) in a variable?  I know how to copy a property from one object to another, and I know one can set a property to the value of a variable, but not the reverse.   The two workarounds I can think of are: (a) have a bunch of if_object_property events to test whether the value is in different ranges, and set a variable accordingly which just gives a rough approximation depending on how granular the ranges are, or (b) create a dummy object to copy the value to and use that object other than the variable, but then you can't use it in math expressions.
Fish Evans

Registered:
Posts: 329
Reply with quote  #5 
if variable angle < property angle of "ship", then set Variable angle to angle + 1
if variable angle > property angle of "ship", then set Variable angle to angle - 1

please note this is not imediate and its posible the variable will lag some vs the real heading
Dave Thaler

Registered:
Posts: 250
Reply with quote  #6 
Quote:
Originally Posted by Fish Evans
if variable angle < property angle of "ship", then set Variable angle to angle + 1
if variable angle > property angle of "ship", then set Variable angle to angle - 1


Excellent, thanks.
Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 1,410
Reply with quote  #7 
Quote:
Originally Posted by Fish Evans
if variable angle < property angle of "ship", then set Variable angle to angle + 1
if variable angle > property angle of "ship", then set Variable angle to angle - 1

please note this is not imediate and its posible the variable will lag some vs the real heading


This is a good idea but be careful with it. In most cases the script parser works in degrees, but for the properties angle, pitch, and roll the script parser works in radians. Even worse, 0 radians is due south, angles pointed west are positive, and angles pointed east are negative.

When you need to save the angle of a ship it's much easier to copy it to an invisible generic object then write it to a variable. When you need to test the angle of a ship it's much easier to test if it is between two values.

__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 1,410
Reply with quote  #8 
Since you need this one week after Armada I'll give you a no-spoilers report on which issues will be addressed by Artemis 2.6:
Quote:
Originally Posted by Dave Thaler
1) Is there any way to add another message to set of stock messages possible to send from one player ship to another? (As a workaround, a keypress could be used to send a comms message, but it won't appear in the normal list you get from Player->Artemis).


A method of doing this will be included in Artemis 2.6. It is very easy to code but until the Mission Editor is updated you will need to code it in raw HTML.

Quote:
Originally Posted by Dave Thaler
2) Is there a way to make warning_popup_message use the Fighter console?


Sadly, no, but I envision hope for this in the future. Thom has broken out the fighter consoles to have slots and callsigns exposed to the script parser. If enough of us want the ability to send a popup to s given slot or callsign then Thom could conceivably add it in the future.

In my mission scripts I have some moments when I want a shuttle to detect something. In those cases I send the warning_popup to Science as telemetry.

Quote:
Originally Posted by Dave Thaler
3) Is there any way to distinguish *which* ship sent a keypress? (I'm thinking a workaround is to use a warning popup message to only tell one ship about it and hope no one else accidentally hits it.)


There is no way to distinguish which ship sent a keypress. The documentation for Artemis 2.6 indicates there might be a solution to this but I tested it yesterday and it did not work. Either there is no solution or there is a bug in the solution that will be fixed by April 7.

Quote:
Originally Posted by Dave Thaler
4) If more than one console is enabled for getting keypresses, is there any way to distinguish which console sent a keypress?


This is definitely no. Also, don't count on keypresses for anything. My experience is that if you develop a script on a bridge and get the keypresses working reliably, never try to play that script on any other bridge.

Quote:
Originally Posted by Dave Thaler
5) Is there a way to have a Comms message only be visible by one ship?  (I'm thinking a workaround is to use a warning popup message to comms on the one ship.)

Sadly I believe that this is also no, and Artemis 2.6 does not fix the problem. One of my complaints is that in a multi-ship mission the entire fleet only needs one Comms Officer and that is still the case.

Nevertheless I have discovered a partial workaround that functions in Artemis 2.6.

Quote:
Originally Posted by Dave Thaler
6) Is there a way for a script to get or set a property indicating whether Red Alert is on?


No, but that sure sounds like a good idea.

Quote:
Originally Posted by Dave Thaler
7) Is there any way for a script to get or set the Pshock count? mission-file-docs.txt mentions countHoming, countNuke, countMine, and countECM but not anything for pshocks.


There are two sets of object properties for this. The countHoming, countNuke, countMine, countECM and countPShock apply to player ships with a name or slot number.

The ones Fish mentioned missileStoresHoming, missileStoresNuke, missileStoresMine, missileStoresECM and missileStoresPShock apply to a base with a name and a sideValue.


Quote:
Originally Posted by Dave Thaler
8) Is there any way for a script to get or set how many coolant are assigned to a given subsystem?


No, and this is not addressed in Artemis 2.6.

Quote:
Originally Posted by Dave Thaler
9) Is there any way to get or set upgrades for a ship? (I'm thinking a possible workaround for adding an upgrade is to create an anomaly of a given type, right on top of a player ship.)


Your solution is the best way. You can use set_relative_position to put it close to the ship. It's okay to make Helm do a little work to get the upgrade. Players like that.

Quote:
Originally Posted by Dave Thaler
10) Is there any way to tell whether a given console has actually been selected?  (For example, to delay a mission intro text message until someone actually chooses a Comms console.)


The answer is definitely no and this is a problem. It's especially bad for Communications and Game Master because if those consoles aren't selected when the script sends something to them they will never receive it.
__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
Dave Thaler

Registered:
Posts: 250
Reply with quote  #9 
12) Is there any way to script for a variable number of ships, but still allow them to spawn when the game starts?   As far as I can tell, even when Ready to Play is select on the main screen of another ship, it will not spawn until you unselect it and select Ready to Play after the mission has been started on the server.  The only time they spawn immediately in 2.5.101 is if the script explicitly creates that ship, which means it's not a variable number of ships.  A Co-op Game allows them to spawn immediately but I can't find a way to make a Scripted Mission work the same way.
ryleyra

Registered:
Posts: 2,099
Reply with quote  #10 
Unfortunately, my own experiments with creating a variable number of ships has led me to the exact same conclusion. The only way to have a ship spawn when the game starts is to declare it in the script, which causes it to be created, whether players are ready or not. Spawning a ship after the game has started, with the "if_exists" command, forces the players to wait until after the server is started to click Ready to Play.

I suspect the best solution is to create a single starting ship in slot 0, and let the other ships be detected with "if_exists". That way you don't have to make everyone wait until the game starts, as in the old TSN Sandbox workaround, but you don't have a bunch of ships sitting around unmanned.

In my Strike Force Seven mission I start with a message that says I'm giving my players a minute to log in. That way I can tell how many there are before I start the mission.

Ironically, once the player ship is created, there is no way to know whether or not any consoles have actually logged into it. Otherwise you could move it out of viewing range in the y direction or something.
Dave Thaler

Registered:
Posts: 250
Reply with quote  #11 
Quote:
Originally Posted by ryleyra
I suspect the best solution is to create a single starting ship in slot 0, and let the other ships be detected with "if_exists". That way you don't have to make everyone wait until the game starts, as in the old TSN Sandbox workaround, but you don't have a bunch of ships sitting around unmanned.


Yes, that's exactly what I'm doing now.  One possible workaround that occurs to me is to have a convention that the person starting the server knows, for setting difficulty or sensor range etc according to the number of bridges, and the script can create a number of ships based on those settings.
ryleyra

Registered:
Posts: 2,099
Reply with quote  #12 
I suppose another possibility (which would really fit my script) would be to create all 8 ships. Players are told that they should move from their starting spot within a certain amount of time, and any ships that don't move are destroyed. In my case, I'd create NPC ships to bring the number back to 8.

The only problem is that if you aren't ready when the game starts, you'll be stuck with the default ship. I'm pretty sure you can't redefine your ship's class or even name after it's created. This is even true for the ship in slot 0, I think.

Dave Thaler

Registered:
Posts: 250
Reply with quote  #13 
13) A (non-scripted) co-op mission lets player ships respawn if they are destroyed.   Is there a good way to provide this option in a scripted mission?
Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 1,410
Reply with quote  #14 
You could also write several versions of the same script, simply changing the START block. They could have names like:

MISS_Big_Battle_for_Two_Ships
MISS_Big_Battle_for_Three_Ships
MISS_Big_Battle_for_Four_Ships
MISS_Big_Battle_for_Five_Ships

That should work okay.

__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
ryleyra

Registered:
Posts: 2,099
Reply with quote  #15 
Quote:
Originally Posted by Dave Thaler
13) A (non-scripted) co-op mission lets player ships respawn if they are destroyed.   Is there a good way to provide this option in a scripted mission?


I don't believe it is possible to respawn a destroyed ship without the players being forced out to the login screen. You could theoretically detect the moment the shields fall and start a timer to relocate the ship back to the spawn position and restore shields to full, but that would be a kludge at best. It's too bad you can't detect the level of internal damage.

I would think the best solution would be for Thom to implement a switch, maybe similar to the global properties for sensorSetting or nebulaIsOpaque. For instance, the property playerRespawn, if set to 1, could cause all players to respawn when destroyed. I think it would be best to make this a global property instead of a per ship one.

If you don't care about the players being logged out and having to log back in, you can simply destroy the ship and then test for if_exists to see when the players have logged back in.

Previous Topic | Next Topic
Print
Reply

Quick Navigation: