Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment   Page 1 of 2      1   2   Next
LtSykes

Avatar / Picture

Registered:
Posts: 58
Reply with quote  #1 
Hello, I am new to mission scripting. I have an idea for an ongoing story across several missions, but before I begin learning and writing things myself I figured I’d ask here if one of my ideas is even possible to script in this game.

The idea is to do something like the Star Trek TNG episode “Cause and Effect”.

Essentially, I wish to create a mission in which either base, friendly ship, or the player ship itself is continuously destroyed over and over until the crew figures out the solution. Is it possible to script the mission in such a way, that if the solution is not met the game will reset to the beginning?

Thanks!
Darrin

Registered:
Posts: 434
Reply with quote  #2 
Yes, this is entirely doable in a script. 

You'd start with a "Build" event to set up the initial scenario. Set an integer value to keep track of where the players are in the scenario. For example, for a basic Kobayashi Maru scenario:

0 = Build sector, set up neutral zone (nebulas), create cargo transport that can't move (much more difficult than you'd think), create player ship. 
1 = Cargo transport sends distress signal (maybe with a repeating timer somewhere)
2 = Players cross into Neutral Zone, create 3 Kralien warships.
3 = General state when Kraliens are attacking and players are trying to deal with them. 
4 = All Kraliens destroyed or surrendered, set value = 2.
5 = Player ship destroyed, clear/reset sector, set value = 0.
6 = Win condition (i.e., computer running this simulation has been hacked by the Comms officer) 

You'd have a series of events that may trigger depending on what the players do: Comms button to hail Kraliens (Diplomacy), Weapons targets a Kralien (Belligerance), players attempt to retreat or leave the neutral zone, etc.  

Then you'd define your "failure modes" - what conditions mean the players have failed. Once one of those modes is satisfied, then you'd trigger a "Destroy_Everything" event, set your status integer back to "0", and rebuild the sector from the beginning. Players can continue to try different strategies until they find the win condition. 

I have written a script where if the players fail, they wind up in a "limbo" sector where a somewhat snarky DEATH tells them they can try again, and they can fly into several warp gates that will take them to previous "checkpoints" in the mission. If they keep dying, DEATH gets progressively more annoyed, but lets them keep trying. 

 
 



__________________
Call Sign (EF/TSN): Bassellope

GameAnhart

Registered:
Posts: 23
Reply with quote  #3 
Great idea. Can't wait to see this done. Keep us posted!
Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 2,990
Reply with quote  #4 
This will work for setting up the mission, but it will not erase the memories of the crew members. The programming to do that might be a bit harsher. [wink]
__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
LtSykes

Avatar / Picture

Registered:
Posts: 58
Reply with quote  #5 
Yes, well, I would hope they remember so that they can figure it out. I’m going to do my best to make sure the puzzle isn’t unsolvable, but the crew is likely to fail at least twice so that it feels like a looping situation! The fact that the crew will remember will help, as it will be clear via comms from the beginning that there is a temporal/space time continuum issue at play! And thanks for the help!
Darrin

Registered:
Posts: 434
Reply with quote  #6 
Quote:
Originally Posted by LtSykes
The fact that the crew will remember will help, as it will be clear via comms from the beginning that there is a temporal/space time continuum issue at play!


Tip: Do not assume that vital information given to Comms will be "clear".

Some crews don't have a dedicated Comms officer. Some Comms officers immediately switch away from Comms and just look at the Captain's Map. Sometimes you give vital information to the Comms officer, and it got buried in a bunch of other messages, or the Comms officer decided it wasn't important. Some Comms officers may be incapacitated, inebriated, or in some sort of hibernation/cryosleep/dormant state. 

(Have I had more than one scripted mission go completely pear-shaped because vital information from Comms never got shared with the rest of the crew? Yes. Yes, I have.)

There are other techniques you can use to convey important information to other stations:

Create generic meshes that Science can discover and scan. Meshes have a description where you can put important information. That and something strange appearing on the Science map can be a big clue that the players need to start asking questions about it. 

You can also set events with trigger conditions on the scan levels of meshes, which can create/destroy objects or send pop-up messages to the main screen or the other clients. 

If Weapons targets something, you can also use that as a trigger condition for a pop-up message. 

If Helm flies near certain objects, you can use that to trigger pop-up messages.

Engineering doesn't tend to interact with things *outside* of the ship, but you can definitely trigger things based on the ship's energy or coolant settings. (If a script is particularly complicated, I usually set up a "Reset Comms" event, usually Sensor Coolant = 8, Sensor Power = 0%, to reset Comms buttons, as those can be wiped out if Comms drops out or backs out to the client selection screen.)

Pop-up messages that appear on the main screen or on all the clients are more likely to be seen by at least one player, which should prompt the players to investigate further. 





__________________
Call Sign (EF/TSN): Bassellope

LtSykes

Avatar / Picture

Registered:
Posts: 58
Reply with quote  #7 
Okay, Darrin! Thank you so much for the advice!
LtSykes

Avatar / Picture

Registered:
Posts: 58
Reply with quote  #8 
Okay so, I've made some serious headway following your build/destroy event recommendations. My only issue that I've noticed so far is that all messages I've created, whether they be sent to comms, main screen, certain consoles, etc seem to repeat the statement in the message box infinitely. How do I correct this? I spent some time trying stuff out based on the pbworks guides, but I must be doing something wrong.

Thanks!
Darrin

Registered:
Posts: 434
Reply with quote  #9 
Quote:
Originally Posted by LtSykes
My only issue that I've noticed so far is that all messages I've created, whether they be sent to comms, main screen, certain consoles, etc seem to repeat the statement in the message box infinitely. How do I correct this?


You need to set a condition on the message event that fails after the message is sent. I generally do this with an integer variable, such as "alarm" or "alert". 

For example, set alert = 0 in the start block. Message triggers when alert = 1, so there will be some event somewhere where the players do something (such as crossing into the Neutral Zone) to increase or set alert = 1.

Your first message event, let's say "Alert_1", will need a condition where alert = 1. Inside that event, put in your message command, and then make sure you increment alert = alert +1. (You could also just set it to some integer value that isn't = 1.) Next time Artemis goes through the main script loop, alert = 2 and Alert_1 won't trigger. 

You can use the same variable for multiple messages. For example, you could have a different message trigger when alert = 3, or alert = 5. With this arrangement, even numbers are "safe", in that they don't trigger any messages. However, if the mission gets particularly complicated, you may need to define a variable for each message you want to send. In this case, then each variable would have three values: 0 = mission start, 1 = send message now, and 2 = message has been sent. 



__________________
Call Sign (EF/TSN): Bassellope

LtSykes

Avatar / Picture

Registered:
Posts: 58
Reply with quote  #10 
Okay, without spoiling much of what I'm doing, I have a countdown going that sends a warning pop up to various consoles on the ship.
I made the variable "causeandeffect" since that's the name of the mission, and the episode it's inspired by. So there's a 5 minute countdown with the timer. I have different timers in play as well, but for sake of my example lets say I have a message pop up every minute in a 5 minute countdown. The beginning of the build events sets my variable integer to 0, then when the start mission timer is finished it sets the "causeandeffect" variable to 2. 

So long story short it looks like this in the various countdown events:
integer is 1
set to 2

integer is 2
set to 3

integer is 3
set to 4

and so on, etc. That should fix the issue, correct? Again thanks for your help! Just want to make sure I understand. The mission isn't overly complicated, but the reset nature of it I hope will make the mission feel unique and very Trek.
HaydenBarca

Registered:
Posts: 455
Reply with quote  #11 
For keeping track of persistent time like that I typically will do something like:
1) Set a variable timeIncrement = 60 (so that I can play with the "chunk" size and everything else self-corrects, it can also serve as your message frequency)
2) Set a timer of length = timeIncrement
3) When that timer finishes add to a totalTime variable (for instance totalTime = 60/timeIncrement minutes) and reset the timer
4) You can also use the timer-end as an opportunity to send a message using the pipes "|" to add a variable to a text string.  For example, "This is a warning that |totalTime| minutes have passed."  Since the timer is reset the message won't repeat endlessly.  It also adjusts automatically so you don't have to have a separate trigger for 1 minute, 2 minutes, etc.
5) Test for when totalTime hits some threshold to do something (e.g. when totalTime = 60, "An hour has passed and we need to leave.  Mission ended."

For games I've set up to be contests ("how quickly can you save the cargo ship?"), I dial the increment down to 5 seconds to get better resolution and track the message repeats separately.

Hope that helps.
LtSykes

Avatar / Picture

Registered:
Posts: 58
Reply with quote  #12 
My countdown sequence is working. The success conditions, and failure conditions all seem to check out, and I have various warning pop ups helping to communicate info to the crew to assist in the event that a comms officer isn't, uh, "present" in a sense. The two issues I'm running into is getting the Scanning properties of generic meshes to work the way I want to help facilitate the mystery and lead the crew to the solution. I want the science officer to be able to scan a couple points i've made, multiple times (like twice each) and each time give different information. How do I do that, and also how do I get a hidden ship to stop immediately communicating to the comms console. It's supposed to be a secret that it exists, and yet whenever the mission starts they immediately taunt the player [biggrin] lol
LtSykes

Avatar / Picture

Registered:
Posts: 58
Reply with quote  #13 
I mean, I could always just work around it and spawn the ship in at a later point... was just curious if there was a way to keep the darn thing's mouth shut lol
Darrin

Registered:
Posts: 434
Reply with quote  #14 
Quote:
Originally Posted by LtSykes
I want the science officer to be able to scan a couple points i've made, multiple times (like twice each) and each time give different information.


When you first create a mesh, it's scan level = 0. Unfortunately, enemy ships are the only objects in the game that can be scanned twice. However, there's a work-around. When the player scans the mesh, you can set an event that will trigger when scan level = 1, destroy the mesh, and recreate it at the same location. The newly-created mesh now is back to scan level = 0. You can also change the mesh description so it tells the Science Officer something different. 

Note: If the player ship is too close to the mesh, this may work a little differently, as objects close to the ship may be "autoscanned".

Quote:
Originally Posted by LtSykes

how do I get a hidden ship to stop immediately communicating to the comms console. It's supposed to be a secret that it exists, and yet whenever the mission starts they immediately taunt the player [biggrin] lol


Hmm. Tricky. New enemies taunting the player is something the game code does automatically. That's not something the scripting language has access to. However, I think you can fix this by creating the ship as a neutral, and then switching it's side to enemy in an event after the start block. Try playing around with the "side" property, and see if you can avoid the enemy taunting messages. 




__________________
Call Sign (EF/TSN): Bassellope

LtSykes

Avatar / Picture

Registered:
Posts: 58
Reply with quote  #15 

Darrin, I do believe I figured out the proper work around to both of the issues. I set the conditions for each that read like:

Scan level of object name "example" for side 2 (Player) != 0

Then using the set text properties action I change the names of them to various things that are hopefully good clues for the crew to solve the puzzle. But this next part is key:

In the text box for any 1st scan of any generic mesh, I have it specifically stated at the end of the blurb that the science officer must hit the "ENTER" key on their keypad to scan again. Hitting the enter key on an object you just scanned allows you to scan it twice so long as these conditions and actions are set!

As for the enemy, my workaround was to spawn it specifically when the player ship is near where it "should" be for lack of a better term. I have to test everything a little bit further, but I think I'm very close to having a working Mission to share with everyone!

Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.