Author Topic: Script Structure  (Read 13195 times)

Offline Fantasist

  • Lexima Warrior
  • *******
  • Posts: 2222
  • LV: 146
  • Gender: Male
    • View Profile
    • Blog
Re: Script Structure
« Reply #40 on: December 05, 2011, 07:51:36 PM »
Ah, so you've covered this already. All the best, then! :)
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)

The best of freeware reviews: Gizmo's Freeware Reviews



Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19903
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Script Structure
« Reply #41 on: December 05, 2011, 10:32:41 PM »
If you have edited 20 maps and hit the save button, you will still get a lot of disk IO.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Fantasist

  • Lexima Warrior
  • *******
  • Posts: 2222
  • LV: 146
  • Gender: Male
    • View Profile
    • Blog
Re: Script Structure
« Reply #42 on: December 05, 2011, 10:51:56 PM »
Of course >_< :facepalm:
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)

The best of freeware reviews: Gizmo's Freeware Reviews



Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3248
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: Script Structure
« Reply #43 on: December 06, 2011, 05:45:04 AM »
I tweaked the save function a little bit. It now behaves like this:

  • Gets the ID of the script by its index in the Script array
  • Creates a filename using the ID and the scripts name
  • Checks if the script has had text modified
  • If not, it compares this filename to the filename the script had when it was loaded
  • If they are the same, nothing is done and it moves to the next script in the enumeration
  • If so, a simple renaming of the files is performed
  • If the script DOES have modifications, the filenames are once more compared
  • If the they are not the same, a new path is generated for the script, and the original path is deleted
  • The script is saved using its internal "path" variable as the location

This should maintain the least amount of IO access, pose no problems with indexing, and pose no problems with moving/inserting/deleting scripts. Does anyone see a problem with this?
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19903
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Script Structure
« Reply #44 on: December 06, 2011, 09:14:48 AM »
I knew you could handle it. <3
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Ryex

  • Arctic Bird of Programming
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 5128
  • LV: 197
  • Gender: Male
  • Wants to write a compiler for fun
    • View Profile
Re: Script Structure
« Reply #45 on: March 09, 2013, 08:48:24 AM »
I'm trying to implantation a way to simply organize scripts in the editor that doesn't involve making blank scripts to act as separators.  a sort of "Region" or "section" like set up where the scripts are still arranged linearly in a list but a inclusive range of indexes could be mapped to a region. I was kind of wanting to make a ScriptIndex file that could store a folder like structure for scripts that the engine could use to determine load order


but if that not a good Idea I guess I can store a list of regions in the project file and map script indexes to them. consecutive indexes with the same tag would be displayed in the list under a folder
« Last Edit: March 09, 2013, 08:49:47 AM by Ryex »
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.

DropBox, the best free file syncing service there is.
(click to show/hide)

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19903
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Script Structure
« Reply #46 on: March 09, 2013, 03:59:01 PM »
I think that's ok as long as we don't violate the script order determine by alphabetic order and our prefix numbers in filenames.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.