Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Product Chat / Read/Write Variables or Values

Author
Message
Sting
15
Years of Service
User Offline
Joined: 18th Jan 2011
Location:
Posted: 9th Apr 2012 17:30
The only thing missing for me inside FPSC is the ability to read/write from within the scripts.

It would give everybody the ability to create multiple levels/games within the same game.

Example:
End of Map > WinZone (Inside trigger.fpi I could attach something along the lines of:

:state=1:write.file(level1.txt("objective=1"))

This will enable me to write a separate executable that reads whether this level has been complete giving us more of an option to use external files to run our games using FPSC.

Anyone?!

// EOF
That Guy John
16
Years of Service
User Offline
Joined: 30th Apr 2010
Location: United States
Posted: 9th Apr 2012 18:00
I think I kind of see where you are going with this.

Some sort of method of Inter op?

From the way you wrote your example, I take it you are more of a VB.net person?

The problem is, DBPro (to my knowledge) will only compile DB code, but it would be nice to be able to call vb.net apps from within FPSC scripts. I can see a few really good uses.
One for example, taking screen shots and uploading them to an ftp account or even a fb account in the background without interrupting the game. Which can be done fairly simple with vb.net, we just don't have a way of calling our apps from within the scripts.

And Here Is A Penguin:
FPSC OneSource [DeskTop App] - Bringing everything together into one.
Sting
15
Years of Service
User Offline
Joined: 18th Jan 2011
Location:
Posted: 9th Apr 2012 18:40
John, yes what you described is similar to what I want to achieve but even to write a simple line to a file would be ample enough.

For example;
External Custom Written Game Launcher (Launch fpsc-lvl1.exe): Wait for End
>
Game Ends > Write to file (level1.txt("complete=1")
>
FPSC-lvl1.exe ended > Load File (level1.txt)
>
If complete=1 then
>
Launch fpsc-lvl2.exe
>
So on and so forth.

Just the pure and simple ability to write to a file from within the script would allow a whole host of features to be written for better and much more advanced game development as a whole using the FPSC engine.

I have taken a few peeks at the source a few times but have never gotten round to taking a serious look. If you think this is worth a bash TGH I wouldn't mind discussing this with you as something to look at...

// EOF
That Guy John
16
Years of Service
User Offline
Joined: 30th Apr 2010
Location: United States
Posted: 9th Apr 2012 19:46
Hmm, why would you have your levels as separate EXE(s)?

And Here Is A Penguin:
FPSC OneSource [DeskTop App] - Bringing everything together into one.
Sting
15
Years of Service
User Offline
Joined: 18th Jan 2011
Location:
Posted: 9th Apr 2012 21:35
If everybody exposed their secrets there would be no innovation...

// EOF
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 9th Apr 2012 22:57 Edited at: 9th Apr 2012 23:13
RPGmod has write to file commands but it still doesn't have exactly what you want. The player knows when he finishes a level and so if instructed within a play manual he would know what to do next. The write to file commands is mainly used for the player if you want him/her to know certain information during play. It was mainly used for teachers to use to indicate certain info about where the student is at in an educational game. These are the commands.

rpg_openfile2write=(FileNumber FileName)

rpg_write2file=(FileNumber FileData)
This command adds the data contained within FileData to the file identified. FileData can either be:

- Simple text,

- A time stamp

- Blank/empty, this adds a blank line to the file.

There is also a command to delete a file.

Sting
15
Years of Service
User Offline
Joined: 18th Jan 2011
Location:
Posted: 10th Apr 2012 02:11
FL, I'm gonna download RPGMOD to use with 119 and test this out, will post results sometime this week.

// EOF
That Guy John
16
Years of Service
User Offline
Joined: 30th Apr 2010
Location: United States
Posted: 10th Apr 2012 19:21
Sting,
Fair enough I suppose.

Flatlander,

Does this write the file to memory or does it actually write the file to the drive in a specified location?
I could see maybe using this to accomplish a couple things I have been wanting. If it actually writes to the drive at a specified location I could have my "Wrapper" (I will call it that just for simplicity) created in VB.NET maybe watch that directory for certain files to exist in a loop ...

Terry, you're going to make me have to get RPG Mod to figure this out aren't you, you old jar head?

And Here Is A Penguin:
FPSC OneSource [DeskTop App] - Bringing everything together into one.
Sting
15
Years of Service
User Offline
Joined: 18th Jan 2011
Location:
Posted: 10th Apr 2012 21:30
TGH - That's exactly what I have in mind.

// EOF
Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 10th Apr 2012 23:15
Quote: "Terry, you're going to make me have to get RPG Mod to figure this out aren't you, you old jar head?"


:LOL:

TGJ, I just came on-line. It writes an actual file to the hard drive. It's not at a specified location. It is within the folder rpgfiles which needs to created as a part of the RPGmod install. However, it is whatever file name you would specify. I suppose I could modify it to write to any location.

That Guy John
16
Years of Service
User Offline
Joined: 30th Apr 2010
Location: United States
Posted: 11th Apr 2012 00:01
I think I got you.
And yes, the ability to create the file in a chosen directory would be great.
Ive got more questions, but better suited for the RPG Mod thread.

And Here Is A Penguin:
FPSC OneSource [DeskTop App] - Bringing everything together into one.
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 11th Apr 2012 03:54 Edited at: 11th Apr 2012 03:57
We use a write to text file feature, which our launcher (programmed in VB) uses to unlock other features or bonus levels. It is quite a useful function. Although the idea of writing to file is nice, why would you want it to write outside of the game folder?

If you do write to file outside the game folder, you need to remember some systems won't allow files to be created/written in key areas, which could cause issues for some users that play the game and a script triggers a write command. You are better to create a folder within your game where all your written files can go and prevent any issues.


Twitter: @NFoxMedia
That Guy John
16
Years of Service
User Offline
Joined: 30th Apr 2010
Location: United States
Posted: 13th Apr 2012 04:53
BlackFox,
I can see what you mean about creating files outside of the game folder, I suppose just being able to write to another directory with in the game's folder would do, just for organization.

What I am looking for is a really simple method of inter op between a game and my Launcher \ "Wrapper" so I don't have to learn DarkBasic. I can already do most of the things I want to accomplish in VB, just looking for ways to trigger my procedures from within the game. I'm currently taking my VB.NET class and want to stay focused on that.

I'd certainly like to here any more feedback you have on this BlackFox. (Now watching this thread)

And Here Is A Penguin:
FPSC OneSource [DeskTop App] - Bringing everything together into one.
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 13th Apr 2012 18:43
Quote: "What I am looking for is a really simple method of inter op between a game and my Launcher \ "Wrapper" so I don't have to learn DarkBasic. I can already do most of the things I want to accomplish in VB, just looking for ways to trigger my procedures from within the game. I'm currently taking my VB.NET class and want to stay focused on that."


I can use this as an example of interaction between my launcher written in VB and the FPSC game that is within the launcher. The player plays the game and when a level is completed, there is a text file written that simply says "Level 1 Completed". As each level is completed, the text file for that level is written. When the game is completed and the player returns to the launcher, the launcher looks for and reads those text files. If it reads all 10 files and all 10 files say "Level # Completed", then there is a button that becomes available for bonus material. That is why I mentioned not writing to file outside of the game folder. It is easier to keep it organized within the game structure. I create a folder within the Files\ folder called "foxfiles", and code my launcher to look there.

As a modder, I carried that further and modded our source to look for specific files created by the launcher when it is run. So in essence, we have interaction going both ways between our VB launcher and FPSC game.

I'm assuming that is what you are looking at.


Twitter: @NFoxMedia
Sting
15
Years of Service
User Offline
Joined: 18th Jan 2011
Location:
Posted: 13th Apr 2012 22:06
Yup fox, this is exactly what I am looking for. The fact a simple variable is written or exchanged in memory between the game and an external application is enough to expand the game.

// EOF
BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 13th Apr 2012 22:24
That was part of the reason we asked Flatlander to add the ability to write to file in RPG Mod back in it's earlier developments. We had an idea to have the game write information to file, which we then could code our launcher/game interface to utilize for other things. It sure made some tasks easy for us, and does open a few doors.


Twitter: @NFoxMedia
That Guy John
16
Years of Service
User Offline
Joined: 30th Apr 2010
Location: United States
Posted: 16th Apr 2012 21:15
BlackFox,
Thanks for the feedback. Yes, that is almost dead on to what I am looking for.

And Here Is A Penguin:
FPSC OneSource [DeskTop App] - Bringing everything together into one.

Login to post a reply

Server time is: 2026-07-02 10:24:16
Your offset time is: 2026-07-02 10:24:16