Forged Alliance Forever Forged Alliance Forever Forums 2018-03-30T04:02:17+02:00 /feed.php?f=41&t=15363 2018-03-30T04:02:17+02:00 2018-03-30T04:02:17+02:00 /viewtopic.php?t=15363&p=162249#p162249 <![CDATA[Re: Saving mod user data on file]]>
speed2 wrote:
If I understand it correctly...
it starts a server and launches the game, then it listens to GPGNetSend calls from the game and saves whatever is needed.


pretty much pal,

here is the script and functions i added.. it's a simple python script... with added extra's....
i added some functions here to be able to send commands to the game in the form of an array,
the code in the game in the userlayer accepts whatever is sent, i think i use a function called "explode"
in the user layer to parse the passed in array for commands.. did'nt finish it but in my testing it works fine.

https://pastebin.com/ZvvKzLfs

Statistics: Posted by Domino — 30 Mar 2018, 04:02


]]>
2018-03-26T13:37:34+02:00 2018-03-26T13:37:34+02:00 /viewtopic.php?t=15363&p=162109#p162109 <![CDATA[Re: Saving mod user data on file]]>

Statistics: Posted by Domino — 26 Mar 2018, 13:37


]]>
2018-03-26T10:15:24+02:00 2018-03-26T10:15:24+02:00 /viewtopic.php?t=15363&p=162103#p162103 <![CDATA[Re: Saving mod user data on file]]> Statistics: Posted by nine2 — 26 Mar 2018, 10:15


]]>
2018-03-26T08:21:29+02:00 2018-03-26T08:21:29+02:00 /viewtopic.php?t=15363&p=162101#p162101 <![CDATA[Re: Saving mod user data on file]]> it starts a server and launches the game, then it listens to GPGNetSend calls from the game and saves whatever is needed.

Statistics: Posted by speed2 — 26 Mar 2018, 08:21


]]>
2018-03-26T03:27:19+02:00 2018-03-26T03:27:19+02:00 /viewtopic.php?t=15363&p=162097#p162097 <![CDATA[Re: Saving mod user data on file]]>
Anihilnine wrote:
how do u do that domino?


like this --> https://www.youtube.com/watch?v=Jt7Qy9jUJ9U

i did say you need a 3rd party program... which ZEP kindly written/gave to me years ago, i just added more functions to the external program/script to make it do what i wanted... :)

i can post it if you want.. it's a python script.. so you will have to know python to get what you want from it..

Statistics: Posted by Domino — 26 Mar 2018, 03:27


]]>
2018-03-26T03:06:15+02:00 2018-03-26T03:06:15+02:00 /viewtopic.php?t=15363&p=162094#p162094 <![CDATA[Re: Saving mod user data on file]]> Statistics: Posted by nine2 — 26 Mar 2018, 03:06


]]>
2018-03-25T23:20:04+02:00 2018-03-25T23:20:04+02:00 /viewtopic.php?t=15363&p=162082#p162082 <![CDATA[Re: Saving mod user data on file]]>
although most of the (lua) functions in game are disabled that allow you to extract data from the game and indeed add new data to a game be it running in the sim or UI side (while in game or not), there is actually away to get data in and out of the game.. however it does involve a 3rd party program to be running that connects to the game...

Statistics: Posted by Domino — 25 Mar 2018, 23:20


]]>
2017-10-28T22:18:42+02:00 2017-10-28T22:18:42+02:00 /viewtopic.php?t=15363&p=155700#p155700 <![CDATA[Re: Saving mod user data on file]]>
Myxir wrote:
you can write to game.prefs, e.g.
https://github.com/Bra1nwash3d/FAF-stuf ... fs.lua#L75
dunno if it's possible to write to other files at all


For the topic purpose and for exposing my happiness, just wanna say it's working and its so simple to do :) (less than 10 lines of code) !

Code:
local Prefs = import('/lua/user/prefs.lua')

function SaveTemplates(table)
   Prefs.SetToCurrentProfile('Templates', table)
end

function GetTemplates()
   return Prefs.GetFromCurrentProfile('Templates')
end


It saves a complete database ;) and because it's internal -> cheats safe ^^

Statistics: Posted by Franck83 — 28 Oct 2017, 22:18


]]>
2017-10-27T22:14:15+02:00 2017-10-27T22:14:15+02:00 /viewtopic.php?t=15363&p=155669#p155669 <![CDATA[Re: Saving mod user data on file]]>
Really really annoying, i have a complete template table to save...

i will take a look at game.prefs. Maybe if i serialize my tables to game.prefs...

Hope there are not small limits with game.prefs....

Statistics: Posted by Franck83 — 27 Oct 2017, 22:14


]]>
2017-10-27T22:09:55+02:00 2017-10-27T22:09:55+02:00 /viewtopic.php?t=15363&p=155668#p155668 <![CDATA[Re: Saving mod user data on file]]> Statistics: Posted by Sprouto — 27 Oct 2017, 22:09


]]>
2017-10-27T22:08:47+02:00 2017-10-27T22:08:47+02:00 /viewtopic.php?t=15363&p=155667#p155667 <![CDATA[Re: Saving mod user data on file]]> https://github.com/Bra1nwash3d/FAF-stuf ... fs.lua#L75
dunno if it's possible to write to other files at all

Statistics: Posted by Myxir — 27 Oct 2017, 22:08


]]>
2017-10-27T22:00:08+02:00 2017-10-27T22:00:08+02:00 /viewtopic.php?t=15363&p=155666#p155666 <![CDATA[Saving mod user data on file]]>
Maybe someone can help.

it seems that FA lua doesn't support such lua standard :

Code:
local file ,err = io.open(filename, "wb")

WARNING: Error running OnRelease script in <deleted object>: ...lliance\mods\heroes_reloaded\modules\datamanager.lua(136): access to nonexistent global variable "io"


So, how can we open access to files ?

Really annoying for my mod because i need to save players templates on local file. Somebody got experience on loading/saving data on file with FA ?

Statistics: Posted by Franck83 — 27 Oct 2017, 22:00


]]>