Author Topic: Sun Lightning Changes  (Read 689 times)

If I change color, azimuth, etc of the Sun object, how would I simulate a click of the Apply button (server-sided)?

Just delete and re-create it. Same for the skybox if you're looking to tamper with that too.

If I change color, azimuth, etc of the Sun object, how would I simulate a click of the Apply button (server-sided)?

To literally simulate the apply button (must be a listen server, not dedicated):

Code: [Select]
tree();

InspectTreeView.onSelect(%sun);
InspectFields.setAllGroupStateScript(%sun,1);
InspectStaticcolor0_16.setValue("0.6 0.6 0.6 1");
InspectStaticambient0_16.setValue("0.5 0.5 0.5 1");
InspectApply();

canvas.popDialog(InspectDlg);

There's supposedly an inspectPostApply method but it's never worked for me.

to simulate the apply button, i normaly go and find the console command with the gui editor :D

Is there any way to do this on dedicated servers?


No, that function does not fix it.
Secondly, that announces a global message.

Nevermind, found it myself.
Code: [Select]
   if(!isObject(Sun)) {
      for(%i=0;%i<MissionGroup.getCount();%i++) {
         %obj = MissionGroup.getObject(%i);
         if(%obj.getClassName() $= Sun) {
            %obj.setName("Sun");
            break;
         }
      }
      if(!isObject(Sun))
         return;
   }
   Sun.setName("Old_Sun");
   new Sun(Sun : Old_Sun) { color = %sun SPC %sun SPC %sun SPC 1; };
   Old_Sun.delete();

Nevermind, found it myself.

That is exactly what Amade told you to do over 13 hours ago.

Tom

You might want to try to mess with this for a less hacky method:
Quote
Added consolemethod simObject.inspectPostApply - Simulates clicking 'apply' after making changes in the editor.
I don't know if it will work or not.

That is exactly what Amade told you to do over 13 hours ago.
Or he could have looked at the Day/Night Slate script I gave him months ago, made by Amade, that does exactly what Amade told him.

Sun lightning?

Is that lightning that comes right from the sun?

Sun lightning?

Is that lightning that comes right from the sun?

Don't pick on Flaw.

Sun lightning?

Is that lightning that comes right from the sun?
Your avatar describes this anwer pretty well.