Terradine Scripts Concepts

The place to discuss scripting and game modifications for X³: Reunion.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

User avatar
milling_hordesman
Posts: 372
Joined: Mon, 1. Mar 04, 06:16
x3

Post by milling_hordesman » Thu, 19. Oct 06, 21:45

oh, you can change the direction of missiles, but you have to do it via "position" commands. if you take an affected missile, calculate its displacement due to velocity each frame, and keep manually moving it towards the spacefly, you could simulate the missile actually following the spacefly. that's essentially what i do in my ECM scripts. the more challenging part i found was trying to find and keep track of missiles. last i checked:

- you can't actually run a script on a missile (just run a script that affects the missile)
- they don't seem to have unique IDs like most other things do (so it's not like you can create an array of them and check if you've already affected it)
- you can't store local variables on them (so you can't put a flag on each one you've already affected)
- and unless i'm forgetting some new functionality in X3, you can only ever find the closest missile targeting the ship

makes it very difficult to implement this kind of stuff.
//----------------------------------
--the milling_hordesman

Me Mods

AdmiralTigerclaw
Posts: 2131
Joined: Mon, 27. Dec 04, 11:49
x4

Post by AdmiralTigerclaw » Sat, 21. Oct 06, 05:54

A few thoughts as to phrase construction Serial...

I think, whenever Oracle prepares a comment, it should set what it needs to do first. Like, it'll store all the target values, like what kinds and how many, and pick how to phrase.

And then, using the stored sets, after going through all it's calculations, then tell it to play the correct phrase sets off the stored values.

Say, all variables operation on a 0, 1 value set.

The calculations done to pick a phrase are merely setting these values.

At the end of setting all the values as either 0 (don't play) or 1 (PLAY)

It will then simply run straight through a list. (Or actually, one of several lists depending on what voice sequence it's issuing.)

It would play all '1' fragments and their pauses, and skip over all 0 fragments.

This way, if it bogs down while calculating, it doesn't sound like it during the voicing.

User avatar
Serial Kicked
Posts: 3823
Joined: Fri, 12. Aug 05, 20:46
x3tc

Post by Serial Kicked » Sat, 21. Oct 06, 07:37

@milling_hordesman: Thanks :)

Like i'd imagine thoses. Too bad egosoft didn't made things easier.
Graphically the effect must be very choppy. I guess it's also possible to rotate the missile to help, but still.

Another method could be a kind of EMP mine. It doesn't attract missiles, but if the missile fly near it (in a radius of 100-200m), both are destroyed.

Also, iirc, there's also a "get array of incoming missiles"now in X3. Not 100% sure, though.


@atc:

Yes, calculations will be made first. But i won't make it run through those whole sound list and playing them if a boolean is set to thrue, because, it's too slow :)

The script/loop will check for all the conditions that make oracle speak (there's not so many after all), add the corresponding sounds to a list and then play the whole phrase:

if there's incoming
- $nb = number of incomings
- $class = class of incomings
- $race = race
- add.sound.id.to.list("you have been tracked by")
- add.sound.id.to.list("$nb")
- add.sound.id.to.list("$race")
- add.sound.id.to.list("$class")
end
if mine field detected
- add.sound.id.to.list("Enemy minefield at")
....
then play the sound files one by one

We can even add some little things like removing the additional "warning" which is needed only once at the start of the sentence, adding blank between sentences, and say a last word if the situation is really hostile:

"Warning, you have been tracked by 5 Paranid M3 ; five incoming hornet missiles detected ; a hostile Paranid Destroyer is targeting us. Good luck, captain !"


In fact the only issue is with numbers, i'll have to make a "numer to speach" function that i won't like to write :p
X3:TC/AP Pirate Guild 3 - Yaki Armada 2 - Anarkis Defense System

Anarkis Gaming HQ
Independent Game Development
X3 Scripting and Modding Station

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22254
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Sat, 21. Oct 06, 15:18

Serial Kicked wrote:Also, iirc, there's also a "get array of incoming missiles"now in X3. Not 100% sure, though.
yeah you can get the array of missiles that are targgeting you in X3

User avatar
milling_hordesman
Posts: 372
Joined: Mon, 1. Mar 04, 06:16
x3

Post by milling_hordesman » Sat, 21. Oct 06, 18:14

right you are. there was something like "get array of incoming missiles" playing around the edges of my awareness, which is why i kind of set that statement aside. that should make things much easier.

the effect of constantly moving the missile via position statements is actually very smooth. the script loops often enough that, if you pace the placement correctly, it looks like continuous motion. basically, calculate the path you would like the missile to take (always moving directly towards the flare at a constant speed) and make a loop with a "wait 1" statement in it, placing the missile where you think it should be based on time passed and the movement of the flare.

you may want to play around with rotating the missile, but more for visual effect than for any assistance with movement. otherwise the missile is always facing directly at your ship, which can look kind of funky if it isn't also moving directly at your ship :p
//----------------------------------
--the milling_hordesman

Me Mods

AdmiralTigerclaw
Posts: 2131
Joined: Mon, 27. Dec 04, 11:49
x4

Post by AdmiralTigerclaw » Sun, 22. Oct 06, 05:50

Just thought of something on my end.

With the revised GOD script to control Terradine, I think I know a way to do some things...

Assuming you can store certain values INDEFINATELY, what you can do, is on galaxy initilization, check all sectors and build an array of NPC station numbers per sector. These numbers would then be refferenced as the MAXIMUM number of NPC stations allowed in that sector, excluding the, trade stations, shipyards and EQ docks.

Next, at load, it can tag any factory with a primary resource NVIDIUM and product ECELLS as 'never kill'. This way, I can employ my SPACEDOCKS without having to worry about them suddenly snuffing out.

And just to prevent a small problem, an additional tagline on tractor beam factories to check the galaxy for them. If it doesn't find them for some reason, it'll build one, making sure there are three MINIMUM at all times.

I still need to figure out a logical way to have the script know what station types would be allowed in what sectors, to prevent them clashing with descriptions.

AdmiralTigerclaw
Posts: 2131
Joined: Mon, 27. Dec 04, 11:49
x4

Post by AdmiralTigerclaw » Tue, 31. Oct 06, 22:07

Behavior modification:

Friendly Fire LOS.

I realized something running a terradine map test and attacking a pirate. If you're attacking someone, and Argon One comes up behind you attacking the same exact target, they don't give a rats @$$ if you're in the way. And with the high power PPCs being what they are, I almost got fragged in one shot by FF.

Whatever constitutes the actual attack command needs to have a small calculation inserted to 'abort shot' if there is anything that is not an enemy between the attacker and the target.
There's also a need to alter the in-range icon for terradine, as well as the attack ranges for AI with my significantly improved firing ranges. (Especially for LTs which have a 30 K firing radius in Terradine.)

EDIT: Elaborating on this a little.


Since the PPC uses the Lasertower mega-sized beam so it can have a dramatic impact visually from a distance, the beam also seems to have a slightly larger hitbox. Meaning a tight battle with a fight is extremely dangerous around capships, no matter who owns them. I'm not exactly sure how it would be excecuted, not knowing how the attack script functions. But there needs to be some way to make all ships that are engaged in IN SYSTEM combat run checks on sight cones and target sphears and have some kind of risk assessment hardline trigger that makes it cease fire if there's interference from friendlies. This would be noted during starfighter attacks supported by capships. In the event of several friendlies swarming a target, they don't fire if their firing solutions have friendlies between them and the enemy, but will continue to shoot the moment an opening appears.

Also, since firing ranges have been increased across the board, especially the range of high power capship weapons and laser towers, the command needs to recognize it can attack from greater ranges. (30 KM for laser towers... around 20 K for capship weapons.)

This also need to go into the player's target indicator, since enemy ships are in range before it appears.

User avatar
Serial Kicked
Posts: 3823
Joined: Fri, 12. Aug 05, 20:46
x3tc

Post by Serial Kicked » Wed, 1. Nov 06, 19:41

re: custom GOD engine

There's a few limitations in the SE that you should first know before elaborating :) First it's not possible to assign variables to sectors. You can do it on every single object, but not on sectors (:roll:). The only easy workaround i can think of is to spawn at init time an hidden neutral object far away in each sector.
Next, at load, it can tag any factory with a primary resource NVIDIUM and product ECELLS as 'never kill'. This way, I can employ my SPACEDOCKS without having to worry about them suddenly snuffing out.
No one seems to exactly know when and why god kill/spawn stations. I don't even know if it touch stations others than thoses on the vanilla map. I've found nothing interesting on the board on the subject (the god engine should deserve its own topic, 'cause there's few to none proven data about it atm).

The main issue with god is to tag something as 'never kill'. If it decides to kill a station it will do it, nothing can be done to prevent that. So, if you want to tag something as 'never kill', you'll need to have all the values (name, race, f/f settings, products, resources, current stocks ....) monitored & stocked somewhere to be able to respawn the exact same station. Doable, but painful.


re: FF LOS

tbh i've no idea how to do that ^^ RedSpot is the specialist of turret handling, but i'm not sure his script has any kind of FF prevention mechanism.
X3:TC/AP Pirate Guild 3 - Yaki Armada 2 - Anarkis Defense System

Anarkis Gaming HQ
Independent Game Development
X3 Scripting and Modding Station

Return to “X³: Reunion - Scripts and Modding”