Welcome, Guest. Please login or register.

What openbor you prefer: Double dragon,battletoads or final fight !? by lirexpatrio
[December 07, 2012, 07:15:27 pm]


what are your favorite games OpenBOR?! by lirexpatrio
[December 07, 2012, 07:09:46 pm]


Post Some Awesome Videos by maxman
[December 07, 2012, 05:51:39 pm]


Can @cmd playmusic "aaaa" 1 also increse music sound ? by BeasTie
[December 07, 2012, 05:24:38 pm]


Streets of Rage: Silent Storm by mtrain
[December 07, 2012, 03:45:05 pm]


Site will be down for maintenance on 12/8/2012 thru 12/10/2012 by Damon Caskey
[December 07, 2012, 07:42:42 am]


Cancelled SOR 3d Remake by riccochet
[December 07, 2012, 03:58:33 am]


Dungeon Fighter: B.O.R. by msmalik681
[December 07, 2012, 03:24:27 am]


[TUTORIAL] How to create 4 Games of OpenBOR in 1 CD (650 MB) by magggas
[December 06, 2012, 09:46:25 pm]


custknife by Bloodbane
[December 06, 2012, 09:34:09 pm]


blockfx help by B.Kardi
[December 06, 2012, 04:09:14 pm]


street of age 4 hd by corradlo
[December 06, 2012, 01:41:36 pm]


ClaFan - Classic Fantasy ver 1.17 by soniczxblade
[December 06, 2012, 05:01:20 am]


Bug Archive by Bloodbane
[December 06, 2012, 02:00:44 am]


"Bio-Doom" and "Gears of Doom" by BulletBob
[December 05, 2012, 10:07:21 pm]


Contra Locked 'N' Loaded v2 by Bloodbane
[December 05, 2012, 09:39:43 pm]


Downloadable OpenBoR Manual by BeasTie
[December 05, 2012, 08:31:24 pm]


Having trouble testing changes by B.Kardi
[December 05, 2012, 03:05:53 pm]


DragonBall Absalon by msmalik681
[December 05, 2012, 02:52:13 pm]


[Hi-Res] Swamp by Vibrant
[December 05, 2012, 10:47:14 am]


  • Dot Guests: 170
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.



Author Topic: Restricting script save/load [done in 3314]  (Read 346 times)

0 Members and 1 Guest are viewing this topic.

Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Restricting script save/load [done in 3314]
« on: September 01, 2011, 10:36:24 am »
I realized a problem of current script save file issue.

That is not all kinds of variables are saved properly:

1. Integers, decimals

They shouldn't have any problems.

2. Pointers

They can be save/load normally. But since the pointers are changed in a new game, so saving them is really pointless.

3. Strings

Due to current string cache mechanic, they can't be loaded properly because the cache is gone if you close the program.




In this case I have another idea to save the script variable other than dumping the memory into disk.
All global variables should be saved in a script file which can be load and executed.

The script file should looks like this:

Code: [Select]
void main(){
   setglobalvar("newname", "Frankenstein");
   setglobalvar("charlevel", 99);
   setglobalvar("defense", 0.46);

   setindexedvar(3, 85);
   setindexedvar(9, 66);


}

A side effect of this is the player can hack this easier than the binary save.
« Last Edit: September 02, 2011, 11:02:22 am by utunnels »

Offline Damon Caskey

  • Hero Member
  • *****
  • Posts: 5335
    • The Gorge
Re: Restricting script save/load
« Reply #1 on: September 01, 2011, 10:47:23 am »
Are you sure you want to worry about this? The filestream functions already allow controllable persistence by reading/writing text files if a modder so chooses.

DC
OpenBOR Wiki.

Coming Soon:
Spoiler
Fatal Fury Chronicals


Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: Restricting script save/load
« Reply #2 on: September 01, 2011, 10:58:11 am »
The default save function should at least work properly, otherwise all user have to write their own save/load functions. Text format is easier to handle and keeps its functionality even if script variable changes its structure.

« Last Edit: September 01, 2011, 11:00:15 am by utunnels »

 



 0%




SimplePortal 2.3.3 © 2008-2010, SimplePortal