Nexus: The Jupiter Incident

Nexus: The Jupiter Incident

Nexus:TJI Modding
Hi Folks,

For those interested in modding Nexus, you can find some guides and info in the NexusWiki [nexusthegame.net].

Some of the links on the right of the home page are now dead unfortunately but the rest should still be ok.
< >
Showing 1-15 of 43 comments
TehnoMag May 15, 2016 @ 1:41pm 
Found Some interesting functions, that working in compaign side scripting, but never documented.

uCamera_Enter(UNIVERSE_OBJ) - Switch from map to location without mission loaded
uCamera_PutInto(UNIVERSE_OBJ or System) - Same as Enter, but working as location - location switch. Or you can exit from location to map if you pass System object as argument.

uCamera_GoTo(UNISVERSE_OBJ or System, ?) - transfer camera to object. Second paramer are needed but unknown. May be it is Event dispatcher

uCamera_LookAt(UNIVERSE_OBJ, ?, ?, ?) - it seems that is Goto advanced function. For parameters are needed. First - univesrse object. Other 3 are unknonwn - need investigate.


UPDATED:
uCamera_Enter / uCamera_PutInto

They loading MISSION 99 and use events and rules are defined there (099___view.mission in original campaign)

UPDATE2
If you define MISSION 99 in you mod. uCamera functions will be working. Mb its chanse for compaign scriptiong without override original campaign. I am trying it later

UPDATE3
Hm... Maybe i am wrong... If mod are loaded, functions calls crash the game. Mb it was becouse story rules are didnt loaded in mods...
Last edited by TehnoMag; May 15, 2016 @ 2:27pm
TehnoMag May 15, 2016 @ 10:34pm 
Another function - uDialog. It work as Dialog function, but work only in Universe script level. But DialogBox will apper only with gui id != 2 and 3.

It usefull if you want to say something on galaxy layer or FleetConfigurationScreen.

Dialogs with answers are work to, but back event call did not generate (or i didn`t now how to catch them).
TehnoMag May 19, 2016 @ 6:17pm 
And another feature. uCall Function (actualy it is documented in official manual in mod_tools/doc directory but some missing).

Rules called from mission script with uCall function must be placed in strategic/subroutines/*.ini files. It is global and may be used in mod missions and campaign for creating global Rules for whoil set of missions.

For example, i use it for randomly generated submisshions

Note: Mission functions and events and story events (but functions work!) can`t be called from subroutins! If you want, you can define some variables in U scope or using Return() fuctions for callback something from subroutines.

And latest: If you need send to event more then one variable, you can create valid structure object:

Example:
struct := "somestring" - it need for creating pool of new structre. I recomend define something like "struct/structname". And check type by var name in target rule with string related functions
struct:variable := something - Just put here value you want.
struct:variable2
...

and then just call rule with new var sets.
LocalEvent(RuleName, struct); [or uCall(SubroutineRuleName, struct)]

In event all vatset will be valid and cood be cheking by isValid() function.
TehnoMag May 21, 2016 @ 1:16pm 
Okay. Another post about uCamera functions.

Note1: They work normaly only in editor mode. In game we have some issures in latest version, but in original version 1.01 its work just fine.

Note2: In latest version:

uCamera_Enter. Only work if you call it from story script. Actualy it work like this:
=> Call uEnterMission(99);
=> Loaded mission 99 and crash if mission file dos not been loaded or broken
=> Push DefLocation with location name geted from uCamera argument
=> Starting rules and generate events as normal mission


uCamera_puttInto: Work in map screen if we put location reference in arg list and tactial screen if we put Nexus reference in argument list. Example: uCamera_PutInto(uGet("Nax_Aplha")). And it work in Nexus if we put location reference in arg list

Example:

MISSION 42
Name "loc switch test"
DefLocation "nex_alpha"

RULES
...
RULE event SwitchToSol
:action
uCamera_PutInto(uGet("Earth"));
:end
END

END

of couse MISSION 99 must be defined with right ruleset.
TehnoMag Sep 10, 2017 @ 6:12am 
New info about UCamera and mission 99

I finally know how do system navigation from starmap screen.

Its wery simple:
We just need set detectionlevel of UObject to 5.

RULE event EpisodeStart condition ActEpisode=1 :action sel := GetFreeSel(); uSelect(sel, uGet("sys_sol"), S:celestial()|S:colony()); ExecList(sel, S:uSetDetectionLevel(#UDET_SPYCAM)); :end END

And some tricky button appear on map. Its called SpyBtn and they dirrectly loaded mission 99 with selected location from starmap ui
here: https://drive.google.com/file/d/0B4OB1Xq0PKkPWXVZbm1iXzlVTFU/view?usp=sharing

In mission 99 we must define some rule that brings us back to map.
I found function QuitMission() (not uQuitMission). It work only with mission 99 and bring us out from scene (but we need manualy switch gui to 2)

here we are

MISSION 99 name "Zoomed View" RULES RULE event SceneInit :action station := getStation(); If(station, LocalEvent(StationAnim, 0), LocalEvent(FormFleet, 0)); StartTimer(Out, 1, 0); :end END RULE event Out :action QuitMission(); GuiSelect(2); :end END

But offcose we have some issures

1) Scene load all children locations by default.

Example:
We added station to Io orbit
We fly to Jupiter.
Station from Io, well be placed into Jupiter scene
And we coud not use the HideLocation command, becose we do not know wich location we are.

2) If we flying to the celestial body we apper in center of it.
Last edited by TehnoMag; Sep 10, 2017 @ 6:39am
TehnoMag Sep 11, 2017 @ 11:38am 
New undocumented function was found

isat(uObject);

it is return 1 if Universe Object placed insde another Universe Object

Example of usage - finding fleet location in universe

RULE event In :action U.PlayersFleet.System := 0; U.PlayersFleet.Location := 0; U.PlayersFleet.Orbit := 0; verse := GetFreeSel(); //Get all objects thats conatin fleet uSelect(verse, uGetUniverse(), uGetPlayersFleet():isat(S.this)); //GetFirst objects U.PlayersFleet.System := PickFirst(verse); //Get First Celestial object (cos obj list reversed) obj := GetFreeSel(); CopyIf(obj, verse, S:Celestial()); U.PlayersFleet.Orbit := PickFirst(obj); Empty(obj); //Get Last Tactical object CopyIf(obj, verse, !(S:Celestial() | S:System() | S:Nexus()) ); if ( NumOf(obj), ( U.PlayersFleet.Location := PickN(obj, NumOf(obj) - 1); ) ); Empty(obj); Empty(verse); Debug("pFleet.System", U.PlayersFleet.System); Debug("pFleet.Orbit", U.PlayersFleet.Orbit); Debug("pFleet.Location", U.PlayersFleet.Location); :end END

System - Current System or Nexus
Oribt - Planet or Moon
Location - station, navpoint, asteroidfields, another fleet etc

If Fleet orbiting Earth we get

pFleet.System system/sys_Sol pFleet.Orbit celestial/Earth pFleet.Location 0

if Fleet near Michelangelo (and Michelangelo not been placed into asteroid field) we get

pFleet.System system/sys_Sol pFleet.Orbit celestial/Europa pFleet.Location station/Michelangelo

if in Pluto asteroidfield

pFleet.System system/sys_Sol pFleet.Orbit celestial/Pluto pFleet.Location asteroidfield/astfld_Pluto
Last edited by TehnoMag; Sep 11, 2017 @ 12:25pm
TehnoMag Sep 11, 2017 @ 2:29pm 
More useful example with OOP emulation "Get parents of any universe object" (Recommended place in Strategy/Subroutines/[filename].ini and call it with uCall function)

RULE event FindObject.GetSystem condition isValid(E.uObj)&E.uObj:uType() :action FindObject := 1; uCall(FindObject.FindObject_private, E.uObj := P.uObj); Return(FindObject.System); FindObject.System := 0; FindObject := 0; :end END RULE event FindObject.GetCelestial condition isValid(E.uObj)&E.uObj:uType() :action FindObject := 1; uCall(FindObject.FindObject_private, E.uObj := P.uObj); Return(FindObject.Celestial); FindObject.Celestial:= 0; FindObject := 0; :end END RULE event FindObject.GetScene condition isValid(E.uObj)&E.uObj:uType() :action FindObject := 1; uCall(FindObject.FindObject_private, E.uObj := P.uObj); Return(FindObject.Scene); FindObject.Scene := 0; FindObject := 0; :end END RULE event FindObject.FindObject_private condition isValid(E.uObj)&E.uObj:uType() :action FindObject.System := 0; FindObject.Scene := 0; FindObject.Celestial := 0; verse := GetFreeSel(); //Get all objects that contain E.uObj uSelect(verse, uGetUniverse(), E.uObj:isat(S.this)); //Get system object FindObject.System := PickFirst(verse); //Get First Celestial object (cos obj list reversed) obj := GetFreeSel(); CopyIf(obj, verse, S:Celestial()); FindObject.Celestial := PickFirst(obj); Empty(obj); //Get Root TScene Object CopyIf(obj, verse, !(S:Celestial() | S:System() | S:Nexus()) ); if ( NumOf(obj), ( FindObject.Scene := PickN(obj, NumOf(obj) - 1); ) ); Empty(obj); Empty(verse); :end END

Call example

//Correct system := uCall(FindObject.GetSystem, E.uObj := uGet("Earth")); //variable system will be initialized with object system/sys_sol //Incorrect system := uCall(FindObject.GetSystem, E.uObj := GetSceneObj("ship_Stiletto")); //variable system will not be initialized //Forbidden uCall(FindObject.FindObject_private, E.uObj := uGet("Earth")); //this call return 0 anytime. All variables under FindObject. also be uninitialized and cannot be accessed from anywhere.
Last edited by TehnoMag; Sep 11, 2017 @ 3:01pm
TehnoMag Sep 12, 2017 @ 1:37am 
New undocumented function was found

uGetC(objname)

return universe object if object with name `objname` is a child.

Example:
uGet("Earth"):uGetC("moon") return - celestial/moon uGet("Sol"):uGetC("moon") return celestial/moon uGet("Earth"):uGetC("Mars") return 0
Last edited by TehnoMag; Sep 12, 2017 @ 1:37am
TehnoMag Sep 12, 2017 @ 8:06am 
Helper function for detect and return current orbit direction in rotation format

Why ? Cos Direction 4 in FLEETENTRY did not work

NOTE: All orbits direction clockwise

RULE event OrbitDirection.Get :action OrbitDirection.sel := GetFreeSel(); OrbitDirection.tester := CreateShip(#styp_ST_Stiletto_Corvette, #race_Player, "tester"); AddItem(OrbitDirection.sel, OrbitDirection.tester); ArrangeShips(OrbitDirection.sel, 0, #FLENTRY_ORIGIN); OrbitDirection.rotation := OrbitDirection.tester:orientation; OrbitDirection.rotation:heading := OrbitDirection.rotation:heading + 90; OrbitDirection.rotation:bank := OrbitDirection.rotation:pitch; OrbitDirection.rotation:pitch := 0; Return(OrbitDirection.rotation); Empty(OrbitDirection.sel); DeleteShip(OrbitDirection.tester); :end END

USAGE EXAMPLE
RULES RULE event SceneInit :action SetSceneRadius(500000); //500 Km OrbitDirection := uCall(OrbitDirection.Get, 0); SceneTransform := xfRot(OrbitDirection, 0, 0); ship := GetSceneObj("Stiletto"); shipPos := vxForm(Vec(0,0,-10000), SceneTransform); PutShip(ship, shipPos:x, shipPos:y, shipPos:z, OrbitDirection:heading, OrbitDirection:pitch, OrbitDirection:bank); ship:tMoveTo(0, 0, 0, 0); :end END END FLEETENTRY #FLENTRY_ORIGIN Gate 0 0 0 0.000 0.000 0.000 Direction 2 END ENTITIES SHIP Name "Stiletto" //Player test ship Race #race_Player ShipType #styp_ST_Stiletto_Corvette END END
Last edited by TehnoMag; Sep 12, 2017 @ 10:29am
TehnoMag Sep 14, 2017 @ 12:16pm 
Ok. I finally managed how to do moving fleet from one place to another. Need some polishing and debuging but it seems to work.

1) We must be in 99 mission (or Spycam mode)
2) We must disappearing all ships
3) We must select all Utypes objects from current system (or by condition colony/celestial etc)
4) Add navpoints for all objects
5) Enable Gui Events and wait for selection
6) Catch Selection event and show Tutorial dialog for distatanation conformation
7) Calculate time to travel in days (in weeks?)
8) Return to starmap via QuitMission
9) Push EnterMission button . It will play briefing with transfering animation and date sliding
Note: in 1.01 we may access variables from briefing but in latest version it is not work. I write briefing with length 1 week; with fake unvisible navpoint called 'location' and 'destination' . and play it in loop. Fleet moving from location point to destination point in stages.
10) wait or skip briefing and update fleet position and other Univers variables (moving another fleets, generate random events, mission step, etc)
11) Do other staff

I think, after finish with this i will publish alpha version into Workshop.

ADD
2.a) Before dissapering ships we must check 2 things
a) check if own ships leaved some predefined area (i think 10 or 20 km from scene origin)
b) check if enemy ships are not detected by player or enemy ship in some range from us
if all condition are true when continue. if not then abort.
Last edited by TehnoMag; Sep 15, 2017 @ 3:40am
GeoModder Sep 17, 2017 @ 4:40am 
Hi TehnoMag.

Unbelievable to see someone is still modding this game on that level.
From the look of it, you're pretty close to the contents of a "Conquest" mod someone did for the Disc version of the game years ago.
TehnoMag Sep 17, 2017 @ 5:52am 
Originally posted by "GeoModder":
close to the contents of a "Conquest

yes it is, but this mod more complex, cos we do not need hardcore points of interest
Last edited by TehnoMag; Sep 17, 2017 @ 5:52am
TehnoMag Sep 17, 2017 @ 6:13am 
The main difference between `Sandbox` and `Conquet` are
0) Player can freely go anythere in system. But it take some time (related on techlevel)
1) Story Missions related to Universe time (like Elite3: FFE campaign)
1a) Plans to BBS missions to
2) Random events such pirates attacks
3) Research. With original ships we can split game on 3 stages
a) Tech1 - No shields, no IP-drive, no jump gates etc
b) Tech2 - Shilds, IP, and wormholles to travel to another systems
c) Tech3 - Angellwing and other aliens ships are playable, Have Jupgate access (throw Nexus) and FTL technology
4) Economy and mining
Player can add special ships to own fleet that compable care cargo or mining lisers (or may be special wing, i do not know yet)
5) Station building (need for research, ship construction and system surving) and updates
Last edited by TehnoMag; Sep 17, 2017 @ 6:15am
TehnoMag Sep 19, 2017 @ 8:44am 
Another note about fleet transfer
Travel time calulation

From documentation we know about 4 variables year, month, day and global time in Universe scope.
and we have function for set current date (uSetStoryTime).
NOTE: If day more then max days in month then month increment by 1 and day reset to 1 (do not know about year variable yet).
How it`s work:

We must copy SemiMajorAxisKM, MeanAnomaly and OrbitPeriodD paraments of all planets and moons into some global structure (cos i do not found any way for access those from stock scripts)

On tactical screen in navigation mode after destination was set, but not confirmed by player, we doing next:
Calculate current meananomaly of current celestial body and target celestial body by special function (work in progress).
Calculate distance betwin those bodyes.
Calculate days for transfer by current ship Techlevel and bodyes distances.
Show confirmation `Tutorial` screen with calculated parameter.

After confirmation we must added this to the special upcomming events list and return to map screen.

Then, after Skip time button (EnterMission button) was pressed, we must get most earliest event from list and play animation for this event. Then set story date to event time, execute event and remove it from list.
Last edited by TehnoMag; Sep 19, 2017 @ 8:55am
TehnoMag Sep 19, 2017 @ 5:25pm 
Just publish another helper mod: http://steamcommunity.com/sharedfiles/filedetails/?id=1139081448

I will add all functions which i posted above to them (and manual), but not today already.
< >
Showing 1-15 of 43 comments
Per page: 1530 50