Author Topic: Code questions  (Read 2564 times)

0 Members and 1 Guest are viewing this topic.

Hello there. I've been working on a newtonian physics mod and, as you'd expect, keep running into the "desertion is grounds for court martial" issue. From what I hear, it's very easy to increase the gameplay area limit using scripting.tbl, but I have only the most basic understanding of C++, and not nearly enough knowledge of Lua or the FSO code structure. So one request: can someone tell me exactly how to increase the gamplay area limit from 300,000 m to some obscenely large distance? I've found that you can place AI ships out to about a billion units before the game crashes.

If you have the time, it would also be nice to know how to increase the object limit in FRED.

 

Offline Skullar

  • 29
This must be one of these "ultra-realism"-maniacs ( no offense )

Set course for the jumpgate, go to sleep, reach there when you wake up in the morning ! :)

 
#Ship Classes

$Name: GTF Erinyes
+nocreate
$Velocity: 4000 , 4000 , 4000
$Damping: 4.0
$Turn Time: 2, 2, 2

#end

 :nervous:

I don't think I'll have to wait till morning to get there.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
If you have the time, it would also be nice to know how to increase the object limit in FRED.

You can't. The change needs to be made in code

Code: [Select]
// this function checks to see how far the player has strayed from his starting location (should be
// single player only).  Issues a warning at some distance.  Makes mission end if he keeps flying away
// 3 strikes and you're out or too far away
#define PLAYER_MAX_DIST_WARNING 700000 // distance in KM at which player gets warning to return to battle
#define PLAYER_DISTANCE_MAX_WARNINGS 3 // maximum number of warnings player can receive before mission ends
#define PLAYER_MAX_DIST_END 750000 // distance from starting loc at which we end mission
#define PLAYER_WARN_DELTA_TIME 10000 //ms
#define PLAYER_DEATH_DELTA_TIME 5000 //ms

All you'd have to do is to change the distances from 700 and 750km to whatever you wanted. I've got no idea what kind of knock on effect that would have though.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 
Thanks a lot, KJ. Super Lightspeed BoE of Doom coming up!  :pimp:

What I need to figure out, though, is what exactly to put into scripting.tbl. I'm trying to get something out of the Wiki scripting tutorial, but it isn't too helpful with this. So far it looks like I have to redefine PLAYER_MAX_DIST_END/WARNING at game start. Something like this:

#Conditional Hooks
$On Game Init: [
PLAYER_MAX_DIST_END = 10000000
-- that's ten million
PLAYER_MAX_DIST_WARNING = 10000000
]

#End


But I really have no idea what I'm doing, so a copy-and-paste scripting.tbl example would help.

 

Offline Turey

  • Installer dude
  • 211
  • The diminutive form of Turambar.
    • FreeSpace Open Installer Homepage
Thanks a lot, KJ. Super Lightspeed BoE of Doom coming up!  :pimp:

What I need to figure out, though, is what exactly to put into scripting.tbl. I'm trying to get something out of the Wiki scripting tutorial, but it isn't too helpful with this. So far it looks like I have to redefine PLAYER_MAX_DIST_END/WARNING at game start. Something like this:

#Conditional Hooks
$On Game Init: [
PLAYER_MAX_DIST_END = 10000000
-- that's ten million
PLAYER_MAX_DIST_WARNING = 10000000
]

#End


But I really have no idea what I'm doing, so a copy-and-paste scripting.tbl example would help.

You can't do it with scripting. It needs to be done in-code, and a new build needs to be compiled.
Creator of the FreeSpace Open Installer.
"Calm. The ****. Down." -Taristin
why would an SCP error be considered as news? :wtf: *smacks Cobra*It's a feature.

 
Hm... the only reason I would ever need to use Scripting.tbl, and it doesn't even work.

Building a whole new EXE just for this tiny mod would feel cool though. In a "lulz i killed the hades with an ml16" kind of way.

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Sounds like a FRED mission setting to me.
-C

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Ask taylor to integrate it into the next build.  :nod:  As either a command line option or a FRED mission setting.  Preferably a FRED setting.  If it's not set, it reverts to the default value.  This makes it backwards compatible.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Sounds like a FRED mission setting to me.

Yep. I don't think it would be very hard to give FRED the ability. But then we'll get people complaining about bugs when they've set missions 1 million km from origin and they're getting strange errors due to float and double precision. We could put it in but it would have to be with the warning that we're basically going to ignore any of those errors unless they can be duplicated close to 0,0,0

Admittedly those might be less of a problem if Razorjack is still working on his changes.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Here's hoping he is.  *crosses fingers, raps them on desk*