3 Idiots Full Script

0 views
Skip to first unread message

Carin Mita

unread,
Aug 5, 2024, 12:44:59 AM8/5/24
to presunathcres
HiI want to automate some scenes in Stellarium for use with a "Sky Guide"

PowerPoint presentation that I will be giving to my local astronomy club once

every 3 months. It would be great to open the show with a view of the night

sky looking south at say midnight on each night of the following 3 months so

that the constellations run across the screen, without the daylight hours etc.


I guess that I need to write a script to do this. In a previous life I was a

software developer using C++ and would like to get started with scripting in

Stellarium. I have played with the script console window and loaded and run a

few of the supplied scripts so have a very basic understanding of what's going

on.


Is it possible to move the observer's location in the z axis by several hundred lys so that I could "fly" out passed constellations to demonstrate their three-dimensionality, ie. see them changing into an unrecognisable shape?


Another way is to write the script using a text editor, like notepad++ and

saving the script file in the stellarium user directory (see the first line of

your log in the help window to know where is the user directory). then execute

from scripts list in configuration window.


Observer locations can be on Earth, Solar system objects, and a location

called "Solar system observer" which is a location 334 AU above the solar

system. To be on any of these locations, select the location and then Ctrl+G

will take you there


I do not know if you can hide the script console from within the script, you

can toggle it off manually when the script is running, but if your script is

tested and ready you can save it and execute from the script list with the

option "close window when script runs".


1> If I use StelMovementMgr.autoZoomIn(6) to zoom into a planet that I have

previously selected and then zoom back out again.

and then use StelMovementMgr.setFlagTracking(false)

Then I change the time of the display the Earth (landscape) moves with the sky

as I appear to still be tracking the object, instead of remaining stationary

while the sky moves.

Any ideas on how to fix this problem?


2> When I save my scripts I can't find them from Windows Explorer so I can't

email them to anyone. I have noticed that when I go to load a script all the

ones that I have saved have got padlock symbols on them. Is this why I cant

find them from Windows Explorer?


Hi Kajaji,

I have now got most things sorted out in my script that I am writing for a Sky

Guide for my astronomy club however I am also writing one for the Transit of

Venus and I am having major problems with the timings when I vary the Time

speed to speed up the rate of sunrise (in the UK the Sun rises with the

transit more than 3/4 of the way through. Then I slow the rate down a bit and

zoom in on the Sun as it rises and then I wait until after 4th contact and

then speed it up again slightly before zooming back out. (By the way by using

an autoZoomOut() after each autoZoomIn() followed by a setFlagTracking(false)

I appear to have cured the intermittent issue with the continued tracking of

objects that have been focused on by autoZoomIn(). Many thanks for that lead!


I have a python script that I use to pull info from my alarm system into MQTT which I then use in Home Assistant. I always used to call this from home assistant. They have now changed HA so that scripts can only run for 60 seconds and this needs to keep running. Has anyone any advice on how I could do this natively in unraid?


So far as the python part goes my recommendation is to use a python docker container to run your python script in. So you would create a User Scripts script to launch your python script, but rather than call it directly you would do something like


you need tamper or grease monkey first

then you need to install the open framework

when you go to any script after this, once you clcik on it, then click install, it should just appear in your list


I did notice that you list Judgement Day as one of the scripts, and it appears to be outdated. @Kumirei will probably know more about that. You could try disabling it for now and see if the other scripts work without it.


You already listed it under the outdated section there, so I think you should be fine, although there are some forum posts that link directly to the GreasyFork page, which is probably why some people might miss out on that.


Your work sounds cool. Have you got a website or online presence? Would love to check out your label. I work in performance and sound curating in the UK, and am also learning Japanese to make visiting and scouting Japanese performance art more accessible directly. Plus, obvs am hooked on the culture and language. Would love to see what you do and listen to some of the artists on board.


All I need, is a basic, simple, for non scripters, (or newbie scripter) no frills, bog standard way of spawning a single unit, or a group at a definable point on the map. Called from a trigger. Not for multiplayer, not for respawning.


I did use the search function, but I just couldn't find a simple explanation. I know the info is there in some of the scripts and examples from these searches, I just can't work out what it is I need out of them, (most seem to be scripts for spawning and something else.


Ah, I got just what you need! I wrote it for one of my non-existant missions that I will probably never ever complete due to an inability to focus. Its not perfect and probably a little overdone (could find out if its a vehicle automatically), and it uses a global variable because I couldnt get it to be passed locally, but hey it should work.


To use it you simply make a squad or vehicle in the editor, use the script in the init and set the proper trigger variable. In my case I use "mis_pavlovo", but you can name it anything of course. Waypoints and such are regular editor waypoints. The script will store waypoints and unit attributes, delete the unit, then respawn it after the trigger.


And all those assume icky markers all over the map, manually generated waypoints (possibly even more markers) and fidgeting with the different troops cfgs, knowing their names and so on... Just saying. I think my script is better ;)


However...heh :), for some reason I cant get it to spawn WEST units! Its not your scripts because I change the examples you give in the first 2 scripts to spawn EAST units instead of WEST and it works fine. Ive tried spawning both sides with a player from BLUFOR & OPFOR. Same result, can only get EAST units to spawn. Im calling the .sql files right because I tried placing triggers over the markers where the units get spawned and using the spawned units to activate the next trigger, had it working with 5 .sql files being triggered one after the other.


Also by placing a hint "active"; line at the end of each .sql I'm ensuring the scripts are being called from the trigger. I checked and double check the syntax, and again, no go with WEST units, but fine with EAST, (I've not even tried with the other factions yet).


Its just an editor map btw, no pbo. The scripts themselves should be self explanatory and with simple editing using just the editor (ie not even touching the scripts!) you could make a 100+ unit battle on Utes very easily. There's three triggers on the map which will:


3. Spawn 3 M1A1 and 4 or 5 (cant remember lol) T90, making both sides attack each other while 1 of the M1s just drive into the airfield and more than likely get himself killed. Or actually all M1s will get killed ;)


Murklor, thanks again mate, been playing with that example for a bit, I'm still lacking total understanding of it, but I'm picking bits up. I know how its working, I just have to try and get why its doing what its doing...if that makes sense.


Thing is though, while Im trying to learn this stuff, I'm putting a hint "active"; line at the end of all the scripts, just to check they are being called, this one though, I'm not even sure its being called as I'm not getting my hint on screen. If you get it working though...let us know. :)


Its not a complicated thing, you really dont need to know what its doing as long as you can set a variable to false at the start of the mission and alter the script to react to that variable. The rest is done in the editor.


@Murklor Yes mate I agree totally Your script is much better than mine. Mine were just very basic stuff, real beginners scripts, spawn your first unit, create a simple group etc. I read the question and thought that maybe this was what Bascule42 was looking for.......then again maybe I just misunderstood ;) .


@Fenrir Your trying to create a load of different Vehicles, so your bringing in complexity, they will be all empty so you would need to create crews as well, more complexity. So these basic scripts become very cumbersome. Therefore you would need to use something like Murklor's script. But if you just want to spawn a tank use


(By the way all.. I'm still taking the title of the thread as meaning Very Basic stuff, apologies if my answers are not what your looking for) kylania's tip about bis functions is well worth looking into for sure.


Just had a quick run through some of the examples above, and yes, am now getting units from all factions spawned into the game. Vehicles too. So..regarding the OP. Mission accomplished. What next, well, run through the above a few more times, and the links of course try to write a few from scratch based on what you guys have posted. Them I'll probably have more questions! :)

3a8082e126
Reply all
Reply to author
Forward
0 new messages