Toggleable Printto

Freeform discussion about anything related to modding Transcendence.
Post Reply
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Hey, I'm kinda super sleep deprived so I was just wondering if it was possible to make a function that would act like PrintTo except that I would be able to toggle it on/off.
My current idea would be to just stick it in globals and then mess with the lambda but right now this isn't working for some reason :S

Code: Select all

(setq tbug (lambda (expression) (block (Return)
		;to use, switch from enabling PrintTo to Nil and vice versa
		(setq Return (PrintTo 'log expression))
		;Nil
		Return
		)))
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

I thought tha printTo was run only in debug mode and not run when normally playing ?
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

I think that change was reverted because I still need to log stuff in-game to catch for rare bugs.
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
User avatar
Arisaya
Fleet Admiral
Fleet Admiral
Posts: 5535
Joined: Tue Feb 05, 2008 1:10 am
Location: At the VSS Shipyards in the frontier, designing new ships.

Code: Select all

<Global>
   ;;;This toggles RPCPRintTo;;;
   (setq RPCPrintToggle (lambda Nil (block (State)
       (setq State (objGetData gPlayership 'RPCPrintState))
       (if (eq State 1)
           (objSetData gPlayership 'RPCPrintState 0)
           (objSetData gPlayership 'RPCPrintState 1)
       )
   )))
   ;;;This toggles it on
   (setq RPCPrintOn (lambda Nil (block Nil
      (objSetData gPlayership 'RPCPrintState 1)
   )))
   ;;;This toggles it off
   (setq RPCPrintOff (lambda Nil (block Nil
      (objSetData gPlayership 'RPCPrintState 0)
   )))
   ;;;This prints if on
   (setq RPCPrintTo (lambda (Expression) (block (State)
       (setq State (objGetData gPlayership 'RPCPrintState))
       (if (eq State 1)
           (printto 'log Expression)
           Nil
       )
   )))
</Global>
(shpOrder gPlayership 'barrelRoll)

<New tutorials, modding resources, and official extension stuff coming to this space soon!>
Post Reply