Goto https://www.stucuk.netGoto https://www.atlanticaonlinewiki.comGoto https://www.game-requirements.comGoto https://www.owsupport.com
It is currently Mon Dec 18, 2017 3:47 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 79 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
PostPosted: Fri Jun 12, 2015 3:23 pm 
Offline
Soldier level 0
Soldier level 0

Joined: Mon Mar 30, 2015 7:31 pm
Posts: 42
Location: Spain
I'm finally getting some progress in my mod, which now is not only the elimination of the hud to create a more cinematic experience, but also a change from the original game to a never-ending endurance mission (like the bonus level in my all-time favorite space combat game Rogue Squadron II: Rogue Leader). There are still some wrinkles left to iron out, but I'll keep you posted!

I'm currently working on getting the mod to start without any cinematics or logos and to launch directly into the game.

The problem I am working on is that the mod would launch fine at some times, then at others it would not. I've narrowed it down to a profile (or lack thereof) and/or game save. Is there any way to avoid the game from checking or trying to load a game save, and instead simply load the default settings?

This is the error notification:

General Info
------------
Application : Dark Horizon
Filename : dark_horizon.exe
Version : 1.0.8.0

Params : -MOD ARCADE
ParamCount : 2

System : exp_mission1
FPU State : pmSingle, rmNearest, exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision

Error Info
----------
ErrorText 0 : TPlayer.saveProfile error: ñîõðàíÿòü äåôîëòíûé ïðîôèëü èãðîêà ÍÅËÜÇß!!!!! è ñåéâû òóäà çàïèñûâàòü ÍÅËÜÇß!!!

Exception : None
GetLastError() : The operation completed successfully.


LUA Debug
---------
Debug 3 : Source: setHook("->onLoad->exp_mission1->scene->_G",[[iLoading.Seq(3) saveGame(nil,nil)]]); iLoading.Seq(3) saveGame(nil,nil); emptyHook();
: What: main
: NameWhat:
: LineDefined: 0
: CurrentLine: 1
Debug 2 : Source: @data/Scripts/funcs/game_funcs.lua
: What: Lua
: Name: saveGame
: NameWhat: global
: LineDefined: 20
: CurrentLine: 27
Debug 1 : Source: @data/Scripts/funcs/game_funcs.lua
: What: Lua
: Name: saveGameAdv
: NameWhat: global
: LineDefined: 30
: CurrentLine: 39
Debug 0 : Source: =[C]
: What: C
: Name: engine_Execute
: NameWhat: global
: LineDefined: -1
: CurrentLine: -1


Top
 Profile  
 
PostPosted: Sat Jun 13, 2015 5:33 pm 
Offline
Soldier level 0
Soldier level 0

Joined: Mon Mar 30, 2015 7:31 pm
Posts: 42
Location: Spain
Hi Stuart,

These are currently my most burning questions:

1. How can I force the game to load the default settings and profile (instead of it trying to load a saved profile and throwing an error when there is none available)? This is important when launching directly into a game for the first time...

2. Can I make the game autotarget a next enemy when the targeted one is destroyed? I have eliminated the HUD and need this to function automatically without the player's input...

3. Where can I change the start point of a mission? When launching directly into a game (which has no introduction or cutscene) I want to arrive at the first encounter point and have no need for a lengthy flight to the encounter point during the intro scene...

As always, many thanks for taking the time!


Top
 Profile  
 
PostPosted: Sun Jun 14, 2015 11:51 pm 
Offline
OW Support Owner
OW Support Owner
User avatar

Joined: Wed Dec 28, 2005 11:13 pm
Posts: 4994
Location: UK, Scotland
cornel wrote:
1. How can I force the game to load the default settings and profile (instead of it trying to load a saved profile and throwing an error when there is none available)? This is important when launching directly into a game for the first time...

Its trying to SAVE not load. You have changed something so that its trying to use the profile named default which the game won't allow. You have full control over the saving, you can just disable the lua that makes the game save stuff to the profile (Since you don't need it). You can rip out anything in the lua that won't contribute to what your making.

Why would you even need loading? Given what your trying to achieve you can hard coded everything. The game will load the default profile if there is no other setup. Mods use their own profiles that are separate to the main game (Though it will load the main games default profile if the mod doesn't have one).

cornel wrote:
2. Can I make the game autotarget a next enemy when the targeted one is destroyed? I have eliminated the HUD and need this to function automatically without the player's input...

Actions.lua . Most of the game is done in the lua files, this includes what happens when you press buttons on your keyboard.

cornel wrote:
3. Where can I change the start point of a mission? When launching directly into a game (which has no introduction or cutscene) I want to arrive at the first encounter point and have no need for a lengthy flight to the encounter point during the intro scene...


The game teleports the player to the "mission:start" thats in the system. It should looks something like the following (I never tested it. The game sends a slightly different one from the exe to lua so it doesn't need the getHelperHex as it already has a pointer to the helper)
Code:
engine_PhCommand("playership1","teleport","",getHelperHex("mission:start",loc.currentLocation))


Changing "mission:start" to another location thats set in the map "should" work (See the SystemEd app for the names). Quazar never added in a coordinate system for the commands. All of the commands use "Anchor" points which are pre-set in the map (Which they called helpers). So as far as i understand you can't make the ship teleport 500 units away from the point, you can only place it directly on the point.

_________________
Image
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Top
 Profile  
 
PostPosted: Mon Jun 15, 2015 9:17 pm 
Offline
Soldier level 0
Soldier level 0

Joined: Mon Mar 30, 2015 7:31 pm
Posts: 42
Location: Spain
You said: "Why would you even need loading? Given what your trying to achieve you can hard coded everything."
That's exactly what I would like to achieve! But I don't know how to get the mod started (=working) without a loading.lua... Please help me.

You said: "The game will load the default profile if there is no other setup. Mods use their own profiles that are separate to the main game (Though it will load the main games default profile if the mod doesn't have one)."
I wish that were true. If I try to load my mod without any profile present (except for the default one), the mod throws an error message or freezes at the launch screen!


Anyway, thank you for all the info, Stu. I appreciate your continuous help! I'm going to go by parts: first the last question.

I cannot find "mission:start" (using LuaSearch) in any of the loading or startscript luas from DH... Using SystemEd, I don't see any files or names under "helpers", and only under "BoundingSpheres" the word "start" appears, namely in: "trigger:start"... If "start" is the name of the starting point, then there's no need for the system editor: in the startscript.lua it also says the name:
addEffect("adv_range_condition",{obj="Scene", objs1={{obj="start",radius=7000}...
I tried to change the "obj" (= objective?) to "en1" (which I assume is the name of the first encounter point on the map, as can be deduced from the mission1_1part startscript.lua itself: loc.moveToHelper(loc.pgroup,"1en");) but no change in location was apparent. Any ideas what I'm doing wrong?

My second question was about auto-targeting the next enemy after the targeted enemy has been destroyed. In "actions.lua" I found the "iActions.SelectNextEnemy()" function. I assume you were referring to this. What would the correct syntax be in the lua-language to say: "when the targeted enemy has been destroyed, target the nearest enemy next"?
(There is a function called: "iActions.SelectNearestEnemy"... But "OnDestroyed" seems to mean something like "wave destroyed" or "mission completed", rather then "one enemy destroyed"...)

Concerning my first question: If I have changed something in the game to make it trying to (load or) save at game launch, then it happened unwillingly and I do not know what to change back again :( ...Any idea what I should check?
I have tried to make the game (mod) run without any profiles/saves, but it either throws an error (see my former post), or simply gets stuck at the game launch splash screen. I've tried eliminating the gameload bit from the loading.lua, but that didn't do the trick. I even tried to eliminate completely any function related to saving profiles or settings or game advances, but no dice. I am not a programmer, I don't know visual basic, c++, or any other programming language, and more than half of the lua script is still gibberish to me...
This is my loading.lua:
iLoading = {
Counter,
Par,
DefaultSplash = {
Image = "game_splash",
},
Create = function()end,
Open = function()end,
Close = function()end,
Show = function()end,
Hide = function()end,
Seq = function()end,
Update = function()end,
}

function iLoading.debug(s)
--set("GlobalDebug::text", s)
end

function iLoading.Create()

addControl("paShell->Loading",{
visible = 0,
enabled = 0,
ticked = 0,
left = -1,
top = -1,
width = 1030,
height = 772,
color = "FF000000",
framecolor = clClear,
image = "ui/splash/game_loading_splash",
imageleft = -1,
imagetop = -1,
imagewidth = 1030,
imageheight = 770,
imagecolor = iColors.SplashScreen,
})
end

function iLoading.Open(par)
if par
then iLoading.Par = par
else iLoading.Par = {}
end
if iLoading.Par.loadgame
then --
else --
end
if (iLoading.Par.onFadeToBlack == "") then iLoading.Par.onFadeToBlack = nil end
if (iLoading.Par.onPreLoad == "") then iLoading.Par.onPreLoad = nil end
if (iLoading.Par.onLoad == "") then iLoading.Par.onLoad = nil end
iLoading.Counter = 0
iLoading.Seq()
end

function iLoading.Close()
doublecallback = nil
iLoading.Hide()
end

function iLoading.Show()
set("Loading::visible", 1)
set("Loading::enabled", 1)
set("Loading::ticked", 1)
end

function iLoading.Hide()
set("Loading::visible", 0)
set("Loading::enabled", 0)
set("Loading::ticked", 0)
end

function iLoading.Seq(v)
if (v == nil) then
engine_Sound("Stop", "Radio")
engine_Sound("Stop", "Ambience")
iDesktop.SetMode("imBlack", "iLoading.Seq(1)", {BlackBackground=1}) -- fade to black
elseif (v == 1) then
iLoading.Show()
if iLoading.Par.onFadeToBlack then
loadstring(iLoading.Par.onFadeToBlack)()
end
if not iLoading.Par.splash then
if iLoading.Par.submission then
iLoading.Par.splash = iGame.SplashScreens[iGame.Missions[iLoading.Par.mission].Parts[iLoading.Par.submission].SplashScreen]
else
iLoading.Par.splash = iGame.SplashScreens[iGame.Missions[iLoading.Par.mission].SplashScreen]
end
end
iLoading.Par.splash = add_tables(iLoading.DefaultSplash, iLoading.Par.splash)
set("Loading::image", iLoading.Par.splash.Image)
iDesktop.SetMode("imShell", "iLoading.Seq(1.1)", {BlackBackground=1, NoCursor=1, Mute=1})
iCursor.Hide()
elseif (v == 1.1) then
iTimers.Start(100, "iLoading.Seq(2)")
elseif (v == 2) then
if iLoading.Par.onPreLoad then
loadstring(iLoading.Par.onPreLoad)()
end
iDesktop.PauseOff()
if iLoading.Par.loadgame then
if not iDesktop.onStart then unloadScene() end
loadGame(iLoading.Par.id, "iLoading.Seq(3)") -- loading saved game
else
local parts = iGame.Missions[iLoading.Par.mission].Parts
if iLoading.Par.nextpart then
unloadLocation(parts[iLoading.Par.part-1].Location)
loadLocation(parts[iLoading.Par.part].Location, "iLoading.Seq(3)")
else
unloadScene()
local sceneId = iLoading.Par.id
local locationId = iGame.Sys2Loc[sceneId]
setVar("scene."..sceneId..".locations."..locationId..".loaded", 1)
if iLoading.Par.part then --parts and (iLoading.Par.part ~= 0) then
for i = 1, length(parts) do
if (iLoading.Par.part == i)
then setVar("scene."..sceneId..".locations."..parts[i].Location..".loaded", 1)
else setVar("scene."..sceneId..".locations."..parts[i].Location..".loaded", 0)
end
end
end
loadScene(iLoading.Par.id, "iLoading.Seq(3)") -- loading location
end
end
elseif (v == 3) and (not doublecallback) then
doublecallback = 1
iDesktop.SetMode("imBlack", "iLoading.Seq(4)", { BlackBackground = 1 })
elseif (v == 4) then
iLoading.Close()
iLoading.DefaultOnLoadHandler()
if iDesktop.onStart then
iProfiles.Load()
if iDesktop.DebugStart then
iProfiles.DebugStartCheck()
loadstring(iLoading.Par.onLoad)()
else
system.execute({
-- "iRootMenu.Open()",
"iGame.StartArcade()",
})
end
for i = 1, maxmission do
local sceneId = iGame.Missions[i].Location
for j = 1, length(iGame.Missions[i].Parts) do
if (iGame.Mission == i) and (iGame.Submission == j)
then setVar("scene."..sceneId..".locations."..iGame.Missions[i].Parts[j].Location..".loaded", 1)
else setVar("scene."..sceneId..".locations."..iGame.Missions[i].Parts[j].Location..".loaded", 0)
end
end
end
iDesktop.onStart = nil
else
if iLoading.Par.onLoad then
iGame.onLoad = iLoading.Par.onLoad
loadstring(iLoading.Par.onLoad)()
end
end
end
end

function iLoading.Update()
end

function iLoading.DefaultOnLoadHandler()
iActions.CameraRotateOff()
engine_Serv("GUNENGINE","RESET")
engine_Serv("GUNENGINE","UPDATE")
iDesktop.ResetFov()
engine_Serv("Ship","Speed","Set","70")
engine_Serv("INTERFACE", "RESETINDICATORS")
iActions.NormalMode()
engine_Serv("Timer","Stop")
end
iLoading.Create()

Stuart, could you tell me what I can leave out (unneeded stuff for my mod)? And more importantly: could you specify exactly what I need to change in this script to get the game to always load the default profile and game settings?

By now, you will have noticed my complete and utter lack of knowledge concerning programming... I apologize for my ignorance and the amount of explaining work I'm giving you.

...


Top
 Profile  
 
PostPosted: Tue Jun 16, 2015 6:16 pm 
Offline
OW Support Owner
OW Support Owner
User avatar

Joined: Wed Dec 28, 2005 11:13 pm
Posts: 4994
Location: UK, Scotland
cornel wrote:
That's exactly what I would like to achieve! But I don't know how to get the mod started (=working) without a loading.lua... Please help me.

Loading.lua afaik is just for loading the actual levels.

cornel wrote:
I wish that were true. If I try to load my mod without any profile present (except for the default one), the mod throws an error message or freezes at the launch screen!

Then tell me the error message instead of keeping it to yourself.

cornel wrote:
I cannot find "mission:start" (using LuaSearch) in any of the loading or startscript luas from DH... Using SystemEd, I don't see any files or names under "helpers", and only under "BoundingSpheres" the word "start" appears, namely in: "trigger:start"...

Its under geometry with the Dark Horizon levels at least. It isn't in the lua because its used by the game to teleport you. The game tells lua to tell the game (Bit stupid when you think about it since it never needs to actually go through lua for it) to teleport you.

cornel wrote:
If "start" is the name of the starting point, then there's no need for the system editor: in the startscript.lua it also says the name:
addEffect("adv_range_condition",{obj="Scene", objs1={{obj="start",radius=7000}...
I tried to change the "obj" (= objective?) to "en1" (which I assume is the name of the first encounter point on the map, as can be deduced from the mission1_1part startscript.lua itself: loc.moveToHelper(loc.pgroup,"1en");) but no change in location was apparent. Any ideas what I'm doing wrong?


adv_range_condition from what i can gather just fires an event (func_all_in if all ships are within range or func_all_out if they are outside it) when all ships in objs2 are within the range or outside of objs1 .

cornel wrote:
My second question was about auto-targeting the next enemy after the targeted enemy has been destroyed. In "actions.lua" I found the "iActions.SelectNextEnemy()" function. I assume you were referring to this. What would the correct syntax be in the lua-language to say: "when the targeted enemy has been destroyed, target the nearest enemy next"?
(There is a function called: "iActions.SelectNearestEnemy"... But "OnDestroyed" seems to mean something like "wave destroyed" or "mission completed", rather then "one enemy destroyed"...)


OnDestroyed is called for each ship in the wave afaik, since thats why you have a counter with most missions that when X are destroyed the next wave or part of the mission executes.

cornel wrote:
Concerning my first question: If I have changed something in the game to make it trying to (load or) save at game launch, then it happened unwillingly and I do not know what to change back again :( ...Any idea what I should check?


You want to use a Diff application (A program that shows the differences between two folders). And compare your mod to the games (You would have to copy the shared folder and dark horizons source code into one single folder for a proper comparison). Then you can see every change you made.

cornel wrote:
but no dice. I am not a programmer, I don't know visual basic, c++, or any other programming language, and more than half of the lua script is still gibberish to me...

More than half of the lua code is gibberish to me. Lua is defined by the application that uses it. Lua is just a simple syntax language which you use however you want to achieve your goal. Your not learning LUA when you make a mod, your learning how Quazar Studios setup the systems and how they work. You have to be a detective when you want to understand something and follow the code back to its original source.

cornel wrote:
Stuart, could you tell me what I can leave out (unneeded stuff for my mod)? And more importantly: could you specify exactly what I need to change in this script to get the game to always load the default profile and game settings?

I don't know. The game by default will load the default profile. You seem to have changed the game so that it doesn't select a new profile when none exists. It was crashing before because the profile name was set to default which the game won't allow you to modify with the game (Through saving).

cornel wrote:
By now, you will have noticed my complete and utter lack of knowledge concerning programming... I apologize for my ignorance and the amount of explaining work I'm giving you.

Its detective work. You just need to ignore the massive amounts of code and just focus on the bits you want to understand. Ignore the big picture.

_________________
Image
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Top
 Profile  
 
PostPosted: Tue Jun 16, 2015 10:31 pm 
Offline
Soldier level 0
Soldier level 0

Joined: Mon Mar 30, 2015 7:31 pm
Posts: 42
Location: Spain
Thank you for your encouraging words. Detective, I kinda like that thought! :)

Okay, so intrigued by your comment about me not needing to load anything, I went ahead and deleted everything from the loading and startscript luas and then put back, line by line, stuff I thought I needed... This is what my end result is:

startscript.lua:

loc.StartOnDestroyed=function()
loc.onPeaceMusic();
loc.intro();
end

loc.intro=function()
loc.start = gr.newGroup({onDestroyed = 'loc.StartOnDestroyed()'});
gr.spawn(loc.start,'blade_fighter',3,'trigger:start','loc.moveToHelper({engine_GetId(tmp[1])},"start",30000)');
loc.onBattleMusic();
ingame.setPlayerShipAttackersCount(1);
end;

loc.intro();

With this minimal amount of information, my mod launches perfectly (thank you, Stu!) and directly into the action, but with one small curiosity: the enemies will always remain in formation, instead of flying freely about. Any idea why this is?

This is of course the simplest version of the mod I really would like to make: an increasing number of enemies with every loop... Could you give me an example of how to compose a DH lua command to add one more enemy (+1) to the new wave, after destroying the current wave?

As you can see, instead of changing the start point to the first encounter point, I simply moved the action to the start point. It seems to work.

Incidently, apart from launching the mod, I also use the loading.lua to change the splash screens.

---

For the error message, see my post from: Fri Jun 12, 2015 3:23 pm

---

So, I'm very happy with my achievements so far. The game launches directly into the action, without any menus or cutscenes. The screen is clutter free, without the HUD showing. Just a few details that need tweaking... I could not have done this without your help, Stu!

---

I've been writing a lot, and your head must be spinning by now, (my excuse: I'm infected with the modding-detective fever), so I'm gonna repeat a question you've left unanswered: What would the correct syntax be in the DH lua-language to say: "when the targeted enemy has been destroyed, target the nearest enemy next"?

---

Instead following your advice about using a comparison program, I deleted everything from the mod source folder and started adding stuff one by one. I could not detect any change in the game's behavior: I always get the save error message. You said: "It was crashing before because the profile name was set to default which the game won't allow"... Could you elaborate? What is the default name and in which lua is it specified? This may be the clue I am lookin for!

---

Waiting impatiently for your answer... :D


Last edited by cornel on Wed Jun 17, 2015 3:49 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed Jun 17, 2015 5:02 am 
Offline
OW Support Owner
OW Support Owner
User avatar

Joined: Wed Dec 28, 2005 11:13 pm
Posts: 4994
Location: UK, Scotland
cornel wrote:
With this minimal amount of information, my mod launches perfectly (thank you, Stu!) and directly into the action, but with one small curiosity: the enemies will always remain in formation, instead of flying freely about. Any idea why this is?

You have it set so only one can target you. So the rest will have nothing to do. By default they should fly around the "Helper" you made them move to.


cornel wrote:
This is of course the simplest version of the mod I really would like to make: an increasing number of enemies with every loop... Could you give me an example of how to compose a DH lua command to add one more enemy (+1) to the new wave, after destroying the current wave?


Create 2 variables somewhere in the lua file (Just do something like MyVariable = 0 but with your own variable name but it has to not be inside any function so that they are global). One for the current destroyed enemies and one for the bonus enemies.

Then modify the OnDestroyed bit. Make the function it calles ( functions are bits like the loc.StartOnDestroyed() which contain a block of code in themselves) increase the current destroyed enemies variable. If the current destroyed enemies is above a certain value set it to 0 and increase the bonus enemies variable by one or whatever.

Then when you spawn new enemies set the amount of enemies to the base amount you want plus the bonus enemies variable.

i.e
Code:
CurrentDestroyedEnemies = CurrentDestroyedEnemies + 1;
if (CurrentDestroyedEnemies > 2+BonusEnemies) then
CurrentDestroyedEnemies = 0;
BonusEnemies = BonusEnemies+1;
;Spawn Code goes Here!
endif;



cornel wrote:
I've been writing a lot, and your head must be spinning by now, (my excuse: I'm infected with the modding-detective fever), so I'm gonna repeat a question you've left unanswered: What would the correct syntax be in the DH lua-language to say: "when the targeted enemy has been destroyed, target the nearest enemy next"?

Just make the OnDestroyed bit call the SelectTarget command. From what i understand your the only ship in your mod (As in no allies) so only you could have destroyed the ship.

cornel wrote:
You said: "It was crashing before because the profile name was set to default which the game won't allow"... Could you elaborate? What is the default name and in which lua is it specified?

default .... It may not be specified in the lua. It could simply be that as you bypassed the main menu the game never switched profiles (Since its at the main menu that it pops up saying which profile you want to use).

_________________
Image
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Top
 Profile  
 
PostPosted: Wed Jun 17, 2015 7:05 pm 
Offline
Soldier level 0
Soldier level 0

Joined: Mon Mar 30, 2015 7:31 pm
Posts: 42
Location: Spain
DARK HORIZON - GAME PAUSED!

XD

Okay, Stu... I've put everything on hold (I'll continue to tackle these issues as soon as I am up to speed) and I've decided to make a clean, fresh start. I have re-created the whole (HUD and LOOP) mod (220 modified files), step by step (taking care not to change anything that could be related to the default profile), in TARR CHRONICLES (just to make it extra new and crisp. LOL)... and am now in the process of eradicating scripting errors or conflicts.

I took the original TC luas and modified them, so no conflicting or unrecognizable DH code should be present. Nonetheless, I get this error when launching the mod (based on mission 1 part 2):

ErrorText: TLuaMachine.RunCommand - error while running script: iProfiles.Save(), HOOKCALL: name: , namewhat, what: , source: , currentline: 0, HOOKLINE: name: , namewhat, what: , source: , currentline: 0

Funny thing is, according to LuaSearch, there is no iProfiles.Save() function present in my modded luas! So, could this be what you suggested: that bypassing the main menu makes the game throw this error, or is it something else entirely? Maybe a silly little thing, that's easy to resolve?
Here's hoping...
;)


Top
 Profile  
 
PostPosted: Thu Jun 18, 2015 12:33 am 
Offline
OW Support Owner
OW Support Owner
User avatar

Joined: Wed Dec 28, 2005 11:13 pm
Posts: 4994
Location: UK, Scotland
cornel wrote:
ErrorText: TLuaMachine.RunCommand - error while running script: iProfiles.Save(), HOOKCALL: name: , namewhat, what: , source: , currentline: 0, HOOKLINE: name: , namewhat, what: , source: , currentline: 0

Funny thing is, according to LuaSearch, there is no iProfiles.Save() function present in my modded luas! So, could this be what you suggested: that bypassing the main menu makes the game throw this error, or is it something else entirely? Maybe a silly little thing, that's easy to resolve?
Here's hoping...
;)


If you removed iProfiles.Save() (or stopped it from including profiles.lua ) and the game tries to call it, then there will be an error because it doesn't exist. You would need to leave a shell in its place. Just a "dummy" iProfiles.Save() which contains no actual code.

_________________
Image
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Top
 Profile  
 
PostPosted: Thu Jun 18, 2015 9:03 am 
Offline
Soldier level 0
Soldier level 0

Joined: Mon Mar 30, 2015 7:31 pm
Posts: 42
Location: Spain
Aha, so that's the way to do it. Thank you. Yesterday evening I actually spent a couple of hours eliminating any reference in all the lua files for "profile" and it derivatives, to see if i could get rid of this function completely. But if I understood you right: I can't control the game engine and it will call for stuff. So the functions have to be there, even if they are just a bunch of dummy functions... Useful info, this is! :)

Question: there's "mission", "submission" and "part". If I want to tell the game to directly go to mission1_2part, would that be "submission 2" or "part 2" of "mission 1"? I'm asking because I don't seem to be able to launch the mod in TC. Is there something else needed in TC apart from the following changes...?

...in the default_ini.lua:

ini.defaultInterface='toGame()", part = 2, onPreLoad = "iGame.PreLoadLocation()';
ini.startLocation="m1_system_anterra";


...in the game.lua:

function iGame.StartMod()
iGame.LockResources=0;
for i,v in iDevices.Resources do
v.count = 1000
end
engine_EnableRender(1)
iGame.Mission = 1
iGame.Submission = 1;
iLoading.Open({
id = iGame.Missions[iGame.Mission].Location,
mission = iGame.Mission,
submission = iGame.Submission,
part = 2,
onLoad = "toGame()",
})
end


...and in the loading.lua:

system.execute({
"iGame.StartMod()",


This was enough for DH... but apparently not for TC. Any idea what is missing, Stu?

Just in case: this is the first part of the mod. Maybe you see something amiss there...


loc.init=function()
ClearObjectives();
enableAutoFormation(loc.omega[1]);
for n,ship in loc.omega do AddToFriendList(ship,3000) end
engine_Sound("Play","Radio","data/sounds/ambience/still_ambience1.wav",2500,3500,"")
engine_Sound("Volume","Radio",int(iProfiles.Profile.cfg["sound"]["RadioVolume"]*0.5))
engine_Sound("Mute","Ambience","On")
loc.timer(1,'AddObjective("q1","'..t1..'")')
loc.border(loc.omega[1])
loc.moveToHelper({loc.omega[1]},"AttackedRecon",15000)
loc.addToFormation({loc.omega[2],loc.omega[3]},loc.omega[1])
addEffect("adv_range_condition",{
obj="Scene",
objs1={
{obj="AttackedRecon",radius=15000},
},
objs2={
{obj=loc.omega[1]},
},
func_all_in='loc.en1Create()',
})
end;

loc.init();

loc.timer(1,'loc.en1Create()');


Top
 Profile  
 
PostPosted: Thu Jun 18, 2015 4:19 pm 
Offline
OW Support Owner
OW Support Owner
User avatar

Joined: Wed Dec 28, 2005 11:13 pm
Posts: 4994
Location: UK, Scotland
The game already calls iLoading.Open , So why would you call it again? That would make it load two times. iLoading.Open can not be a dummy function or the game won't load the system. iLoading.Seq is where it does the actual loading of the level.

_________________
Image
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Top
 Profile  
 
PostPosted: Thu Jun 18, 2015 5:03 pm 
Offline
Soldier level 0
Soldier level 0

Joined: Mon Mar 30, 2015 7:31 pm
Posts: 42
Location: Spain
Okay, I took out iLoading.Open (remember: noob talking here! It was part of a bunch of code I copied from another lua, to make my own "mod launcher function", without really knowing what everything was for...) but the TC mod still won't launch. The game freezes at the splash screen... Even when calling the root menu instead of the mod, I have this problem...

I experimented a bit in DH and discovered that not only the iLoading.Open was superfluous, but that the whole "StartMod function" I invented wasn't necessary at all to launch my mod! Instead of calling my "mod launch function" in the loading.lua, I merely put the last command from it, namely: "toGame".

system.execute({
"toGame()",

And it works! (in my DH mod...)
Thanks to your addition to the default_ini.lua, the game already knew which system to load... I understand that now.
Again, all thanks to you, Stuart!!!

Anyway, my problem is that I rather have my mod working with TC, since I like the player ship and skybox better...

Do you happen to know if there are other requirements to launch a mod in TC than there are for DH, or why the mod would freeze up in TC at the splash screen?

EDIT:
Well, I've tried a lot of different changes to a lot of different lua files, but (in TC) I can't get past the splash screen...
:(

I used the "compare" plugin in NotePad++ and the files are (nearly) identical... Can't see anything wrong with the TC mod files... The only thing I can think of is that, somehow, the indications in my default_ini.lua aren't correct... Could you take a peek and see if everything's alright?


ini["language"]="en" ;
ini["consoleLog"]=0;
ini["fileLog"]=0;
ini["fileFastLog"]=0;
ini["sound"]={};
ini["showSubtitles"]=0;
ini["godmode"]=0;
ini.show={};
ini["loadGlobalObjects"]=1;
ini["poorfx"]=0;
ini.turretsEnabled=0;
ini.nozzlesEnable=0;
ini.curPlayerProfile="default";
ini.defPlayerProfile="default";
ini.playerProfile="default";
--ini.defaultInterface='';
ini.defaultInterface='toGame()", part = 2, onPreLoad = "iGame.PreLoadLocation()';
--ini.startLocation="empty_system";
ini.startLocation="m1_system_anterra";
ini.useCollision=1;
ini.jSensitivity = 10;
ini.controllerInversion = 0;
ini["capture_init"]=0;
ini["capture_num_devices"]=2;
ini["capture_fps"]=10;
ini["capture_path_0"]='c:/_/';
ini["capture_path_1"]='d:/_/';
ini["capture_path_2"]='i:/_/';


Top
 Profile  
 
PostPosted: Fri Jun 19, 2015 12:38 am 
Offline
OW Support Owner
OW Support Owner
User avatar

Joined: Wed Dec 28, 2005 11:13 pm
Posts: 4994
Location: UK, Scotland
You should get it working with all the standard lua code intact before you rip everything out. I have no clue what the problem could be because i don't have the source code you have. Showing me random segments won't help as i have no clue what your code looks like when you have ripped it all out.

P.S You shouldn't need the "toGame" as the defaultInterface bit should be setting it. Also you don't start the mod, the game initiates it. It loads the system at the start (By default an empty system and it shoves the main menu on top) which you replace with the system you want to load instead.

_________________
Image
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Top
 Profile  
 
PostPosted: Fri Jun 19, 2015 2:05 pm 
Offline
Soldier level 0
Soldier level 0

Joined: Mon Mar 30, 2015 7:31 pm
Posts: 42
Location: Spain
You're right, of course. I have to organize my mod work in a logical order and go step by step, checking the game's functionality at each step.

I just did a clean install of TC and started adding, one by one, my modded lua files... The first file I added was the default_ini.lua, which tells the game to go straight into mission 1 part 2. The file is completely unmodified, except for the two lines you told me:

ini.defaultInterface='toGame()", part = 2, onPreLoad = "iGame.PreLoadLocation()';
ini.startLocation="m1_system_anterra";

Nonetheless, the result was not the one you suggested. The game did not go directly into the mission, but did a normal launch procedure (logos, intros, menu).

Before I can continue adding modded files (yes, I'm modding the "safe and organized way" now LOL) I need you to confirm whether this behaviour is wrong and that the lua file need additional tweaking, or that you were mistaken and that the "direct-into-the-game-launching" cannot be achieved with (just) the default_ini.lua.

Awaiting impatiently (as always) your answer, Stu! :)

P.S.: In combination with my loading.lua the game does go straight to mission 1 part 2, which is a shame, because I have the feeling that - since the game already loaded the correct system at startup - it's loading stuff unnecessarily for the second time... If only I knew what to leave out of the loading.lua to make it as efficient as possible... (hint, hint...) :P

So, with the loading.lua the mission comes directly up, but unfortunately the game still shows some replics and cutscenes first, for which I have no clue about how they got there. They don't seem to be present in my startscript.lua. Are there in TC also other files that determine the missions, apart from the startscript.lua?


Top
 Profile  
 
PostPosted: Fri Jun 19, 2015 6:06 pm 
Offline
OW Support Owner
OW Support Owner
User avatar

Joined: Wed Dec 28, 2005 11:13 pm
Posts: 4994
Location: UK, Scotland
Just re-read this thread. You need to stop the game from opening the main menu and starting the cutscenes. The default_ini just changes the starting location.

I never said you just needed the default_ini . I said that it does the toGame() bit and that you shouldn't need that elsewhere.

The game stores the startscript stuff in the system folders.

_________________
Image
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 79 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group