Author Topic: Changing Stock Scripts  (Read 1152 times)

Offline Mark McWire

  • Posts: 83
  • Cookies: 1010
Changing Stock Scripts
« on: March 31, 2018, 05:24:31 PM »
Here's a new discussion about changing stock files. Currently I have changed the loadspacehelper, rather the CreateShip method. Instead of calculating the visible damage resolution based on the hull strength, I now take the value "GetDamageResolution" from the ShipProperty.

New Code Snippet:
Code: [Select]
pShipProperty = pShip.GetShipProperty()
pPower = pShip.GetPowerSubsystem()
if pShipProperty:
pVisibleDamageStrengthModifier = pShipProperty.GetDamageResolution()
if pVisibleDamageStrengthModifier > 2:
pVisibleDamageStrengthModifier = 2
pShip.SetVisibleDamageStrengthModifier(pVisibleDamageStrengthModifier)

Offline FekLeyr Targ

  • DS9FX Team
  • Posts: 490
  • Cookies: 537
Re: Changing Stock Scripts
« Reply #1 on: March 31, 2018, 07:35:22 PM »
If I understand this correctly, modders get better control over visible damage on ships, don't they?
TaH pagh, Tah be.

Offline Mark McWire

  • Posts: 83
  • Cookies: 1010
Re: Changing Stock Scripts
« Reply #2 on: March 31, 2018, 08:29:11 PM »
A little further on, there are the following lines:
Code: [Select]
if (kStats.has_key('DamageRadMod')):
pShip.SetVisibleDamageRadiusModifier( kStats['DamageRadMod'] )

if (kStats.has_key('DamageStrMod')):
pShip.SetVisibleDamageStrengthModifier( kStats['DamageStrMod'] )

These take over the damage values directly from the script for the spaceship.

Code: [Select]
#################################################
Ship = App.ShipProperty_Create("Ship")

Ship.SetGenus(1)
Ship.SetSpecies(1)
Ship.SetMass(100.000000)
Ship.SetRotationalInertia(10000.000000)
Ship.SetShipName("BlahBlah")
Ship.SetModelFilename("data/Models/Ships/BlahBlah.nif")
Ship.SetDamageResolution(15.000000)
Ship.SetAffiliation(0)
Ship.SetStationary(0)
Ship.SetAIString("NonFedAttack")
Ship.SetDeathExplosionSound("g_lsDeathExplosions")
App.g_kModelPropertyManager.RegisterLocalTemplate(Ship)

But I think it's nice to use the values from the hardpoints. After all, the methodes SetDamageResolution/GetDamageResolution is not used anywhere else. It is an artifact from the C ++ source code of the game. Also SetAffiliation / GetAffiliation is useless. The programmers have incorporated that, for some unknown purpose, but never used it.
I am still considering for which purpose I will use these values.


Offline Tethys

  • -=USF=- Co-Leader
  • Posts: 256
  • Cookies: 89
Re: Changing Stock Scripts
« Reply #3 on: March 31, 2018, 08:42:54 PM »
Mark, while you're messing with visible damage and such, (if it's not too inconveniencing for you) maybe you can shed some light on why model damage is not visible in multiplayer games? I think I asked someone this question many, many years ago, but since forgot the reason. Perhaps you might already know the answer, or may stumble upon new information during your project. You are doing great work also.  :Metal:

Offline Mark McWire

  • Posts: 83
  • Cookies: 1010
Re: Changing Stock Scripts
« Reply #4 on: March 31, 2018, 09:09:41 PM »
In multiplayer the visible damage in the game engine is switched off. This can not be influenced by scripts, as this is in the exe file. I think its to prevent the GPU-utilization and the network data stream to go too high. You should not forgotten that the game was developed between 1999 and 2001. Long before broadband Internet access.

Offline CMDR CHESS

  • Posts: 34
  • Cookies: 3
  • "With the first link, the chain is forged..."
Re: Changing Stock Scripts
« Reply #5 on: March 31, 2018, 11:37:42 PM »
Oh, such a Great Point. Loads of people do one of two things. Ask why something isn't so good? The answer: Because it's kinda old. Why Can't I have faster "this", nicer looking that" Will, people always think that is should be better, great okay. But, are disappointed or surprised that it will not hold up under so much additions. Or, they thinks it's totally useless because it's so old. But, really it's not. The Game essentially allows you to create, modify so much to where it's all your work, your setting - everything.

Offline King Class Scout

  • Posts: 1775
  • Cookies: 893
  • the other half of SFRD
Re: Changing Stock Scripts
« Reply #6 on: April 01, 2018, 09:13:04 AM »
ah, good.  I was wondering when Mr. McWire would get to game scripting tweaks.  believe me, one of my mods has a horrible damage glitch when it blows.  sometimes, when a ship blows or looses something like a nacelle, you'll see the piece shear off, but the original doesn't actually leave the model with a derez.  wish I could test this idea out, but all of my stuff is locked up on another hard drive.
OS novel fan

Coming Soon: King's Mod Tuning Shop

best line I've ever read
Me: mine [my bridges] would probably be simple to get the characters to use.  the only person that sits is the captian.
Baz: space is vast there[sic] legs will be tired by the time they get to the next planet