Author Topic: can we name shield generators whatever we want?  (Read 4539 times)

0 Members and 1 Guest are viewing this topic.

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: can we name shield generators whatever we want?
i didnt know that, i thought it always used the $name: field from subsystem properties. ive looked at it again and it seems youre right. its probibly a throwback to fs1. rather than changing the name fields, they just hacked in the engine to determine what weapon was used and name the gun accordingly. perhaps an optional display name field in the table?

It is indeed hardcoded in.

The change I made was to add a $Subsytem alt name setting to all subsystems. That allows you to name the subsystem whatever you want. For instance



The problem is the the log. The log will still call the subsystem by its original name, not the alt name. If I change this behaviour various SEXPs will fail as they check the log to see if a subsystem was destroyed.

That said after a chat with Wanderer I think I'm going to commit what I have now anyway. It's still useful in-game even if the log is writing the wrong info.


Maybe I'm being silly, but, can you make the log display info like the internal coding?  I mean, if it is Radio#comm, have the log display "Radio", but still internally invisibly have "comm", and therefore not break code?  Sort of like how colors are displayed in briefings?  IDK, I'm not a coder, so I'm probably spouting nonsense, but... well, would it work?  Or not be worth the hassle?

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: can we name shield generators whatever we want?
There's a simple solution.  Write the regular name to the log, and keep the alt name for purely display purposes.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: can we name shield generators whatever we want?
Yeah but I don't much like that. If you go to all the trouble of renaming all your subsystems to proper working names it kind breaks the illusion if the log insists on outputting the wrong name. :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: can we name shield generators whatever we want?
ah the joys of yet another :v: hack-fix
that is assuming this is something theyre responsible for :D
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: can we name shield generators whatever we want?
(1) Add a 'subsystem type' integer to the subsystem structs, parse the original name on load, and set flags appropriately.

That way the original name can be changed immediately after the subsystem is loaded from the tbl, you get rid of extraneous stricmp() operations to determine what function the subsystem is supposed to have, and you centralize all the different subsystem functions (and toggling) to fewer locations in the code. If you need to look for what happens when you blow up an engine subsystem, all you need to do is do a search for SSF_ENGINE.

You could also add a 'display name' field for in-mission name changes later on, which wouldn't break the log, and wouldn't require a third 'subsystem name' char array.
-C

 

Offline Hippo

  • Darth water-horse
  • 211
  • Grazing.
    • All Hands to War
Re: can we name shield generators whatever we want?
There are some huge sigs in this thread.
VBB Survivor -- 387 Posts -- July 3 2001 - April 12 2002
VWBB Survivor -- 100 Posts -- July 10 2002 - July 10 2004

AHTW

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: can we name shield generators whatever we want?
Now, now, don't be jealous.  You can make your sig just as big, if you so desire.  At least mine is useful, for the most part.