UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: DeletedUser on November 18, 2015, 08:21:30 pm

Title: Just a curious question for any scripters out there
Post by: DeletedUser on November 18, 2015, 08:21:30 pm
So anyone know if it is possible to write to a file in GSC or CSC

I know you can read from a CSV file in GSC using TableLookUp as this is how i have done my weapons system (yes i know to it doesnt read the whole file just finds the file contens at the specifed spot but still its reading the file)

EDIT: Just to note i do know that the following functions do exist but they are dev only functions (require you to be in dev mode for them to work) and i am asking if there is a way out of dev mode

Code Snippet
Plaintext
CloseFile(); // Closes the files write stream
FGetArg(); // Gets the contents of the file at the specified index
FPrintFields(); // Writes to the file in a CSV type manor
FPrintLn(); // Writes one line to the file
FReadLn(); // Reads one line from the file
OpenFile(); // Opens the file write stream
Title: Re: Just a curious question for any scripters out there
Post by: MakeCents on November 18, 2015, 08:33:11 pm
So anyone know if it is possible to write to a file in GSC or CSC

I know you can read from a CSV file in GSC using TableLookUp as this is how i have done my weapons system (yes i know to it doesnt read the whole file just finds the file contens at the specifed spot but still reading)

I'd message blunt if he don't post here. I think he does it with his ranking system on the realism mod. I don't "know" of how to do it. Maybe savegame has something to do with it?

http://wiki.modsrepository.com/index.php?title=Call_of_Duty_4:_Scripting_Reference_-_Save::SaveGame (http://wiki.modsrepository.com/index.php?title=Call_of_Duty_4:_Scripting_Reference_-_Save::SaveGame)
Title: Re: Just a curious question for any scripters out there
Post by: DeletedUser on November 18, 2015, 08:50:14 pm
I'd message blunt if he don't post here. I think he does it with his ranking system on the realism mod. I don't "know" of how to do it. Maybe savegame has something to do with it?

http://wiki.modsrepository.com/index.php?title=Call_of_Duty_4:_Scripting_Reference_-_Save::SaveGame (http://wiki.modsrepository.com/index.php?title=Call_of_Duty_4:_Scripting_Reference_-_Save::SaveGame)
I know how Blunt is doing the realism mod he is some how saving the ranks and stuff you earn to a CSV just like the old Realism mod but im not quite sure how he is doing it as all the times ive tried the game crashed saying "you need dev to get return value of this function prior to game start" or it just didnt work plain as day

ive looked through the old Realism mod code but sadly no luck :(
Title: Re: Just a curious question for any scripters out there
Post by: MakeCents on November 18, 2015, 08:59:29 pm
I know how Blunt is doing the realism mod he is some how saving the ranks and stuff you earn to a CSV just like the old Realism mod but im not quite sure how he is doing it as all the times ive tried the game crashed saying "you need dev to get return value of this function prior to game start" or it just didnt work plain as day

ive looked through the old Realism mod code but sadly no luck :(

Does it work if you start the map in dev mode? Maybe that is how its done?
Title: Re: Just a curious question for any scripters out there
Post by: DeletedUser on November 18, 2015, 09:05:16 pm
Does it work if you start the map in dev mode? Maybe that is how its done?
It does work but if thats how Blunts doing it then all games played with the Realism mod will be played in dev mode which to me sounds like a bad idea and can cause twice the amount of errors so less people will play it cause of how "buggy" it is

EDIT: and the player who wants to play the game will have to rember to put it in to dev mode since it has to be set prior to game start so normal players (non modders) who want to play cant or have to look up how to start the game

Double Post Merge: November 18, 2015, 09:21:05 pm
Does it work if you start the map in dev mode? Maybe that is how its done?
I prob didnt make this clear but im trying to find out if it works out of dev mode (i know it works in dev mode)
Title: Re: Just a curious question for any scripters out there
Post by: BluntStuffy on November 18, 2015, 09:29:03 pm
I'm not using any of those functions for the Realism-mod. I use the .csv table's to retrieve available attachments/unlock levels/cost etc from, and functions allready in waw to save/load the stats.

I'm not sure if you can use read/write-file functions outside dev-mode. I wouldn't know how to..
Title: Re: Just a curious question for any scripters out there
Post by: MakeCents on November 18, 2015, 09:35:38 pm
EDIT: and the player who wants to play the game will have to rember to put it in to dev mode since it has to be set prior to game start so normal players (non modders) who want to play cant or have to look up how to start the game
I'm sure easily done in menu, but I see it isn't what you are going for.

I prob didnt make this clear but im trying to find out if it works out of dev mode (i know it works in dev mode)

Okay.

I'm not using any of those functions for the Realism-mod. I use the .csv table's to retrieve available attachments/unlock levels/cost etc from, and functions allready in waw to save/load the stats.

I'm not sure if you can use read/write-file functions outside dev-mode. I wouldn't know how to..

Hmmm, interesting. I will have to look into this one day... I to am interested in how that works.
Title: Re: Just a curious question for any scripters out there
Post by: DeletedUser on November 18, 2015, 09:37:37 pm
I'm not using any of those functions for the Realism-mod. I use the .csv table's to retrieve available attachments/unlock levels/cost etc from, and functions allready in waw to save/load the stats.

I'm not sure if you can use read/write-file functions outside dev-mode. I wouldn't know how to..
might i ask what these functions are called? i know TableLookUp for getting the CSV stuff but how are you saving / loading stats?
Title: Re: Just a curious question for any scripters out there
Post by: BluntStuffy on November 18, 2015, 09:50:17 pm
You can use getstat() and setstat() They are in _zombiemode and _challenges_coop for example
Title: Re: Just a curious question for any scripters out there
Post by: DidUknowiPwn on November 19, 2015, 02:32:12 am
Can't use developer functions outside of developer mode. That's the whole point lol. Anyway I was thinking of disabling it in T4M but it can will cause a bunch of other script related issues.