Adding explosions to flak weapons
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Adding explosions to flak weapons
As the titel says, I want to add a damaging explosion to weapons with the "flak"-flag when the projectile explodes. The LIFE mod has explosions, so I know how to create those. I have found the command in the script editor to check for the "flak"-flag on a weapon. Now what I don't know is where and when to create the explosions.
Can I get the lifetime and trajectory of a fired projectile in the script editor? Or does anyone have an idea how to solve the when and where question?
Can I get the lifetime and trajectory of a fired projectile in the script editor? Or does anyone have an idea how to solve the when and where question?
- X2-Illuminatus
- Moderator (Deutsch)
- Posts: 24950
- Joined: Sun, 2. Apr 06, 16:38
You do not create or add explosions with the Script Editor. The Script Editor is a tool to write and edit AI scripts.
To add/change explosion effects you need to edit the respective mod files. This post by Matterom and this one by Syklon hold some information about this.
To add/change explosion effects you need to edit the respective mod files. This post by Matterom and this one by Syklon hold some information about this.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten
Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)
Neuauflage der fünf X-Romane als Taschenbuch
The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!
Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)
Neuauflage der fünf X-Romane als Taschenbuch
The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!
Let me rephrase my request: I want to add damage to an existing visual effect. That is what the LIFE mod did with ship explosions, and it did it with a script file. It basically checks which ships are close to the explosion and then applies damage to them based on distance.
I'm am unsure if doing explosion damage in a script file is perfomant enough to use for weapons, but I know of no other way to do it.
I know the basics of modding the TBullets and how effetcs and sounds are done. I had a look at CMOD and copied some of it's graphics and sound into my game. From this I know that the special kickback-effect of the CIG for example is not in the TBullets but in some other file. I have no idea if it is possible to edit this.
I have looked at the links you posted X2-Illuminatus but I have found no helpful information there.
I'm am unsure if doing explosion damage in a script file is perfomant enough to use for weapons, but I know of no other way to do it.
I know the basics of modding the TBullets and how effetcs and sounds are done. I had a look at CMOD and copied some of it's graphics and sound into my game. From this I know that the special kickback-effect of the CIG for example is not in the TBullets but in some other file. I have no idea if it is possible to edit this.
I have looked at the links you posted X2-Illuminatus but I have found no helpful information there.
- X2-Illuminatus
- Moderator (Deutsch)
- Posts: 24950
- Joined: Sun, 2. Apr 06, 16:38
It isn't. Whereby the real problem is that you cannot find out, if a ship is hit by a specific weapon type or not. And you also cannot bind a script to a bullet.I'm am unsure if doing explosion damage in a script file is perfomant enough to use for weapons, but I know of no other way to do it.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten
Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)
Neuauflage der fünf X-Romane als Taschenbuch
The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!
Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)
Neuauflage der fünf X-Romane als Taschenbuch
The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!
I was afraid of that... it would be such a simple idea to implement if we had access to that part of the code
But I think it would be possible to do a not realible, very complicated version with scripting, but just for turrets. Turret scripts like SMART have access to when a turret is firing and at what. Then you can calculate the distance and with the projectile speed estimate when the projectile should hit. Then you check if the target has taken the specific damage of that bullet (not sure if this part would work reliably). If no damage, apply damage to all things in the vicinity of the bullet when its lifetime runs out.
Soooo... it would work in principle for turrets, but it would not be perfomant. And also, distance checks are not a good way to do hit detection. But then again, bounce does some good hitdetection on large objects so it must be possible with scripting...
But I think it would be possible to do a not realible, very complicated version with scripting, but just for turrets. Turret scripts like SMART have access to when a turret is firing and at what. Then you can calculate the distance and with the projectile speed estimate when the projectile should hit. Then you check if the target has taken the specific damage of that bullet (not sure if this part would work reliably). If no damage, apply damage to all things in the vicinity of the bullet when its lifetime runs out.
Soooo... it would work in principle for turrets, but it would not be perfomant. And also, distance checks are not a good way to do hit detection. But then again, bounce does some good hitdetection on large objects so it must be possible with scripting...
... do you have a clue how much performance it would cost ??Brokkoli wrote:But I think it would be possible to do a not realible, very complicated version with scripting, but just for turrets. Turret scripts like SMART have access to when a turret is firing and at what. Then you can calculate the distance and with the projectile speed estimate when the projectile should hit. Then you check if the target has taken the specific damage of that bullet (not sure if this part would work reliably). If no damage, apply damage to all things in the vicinity of the bullet when its lifetime runs out.
... assuming there are 20 ships fighting with 2 turrets (in average), the average firerate is about 4 rounds per second, for each shot a calculation of about 5 instructions are needed
=> 20 x 2 x 4 / s x 5 = 800 script-lines / second !!!
ps: ... bullets are not controllable via scripts, that´s hardcoded ... you would have to "simulate" shots / lasers etc. another way
=> 4 short: NOT POSSIBLE !!
To err is human. To really foul things up you need a computer.
Irren ist menschlich. Aber wenn man richtig Fehler machen will, braucht man einen Computer.
Mission Director Beispiele
Irren ist menschlich. Aber wenn man richtig Fehler machen will, braucht man einen Computer.
Mission Director Beispiele