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!

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 19
    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.
  • 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 9
    @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.
Sign In or Register to comment.