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!
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
Welcome to the forums and EE. Great you made it here and are so curious to learn more. You mean having more then three different appearances on the radar? No. This is not possible without modifying the source code. So you want to play a different sound for a fired laser per faction? Also not possible without modifying the source. 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
andmissilevolley
. But those do not modify the target selection only how the target is attacked. There is a function calledsetBeamWeaponTexture(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: 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: 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 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: 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
thanks for your thorough and detailed answer, it has been very helpful! 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
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.
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.
ship:setAI("fighter")
.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.
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. I will check those links again and see if I get this "gate artifact" done myself.
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)
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.
So if there is function for this, I rather use it.
And regarding the larp, here is information about it: http://www.odysseuslarp.com/
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.
This one? Nope.
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.
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.
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.
https://github.com/daid/EmptyEpsilon/blob/3646a96efb32b974e0e9c4bf5ea73911cb37cfa9/src/spaceObjects/spaceship.h#L56
Same for heat generation, same file, bit down in the same list.
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
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.
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