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 Scripts / Savegame problem on a character

Author
Message
lotgd
14
Years of Service
User Offline
Joined: 2nd Apr 2010
Location: italy
Posted: 16th Nov 2012 12:27
With this script on main of a characters

Appears this error when I save "Runtime Error 502 ; image does not" exist

Can you tell me if it is a bug or if I do something wrong?
The image is correct and appear, the save dialog appears when I press "Y".
But just save your progress, I get the error.

Ross tra damus
3D Media Maker
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Looking to Escape London
Posted: 16th Nov 2012 14:44
I'm rubbish at scripting but you might want to change the value in this line to one a lttle higher.
'plrdistfurther=51' maybe to 'plrdistfurther=60'

The current value does not allow the player to move at all before switching the action off.

Plus I would use the command 'scancodekeypressed' instead of 'keypressed'.

You might also try by moving the 'second' state=0 line 'up' to make it the 'first' line in the script.

NOTE - It maybe because you have the same name for your image and your hud name 'fatasave'. Maybe try changing the hud name to something else.



Sorry thats all I can think of at the moment.
lotgd
14
Years of Service
User Offline
Joined: 2nd Apr 2010
Location: italy
Posted: 16th Nov 2012 15:02 Edited at: 16th Nov 2012 15:02
tested and reported the same problem-_-
Thanks of help

i use v.120 beta 4

Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 16th Nov 2012 17:59 Edited at: 16th Nov 2012 18:02
Try this script with a couple of modifications



Addendum:

Ross

Be sure and use the newest modification as I noticed another possible issue.

Ross tra damus
3D Media Maker
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Looking to Escape London
Posted: 16th Nov 2012 17:59 Edited at: 16th Nov 2012 18:01
Is it because there is no 'state=1 or state=2' defined in the script?

EDIT - Terry got in there just before me, oh well.
lotgd
14
Years of Service
User Offline
Joined: 2nd Apr 2010
Location: italy
Posted: 16th Nov 2012 22:25
Does not work, I have attached the files if maybe we want to take a look.
Thank you for your help Ross tra damus & F l a t l a n d e r.

Attachments

Login to view attachments
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 16th Nov 2012 23:29 Edited at: 17th Nov 2012 00:25
I'll take a look. I am currently working on trying to figure out another issue with beta 5 along with overworked leaders Lee and Dave. I will probably add the hud and fairy to my test level so I can do it at the same time.

Maybe Blackfox, once he sees this, can give you a fix a lot sooner.

Addendum:

There might be a bug with the command "savegame" The image it's trying to save is the image of the current scene as the image to show when you want to load back the game.

The command "quicksavegame" does work. However, it will not allow the player to select a slot. It will always choose slot #1 and will overwrite anything that is saved there. When I have time I'll look closer at what is wrong with this. I'll also report it to Lee and Dave but using stock media. So change "savegame" to "quicksavegame" You'll have to tweak the script some in order for the hud to disappear after you save the game because as is it will then remain on the screen.


lotgd
14
Years of Service
User Offline
Joined: 2nd Apr 2010
Location: italy
Posted: 17th Nov 2012 20:57
Terry thanks for the advice, and the time you have spent. I look forward to any corrections in future versions of FPSC.

Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 17th Nov 2012 21:09
You're welcome.

I'm looking at the code right now to see if there is something I can do for a fix and if so then I'll send that along. Both are very busy at the moment.

BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 17th Nov 2012 22:06
Ok, here are my results from this thread. I've downloaded the material supplied by LOTGD and ran multiple tests in my v1.17.

If I keep the "savegame" I get the "Error 502 ; image does not exist at line..." I took Terry's script and used "quicksave" instead of "savegame". It saved fine, and when I pressed ESC and clicked "Load", I saw the saved game in slot 1.

Now... I decided to alter Terry's script so that instead of "quicksave" using slot 1, the player could pick the slot. My results- SUCCESS!!

The script attached to the character "fata Save Game". I did lower the fairy a bit so it was closer to the floor.

script modified



And screens to show my results. The first one shows the fairy character as I enter the level.



Next, the "save hud" appears when I am within distance.



Next, the hud disappears, the save game box opens allowing me to select the slot.



Once done, I return to the game. If I press ESC and click "Load Game", I can see the game is in fact saved.



Conclusion

When writing a script to save a game, if you want the player to have the option to select the slot using "savegame", you also need to use the "pausegame" and "resumegame" commands in the script. Without these, I kept receiving the image error. If you don't require the player to select the slot, "quicksavegame" is more than sufficient. The "savegame" is a bit more finicky but this is what we use each time with 100% success.


There's no problem that can't be solved without applying a little scripting.
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 17th Nov 2012 22:38 Edited at: 18th Nov 2012 10:55
Thanks Blackfox, I was thinking there had to be more to it because it works with the menu page which comes from the setuplevel.fpi just fine. I had a temporary fix in the code without having to use the pausegame and resumegame commands. The problem with that is there will not be any image associated with the saved slot. I will let Dave know about this.

Addendum:

I had a dream of how to fix this in the engine code without having to use "pausegame" and "resumegame" in the in-game fpi script. It is 3:30 in the morning and I had to test it right away. So when the next beta comes out then a developer will be able to just use the one command "savegame" in their script. It was only a one line fix or modification.

Of course, right now you can still do this as Mike as suggested. I am sure this is not the first time someone is going to want to just use the "savegame" command so for future users this will work.

Thanks again, Mike, for all your time you put into finding a solution (work-a-round) to this current problem.

lotgd
14
Years of Service
User Offline
Joined: 2nd Apr 2010
Location: italy
Posted: 18th Nov 2012 16:47 Edited at: 18th Nov 2012 16:57
@BlackFox Awesome! I thank you for the time devoted to it. I had almost lost hope. Thanks again!
Tested and working

@F l a t l a n d e r, Thanks again and I hope that you add it in the future version of FPSC, it would be easier to compile a script with the addition that you want to put.

BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 18th Nov 2012 17:13
Quote: "Thanks again, Mike, for all your time you put into finding a solution (work-a-round) to this current problem.
"


Quote: "@BlackFox Awesome! I thank you for the time devoted to it. I had almost lost hope. Thanks again!
Tested and working"


Happy to help. Work-a-rounds are not always fun, but they do work. I just know from our developments we had the same issues and better to pass the knowledge so others don't get frustrated.


There's no problem that can't be solved without applying a little scripting.
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 20th Nov 2012 22:22
Happy to report that r721 has allowed the "savegame" command to be used by itself without the need of the "pause" and "resumegame" commands.

Again, Blackfox's work-around was brilliant and will work until the official version is released and there won't be any problems with scripts that do use them after it's released.

Ross tra damus
3D Media Maker
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Looking to Escape London
Posted: 20th Nov 2012 23:10
Thanks for the news Flatlander and all who are working on the upgrades its certainly a great feature which can be used in many ways and thank you BlackFox for the great workaround.
Thanks also to 'lotgd' for showing us a great way (with fairy character) to use the save game feature.

FPSC just got better.
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 20th Nov 2012 23:11 Edited at: 20th Nov 2012 23:28
Quote: "Happy to report that r721 has allowed the "savegame" command to be used by itself without the need of the "pause" and "resumegame" commands.

Again, Blackfox's work-around was brilliant and will work until the official version is released and there won't be any problems with scripts that do use them after it's released."


I took the "fix" and ported into our source. Here are the results.

The save script attached to the fairy. Notice I removed the "pausegame" from "state=1" line, removed the "resumegame" from "state=2", and put "savegame" at "state=1".

saveprogress.fpi



Screenshot result...

Approach the fairy and hud displays.



Save dialogue box opens up.



After saving, decided to load that save slot.



Slot 1 saved game reloaded and I can continue.



The fix applied works great. Thank you Terry and Dave for implementing this.

Additional

Now there is an anomaly during this process that could arise for some during the process. Here is an example.

I write the script as follows:



When I enter the game, I see the hud and press Y. The Save game dialogue opens up and I select slot 1 as normal. Then I decide to load the game and choose slot 1. After the load, here is the anomaly. The Save game dialogue appears a second time with a distortion.



As you can see in the next shot, the distortion moves as I move the mouse.



I press ESC to close the box, then ESC>Load Game to attempt the load again. After slot 1 loads, the Save game dialogue opens up with no distortion.



Explanation-

The reason is because of how the script was written. By scripting the script with this...



..instead of doing it this way...



...the anomaly will appear (at least for us in v1.17). I'm not saying it will happen to anyone, but if it does, check your script. In other words, there are times when using a command in a script will cause issues because you have it somewhere it does not like. By moving the command on a line and ending the script (like I did above), the anomaly never appears.


There's no problem that can't be solved without applying a little scripting.
lotgd
14
Years of Service
User Offline
Joined: 2nd Apr 2010
Location: italy
Posted: 21st Nov 2012 12:11 Edited at: 21st Nov 2012 12:15
@Flatlander great news, I'm glad FPSC best ever! I love this program. Although the beta 5 has made ​​a hole in the water for the moment.

@Ross tra damus Thank you also for fixed a part of scripts, we hope that in future updates we see something new to extend our games.

@BlackFox I had not noticed this bug! thanks again, I solved by following your advice.





Login to post a reply

Server time is: 2024-11-23 19:38:51
Your offset time is: 2024-11-23 19:38:51