Questions about mission scripts

Hello there!
I'm new to this thing, and I'm really in love with this program. As to my background - I started using EE in increasingly modded ways in a SciFi P&P campaign, and it's awesome. I especially want to marry the GM screen - this is such an awesome tool for narrative games... but I digress.

As I try to mod the program closer to the target universe (Mass Effect), I have several questions - some of them might well be stupid, as I have literally no background in coding, stole most of my adaptions from threads Kilted_Klingon started and see LUA as some sort of Sindarin.

So, my questions:

- Is there a way to add further nebulae? I can swap the existing nebulae for my desired effects, but I would love to use both.

- Same goes for sound FX - I can use my own by just swapping them in, but I'd like to use different effects for different factions.

- Is there a way to handle general NPC ship behaviour? For example let fighters prioritize bombers and ignore cap ships? The GM can micromanage that, but in large battles...

- Oh, and is it possible to change the color for beam weapons, or for shields?

- I understood that the missile weapons are hardcoded in damage, velocity or effect. Is it possible to bind events to a missile hit? Like... making a nuke hit automatically create a nebula or something like that?

I looked around here, but I did not find stuff like that in previous threads. I apologize if I overlooked something.

Thanks everybody!
«1

Comments

  • Hey Terandir.

    Welcome to the forums and EE. Great you made it here and are so curious to learn more.
    Is there a way to add further nebulae?
    You mean having more then three different appearances on the radar? No. This is not possible without modifying the source code.
    Same goes for sound FX - I can use my own by just swapping them in, but I'd like to use different effects for different factions.
    So you want to play a different sound for a fired laser per faction? Also not possible without modifying the source.
    Is there a way to handle general NPC ship behaviour? For example let fighters prioritize bombers and ignore cap ships? The GM can micromanage that, but in large battles...
    Not like that. It sounds like a good idea though.
    But you have three different AIs that change the attack patterns of ships: default, fighter and missilevolley. But those do not modify the target selection only how the target is attacked.
    Oh, and is it possible to change the color for beam weapons, or for shields?
    There is a function called setBeamWeaponTexture(int index, string texture) that should allow you to change the look of the beams. I have not used it and it also not used in the EE missions – so no guarantee that it works. Try something like that:
    local player = PlayerSpaceship():setTemplate("Phobos M3P"):setFaction("Human Navy")
    player:setBeamWeaponTexture(0, "beam_purple.png")
    player:setBeamWeaponTexture(1, "beam_yellow.png")
    The image files have to be valid names in the resources folder.

    I am not aware that you could recolor shields.

    Just in case you did not know – you can change the color the engines emit in model_data.lua.

    There are lines like those:
    model:addEngineEmitter(-0.75, 0.24,-0.1,  0.5, 0.5, 1.0, 0.2)
    Parameter 4, 5 and 6 are the RGB colors of the engine (0.5, 0.5, 1.0 in this example). All values are between 0 and 1
    I understood that the missile weapons are hardcoded in damage, velocity or effect. Is it possible to bind events to a missile hit? Like... making a nuke hit automatically create a nebula or something like that?
    No... and yes. There is no way to detect that a missile hit or exploded. But you could either track how much hull and shield integrity a ship lost over a tick and just assume that high damage was caused by a nuke. Or you could modify the behavior in a way that the ship leaves a nebula when it is destroyed. That one is rather simple:
    CpuShip():setTemplate("Adder MK5"):setFaction("Human Navy"):onDestruction(function(ship)
        Nebula():setPosition(ship:getPosition())
    end)
    
    You need the latest release of the game or this code will not work.

    But you are right. It might be interesting to have event listeners also for the cases when a missile hits a target or similar.

    Hope this helps you a little further.
    Christian
  • edited February 2019
    Hello,

    thanks for your thorough and detailed answer, it has been very helpful! :)
    But you have three different AIs that change the attack patterns of ships: default, fighter and missilevolley. But those do not modify the target selection only how the target is attacked.
    That might already be enough. Is there somewhere I can read up on that - what these three attack patterns do and how to "invoke" them for certain ships?

    In other questions:

    I noticed that all the nebulae are shown on the Relay Screen, even when they shouldn't be scanned yet. Is there a way to change that?

    And (this might sound strange...) can you make an object immune to a wormhole? I want to use a kind of "gate" and the gate object itself gets transported immediately. :)

    I'll probably keep showing up with things like these. Thanks for your patience!

    Cheers,
    Heinz
  • Setting the AI (default, fighter or missilevolley) occurs when the template is built. It cannot be changed once the server starts. The ship templates can be found in the scripts folder: shipTemplates.lua. If you make changes to this file, all your client machines will also need the changes.

    There is no setting for wormhole immunity, but you could continually set the object's position in the update function to prevent it from getting sucked into the wormhole.
  • Thanks again, I will work with that! :-)
  • "If you make changes to this file, all your client machines will also need the changes."
    AI is a bit of an exception to this rule (as AI only runs on the server), but it's a good rule to follow.

    The Fighter AI does a hit&run instead of the normal attack till death.
    The volley AI keeps a distance, circles around you and tries to fires missiles from a distance.

    You can forcefully select a target with the "ship:orderAttack(target)" to attack a specific target and target selection from the scenario script.


    Nebulea are always visible on the relay screen. No way around that from scripting.
  • Thank you as well. This helps a lot!
  • Adding up: Changing the AI of a single ship during gameplay is possible through ship:setAI("fighter").
  • xopn said:

    Adding up: Changing the AI of a single ship during gameplay is possible through ship:setAI("fighter").

    Whoo-hoo! Thanks!
  • For JumpGate, I have ended up using scripting to spawn and despawn the wormhole
  • For JumpGate, I have ended up using scripting to spawn and despawn the wormhole

    Did you use a button or some other trigger? Wait, wouldn't it be possible to have a wormhole open on entering a zone or approaching some object to a certain distance? And could that wormhole appear relative to the approaching ship?
  • Terandir said:

    Wait, wouldn't it be possible to have a wormhole open on entering a zone or approaching some object to a certain distance? And could that wormhole appear relative to the approaching ship?

    Sure. You could even use scripting and implement the "WormHole" yourself – it is not that complex. That way you could have your gate (which is probably an `Artifact` in the game) behave as if it was a WormHole. The visuals on the 3D Screen are probably not that cool though. Oh well, you could add some `ElectricExplosion` if you wanted to to make it look nice.

    You could even add some nice features like target selection or activation of the gate if you wanted to.

    As with everything: Let me know if you need some scripting examples on the things we mention. If you want to learn scripting for EE (and telling by your questions, you would benefit from it ;) ) check out http://daid.github.io/EmptyEpsilon/#tabs=4 and the file `script_reference.html` that is shipped with the installer.
  • Thanks for your answers. Yes, there is a lot to learn. As I said, I have NO coding background, and I'm reading tutorials on LUA, but this is all still basically a book with seven seals to me (in Hindi. Written in kyrillic letters. Buried in the garden. Another one's garden.) So, thank you for your patience!
    I learn best from missions where I copy/paste and adapt, but I'm hesitating to ask for someone else writing code for something for me, even if it is probably less work for others than answering all my stupid questions. :hushed: I will check those links again and see if I get this "gate artifact" done myself. :)
  • Well, everyone has to learn at some point. It's not like we where born with coding background.
    And LUA is a pretty safe and forgiving environment to learn from. And it's much easier to learn if you are making something you like.
    (Remember, I started out without any coding background tinkering in Unreal Tournament back in 2000, and 15 years later, I make my own multiplayer game from scratch called EmptyEpsilon)
  • I had not background, ill dig out the code but basically I used a script that checked distance and then spawned when player was close.
  • I'm creating mission scripts and I am wondering how to do following:
    When the scenario loads the player ship fighters are not launched, but docked on the bigger ship.So they can undock and start playing with the fighters.

    This is used in LARP so we will have in total of 5 playerships and by default only is loaded when scenario starts. Rest will be launched if necessary.
  • If its for a LARP just use the GM screen, take control and dock them
  • If possible, we would rather have this scripted in, as we have multiple scenarios during 48 hours and we have quite many tasks in our hands during the game. We would like to avoid all manual work when ever it is possible.

    So if there is function for this, I rather use it.

    And regarding the larp, here is information about it: http://www.odysseuslarp.com/
  • In addition. We have team of programmers working with this and we will do some changes on the source code as we are connecting EE to our database with lot of stuff. We have team of 15 programmers working with this, so also solutions which are not so easy solutions are welcome. :)
  • That is a nice trailer there. Shame you're so far away from here. :-)
  • edited May 2019
    @Riffi: There is the commandDock function. So let all ships spawn within docking range of the bigger ship with docking ports, and add to your init function:

    ship1:commandDock(biggership)
    ship2:commandDock(biggership)

    and so on for every player ship

    This would be utilising the standard docking functions. If you want to have it BSG-Style, with docking inside the carrier ship, it would be more complex, as the script have to listen if some player ship docks, then destroy them (maybe with some stats saved in a variable before), and later let them create again by using a custom button on a console on the carrier ship. The neccesary functions for this would probably be
    isDocked and addCustomButton

    BTW: Connection to a Database might actually be doable without changing the sourcecode, thanks to the integrated http server, depending on how complex your needs are.
  • Is there a way to modify the message which is shown to players when the ship is destroyed?
  • What exactly do you want to accomplish? While you can't change this message, you can use the setCanBeDestroyed() function to make the ship indestructible, and then handle low hull cases by the script.
  • In this case it was exactly that, change that message into something else. But we have a workaround. :) We have also used the setCanBeDestroyed() in few situations.


    Next question:
    setScenario
    setScenario(script_name, variation_name) Change the current scenario to a different one.

    I get error "Attempt to index nil value"
    What should the variation_name be?

    I tried to look for examples, but didn't find any scenarios where this has been used.
  • edited June 2019
    Yep, workaround was what I intended to show with my example (intercept the default message by making the ship invincible and set custom messages)

    I have not tested it, but I assume it is the variation of the scenario. Those are individual per script, e.g. Basic has "Empty", "Easy", "Hard" and "Extreme" Beacon of light don't have any. I assume the argument for the default mode would be either "" or "None".
    If that doesn't work, it probably would help to know what exactly was your code that caused this error.
  • Our stuff is almost done! YAY! :D

    LARP starts on Thursday and lasts 48 hours...

    So, next question.

    How can I give ships more maneuvering energy? I would like to set so, that our ships maneuvers won't overheat as fast as they do at the moment. I haven't found setting for this yet.

    If this must be done in source code, that is OK also.

    As people might be interested...
    What we have done:
    - Long Range: 100U
    - Short range: 10 U
    - Hidden Database and Docking buttons
    - In main screen, first person view is default

    Then we have quite simple scenarios, but we have made custom button for launching for example fighters. To launch fighter from main ship, first Relay must press custom button and then pilot can join the fighter. To dock, fighter must be close enough to mainship and press custom button and then the fighter will be destroyed from the game.
    With this, we don't need to think about fighters taking damage when they are not actually in use.
  • Combat actions are hardcoded:
    https://github.com/daid/EmptyEpsilon/blob/3646a96efb32b974e0e9c4bf5ea73911cb37cfa9/src/spaceObjects/spaceship.h#L56
    Same for heat generation, same file, bit down in the same list.
  • edited November 2019
    Hello!
    So, I have an idea for a mission for my group, involving testing a new and secret weapons system… you know the drill.

    I have a vague plan how to put this “beam weapon” together, but honestly, I fail at the basic level of assembly. Could somebody lend a hand?

    I’ll just list how I imagine this, and hopefully this is not already painfully wrong.

    - There should be a button on the Fire Control panel, labeled “Charge”. If you press it, an X second timer should begin, changing the button into “FIRE”. (I failed there already, so I would settle for two buttons.) Charging should use up all the energy in the other weapon systems, setting that to zero.

    - Once fired, the script should get the bearing of the ship and generate a “line of fire” in that way, characterized by a series of very small scaled down explosion (or better EMP) effects lining up, making a certain amount of damage. The script would need to somehow implement Y as range and Z as damage done. Bonus points if the series of explosions could go off not all at the same time, but with a millisecond delay, to look like a form of “flying pulse” instead of line just flaring up. Might also help balancing this thing, if the “projectile” can be evaded. And of course, a sound effect should be triggered.

    (My first concern: this would be a lot of explosion effects in a very short amount of time. Would the engine even cope with something like that? I didn’t even get the line of explosions to work, so I couldn’t test that…
    Second concern: do the explosions even do damage? Or are they just effect flares? Would I need a “field function” kicking in and out to do damage along the weapon’s path??)

    - Then the button “FIRE” could change back to "charge". I have a vision about putting the charge button on the engineering panel, so more people get involved? There is no captain console, or else I’d love to have some red button giving clearance for the use of the weapon.

    I’m not sure how this “weapon” would fare in actual play, aside from a special mission. Would it even be possible to add this to NPC ships, automatically using it? Might this be some way to implement “sniper cruisers”? Just throwing things to the wall here.

    Thanks to anybody who read so far. I imagine this to be a simple function if you’re actually good at scripting… please just tell me if I’m wrong about this.
    THANKS!
    Heinz
  • Terandir said:


    - There should be a button on the Fire Control panel, labeled “Charge”. If you press it, an X second timer should begin, changing the button into “FIRE”. (I failed there already, so I would settle for two buttons.) Charging should use up all the energy in the other weapon systems, setting that to zero.

    Where exactly do you have problems? And which version are you using? Constantly updating buttons/labels used to be problematic, but it was fixed a few versions ago.
    Terandir said:


    - Once fired, the script should get the bearing of the ship and generate a “line of fire” in that way, characterized by a series of very small scaled down explosion (or better EMP) effects lining up, making a certain amount of damage. The script would need to somehow implement Y as range and Z as damage done. Bonus points if the series of explosions could go off not all at the same time, but with a millisecond delay, to look like a form of “flying pulse” instead of line just flaring up. Might also help balancing this thing, if the “projectile” can be evaded. And of course, a sound effect should be triggered.

    I am not sure if that would be practical. Also, the explosion effects trigger the explosion sounds, so multiples of them could sound pretty weird.
    If you can do without the flying pulse, and an instantaneous beam would suffice, you could just use the new beameffect function. There you can also freely change beam texture and sound.


  • Where exactly do you have problems? And which version are you using? Constantly updating buttons/labels used to be problematic, but it was fixed a few versions ago.

    I'm using 11.28, and my main problem is that I can't get the button to change its visuals. Or is this "deleting" one button and replacing it with another?


    I am not sure if that would be practical. Also, the explosion effects trigger the explosion sounds, so multiples of them could sound pretty weird.
    If you can do without the flying pulse, and an instantaneous beam would suffice, you could just use the new beameffect function. There you can also freely change beam texture and sound.

    That sounds perfect! Did not think about the sound multiplication at all, thanks for the heads-up.
    I will experiment on this. Does beameffect produce damage in itself? And is it stopped by targets?

    Thanks a lot, I did not know about beameffect!

    Cheers,
    Heinz
Sign In or Register to comment.