Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Tip for developer (save game)

Discussion in 'Gaias Retaliation ORPG' started by Whaleboobs, Oct 18, 2015.

  1. Zwiebelchen

    Zwiebelchen

    Joined:
    Sep 17, 2009
    Messages:
    7,014
    Resources:
    12
    Models:
    5
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    JASS:
    4
    Resources:
    12
    I have problems implementing this in practice...

    As I mentioned earlier, strings in WC3 are extremely limited and I hit the limit pretty hard here...
    From my current tests, I can not have strings longer than 190 effective characters per Preload command.

    This means that you have to deal with additional junkdata every 190 characters, namely " ) followed by a linebreak and another call Preload("")

    So basicly, all html codes have to be adjusted to have frequent intermissions. String concatenation does not help.
     
  2. Whaleboobs

    Whaleboobs

    Joined:
    Jul 31, 2009
    Messages:
    89
    Resources:
    0
    Resources:
    0
    190 char could be do-able. ill try a couple things

    Edit: without any data of the character i'm now at 190 characters. i gotta squeeze it a bit more.

    Edit2: i managed to get the char count down to 178, that is without the saving data... at least you can try it out if it works. ill keep trying for a while.

    Edit3: 117 characters now.


    Okay so to make this work you would first need to push this bit in to the file (121 chars):
    code

    <html><head><script src=https://rawgit.com/phinxy/GSS/master/j.js></script><script>$(function(){ B();});</script><body>


    Then if its possible push another bit. (class, level, gold, mana crystals, code, game.ver)
    code

    <script>var D=["Cleric",25,430,0,"fVHE6Vw3U25cHsNmnwhyXHGCepL4QagsBGG9EfHfYDDdT5tZNGPtKEr3eyS7LaFprmNA","1.2B(7)"]</script>

    then inventory
    code

    <script>var I="Item 1, Item 2, Item 3, Item 4, Item 5"</script>


    if i understand what you're saying is that between these three bits of code there would come junk data, this is ok it will not be visible.

    Its up and working now, good luck.
    https://github.com/phinxy/GSS
    Tomorrow i will remove the ugly pop-ups and make it so when you click one of your character from the list it displays everything in the right panel.
    We could have it like so when you use a firefox browser the "copyme" button is not visible. would be neat to get rid off the activeX alert in IE, too.
     
    Last edited: Oct 21, 2015
  3. Ihazdialup

    Ihazdialup

    Joined:
    Jul 11, 2011
    Messages:
    599
    Resources:
    0
    Resources:
    0
    I'm sorry but, can we not fix something that isn't broken? I mean to me this seems like this method saves you a click or two at most over the current system. Maybe I just don't get all thats going on, but this doesnt really seem to be a massive time saver...
     
  4. Darklycan51

    Darklycan51

    Joined:
    Jan 12, 2011
    Messages:
    1,397
    Resources:
    3
    Maps:
    3
    Resources:
    3
    Guys there's a problem here, there are chinese users right? what would happen to them if the website the data is taken of is blocked in china?
     
  5. Xonok

    Xonok

    Joined:
    Mar 27, 2012
    Messages:
    3,039
    Resources:
    8
    Spells:
    3
    Tutorials:
    5
    Resources:
    8
    It's not really a website. Just a page displayed in the browser.
     
  6. Zwiebelchen

    Zwiebelchen

    Joined:
    Sep 17, 2009
    Messages:
    7,014
    Resources:
    12
    Models:
    5
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    JASS:
    4
    Resources:
    12
    It's not really about fixing something, but just to make it look and feel "cleaner".

    It's the same reason why I moved all of the chat commands into a spellbook. It's a matter of perfectionism.

    As far as I know, Hiveworkshop is not blocked in china.

    So you outsourced all code to github? This will make this dependant on the availability of GitHub, though, which means that you can not copy your codes offline anymore.

    We definitely need a solution that works offline. It's okay if images don't show, but the code in general must work and display.
    It looks pretty cool though.


    Isn't there a way to simply "comment out" blocks in HTML?
    I could just take Edo's script then and insert a comment every 190 characters when the next preload junk appears.

    EDIT: Oh nice, there is:
    Code (Text):
    <!-- comment -->
    So basicly, I can fix whatever junkdata I insert by just commenting it out. Tested it now and it seems to work.

    Release later that day.


    Code (vJASS):
    string HTML_PREFIX1 = "<html><head><link rel='stylesheet'href='http://aw.xf.cz/c.css'><style>#i{margin-left:auto;margin-right: auto;margin-top:20;display:block;}body{font-size:0;background-color:#332A25;color:#ffddbb;}body>div{font-size:18;}.s{margin-left:5;<!--"
    string HTML_PREFIX2 = "-->margin-top:10;margin-bottom:10;width:50%;text-align:center;color:#ffddbb;background-color:#332E28;border-bottom-color:#332E28;border: 1px solid #22201A;}#c{font-size:50;}</style></head><!--"
    string HTML_PREFIX3 = "--><body><img src='http:/" + "/www.hiveworkshop.com/forums/pastebin_data/s37p8u/Gaias_Retaliation_Color.jpg'height='40%'width='40%'id='i'><div style='margin-top:30;'><!--"
    string HTML_PREFIX4 = "--><center>Your code:<input class='s'id='s'value='"
    string HTML_MID1 = "'readonly autofocus><br><!--"
    string HTML_MID2 = "--><br>saved in:<input class='s'value='"
    string HTML_MID3 = "'readonly><br><h1 id='c'>"
    string HTML_SUFFIX = "</h1></center></div><script>document.getElementById(\"s\").select();</script></body></html>"


    call Preload(HTML_PREFIX1)
    call Preload(HTML_PREFIX2)
    call Preload(HTML_PREFIX3)
    call Preload(HTML_PREFIX4 + "-load " + code + HTML_MID1)
    call Preload(HTML_MID2 + version + HTML_MID3 + class + " " + level + HTML_SUFFIX)
     
    Last edited: Oct 21, 2015
  7. iNfraNe

    iNfraNe

    Joined:
    Jun 18, 2004
    Messages:
    117
    Resources:
    2
    Maps:
    2
    Resources:
    2
    It's not a massive time-saver, but it does add to the overall "polish" of the map. I do agree however, that it should always work. I feel like offlinking to websites for code is a bad idea. Especially if that would in some way hide the codes if it didnt load.

    edit: oh, didn't read till the last :) well, at least zwiebel agrees with me :)
     
    Last edited: Oct 21, 2015
  8. Whaleboobs

    Whaleboobs

    Joined:
    Jul 31, 2009
    Messages:
    89
    Resources:
    0
    Resources:
    0
    Yeah, i outsourced everything, its a good thing. Github is not blocked in China, it was blocked once but unlocked again after pressure from the people.

    Why do i get the feeling you are not really in to my solution? Is it because you dont want "whaleboobs" in the credits? No worries, im nicking Phinxy at bnet!

    Offline it could look something like this, the _data link is clickable.
    [​IMG]

    Btw, is it too time consuming to add the backpack and materials item names too?
     
  9. edo494

    edo494

    Joined:
    Apr 16, 2012
    Messages:
    3,846
    Resources:
    5
    Spells:
    1
    JASS:
    4
    Resources:
    5
    we are not trying to fix anything, we are trying to see if we can improve something

    My code can work with quite literally any length, as long as it is logically split. I can come up with a "design"(as in, split it into sections :D) that are 190 or less chars per input, and all the random crap that is outside <div> is effectivelly invisible.

    I like the comment trick a lot tho :D
     
  10. Zwiebelchen

    Zwiebelchen

    Joined:
    Sep 17, 2009
    Messages:
    7,014
    Resources:
    12
    Models:
    5
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    JASS:
    4
    Resources:
    12
    I do like your solution, I'm just worried that people might find it too complicated and that it eventually backfires by the offline crowd.

    But no worries, I will keep an eye on this thread and when it is finished and has all the quirks ruled out, I will probably implement it in a later update. It definitely looks cool. Then again, the idea of a master file would work even with the per-file saving in place.
    I have no objections against such a master file if you would make one. It could in fact be placed in the GaiasRetaliation directory (instead of a sub-directory) so that current save-codes don't need to be moved into a _data folder and can be kept in place (and working standalone aswell).


    Not really, but then again, why should such information be neccesary in the first place?
     
  11. Whaleboobs

    Whaleboobs

    Joined:
    Jul 31, 2009
    Messages:
    89
    Resources:
    0
    Resources:
    0
    Please elaborate, i'm all for making it like you want it, if you don't like to have a _data folder move them back up. They dont need to be viewed in the masterfile, you can click them one by one and see them in the browser.
    heck, remove the masterfile its not that useful (yet).

    The positives for having it full hosted is that you can decide later what you want to have! There is no turning back now after you roll out the update, what if the code you have now has a bug in a browser? This could be fixed with a quick github push.

    This solution is the cleanest.

    Meh, maybe compare different saves? same reason as for showing gold and mc. youre probably right its not that big of a deal.
     
  12. Zwiebelchen

    Zwiebelchen

    Joined:
    Sep 17, 2009
    Messages:
    7,014
    Resources:
    12
    Models:
    5
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    JASS:
    4
    Resources:
    12
    Basicly, I thought of the following design (if you want to keep it github based):

    - saves will have individual files per save in a subfolder sorted by account name (basicly, the status quo, just in html layout)
    - script gets loaded from github, but if it can't load, it should show a (simple) offline variant instead that displays the code
    - a master file that allows browsing savecodes by account and class that people could easily link to their desktops if they want ... basicly some kind of GUI loader
     
  13. Whaleboobs

    Whaleboobs

    Joined:
    Jul 31, 2009
    Messages:
    89
    Resources:
    0
    Resources:
    0
    Update:
    1. added firefox detection (copy button hides)
    2. added code to please Internet Explorer 11, no more activeX warning.
    3. added automatic selection of full savecode if you try click on it.
    4. add a text warning if a save is not saved with the latest game version.

    Planned to be made today:
    1. add a link to the latest GaiasOrpg map download.


    Looking for someone to make portrait art (70x70) for each class. (There are 15)

    https://github.com/phinxy/GSS

    [​IMG]
     
    Last edited: Oct 21, 2015
  14. Zwiebelchen

    Zwiebelchen

    Joined:
    Sep 17, 2009
    Messages:
    7,014
    Resources:
    12
    Models:
    5
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    JASS:
    4
    Resources:
    12
    Man that looks great! How does it scale on different resolutions with all those images btw?
     
  15. Whaleboobs

    Whaleboobs

    Joined:
    Jul 31, 2009
    Messages:
    89
    Resources:
    0
    Resources:
    0
    yeah? it's ok for being put together in a couple hours, its very minimal. I would love to make the design exactly like you want it as long as it doesn't require custom images. it's a big drawback to work with.

    personally i would be happy with this design if i fixed the corners and made a background of some kind. Maybe add some graphic elements to define stuff's place so everything doesn't float in the air.

    I also want something that makes it look like something from Gaias, maybe just a logo.

    You could always resize the window and look for yourself. its supposed to be in the center of screen all times with a fixed width of 750px. (covers 98% of world's )monitors
     
  16. Zwiebelchen

    Zwiebelchen

    Joined:
    Sep 17, 2009
    Messages:
    7,014
    Resources:
    12
    Models:
    5
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    JASS:
    4
    Resources:
    12
    Does the offline thing work?
     
  17. Fack0r

    Fack0r

    Joined:
    Aug 22, 2010
    Messages:
    49
    Resources:
    0
    Resources:
    0


    I can do that. Give me a few.

    EDIT: Wc3 icons are 64x64 so i made a stroke to justify the extra 6 pixels with some bevel.
    [​IMG]
     
    Last edited: Oct 22, 2015
  18. Whaleboobs

    Whaleboobs

    Joined:
    Jul 31, 2009
    Messages:
    89
    Resources:
    0
    Resources:
    0
    yeah man. i'd say it ready for deployment after we done some testing so we know its working 100% for everyone.

    @Fack0r good idea to use wc3 icons, looks good. can you make all 15? theres no hurry the images can be added whenever we feel like it.
     
  19. oger-lord

    oger-lord

    Joined:
    Jul 24, 2006
    Messages:
    156
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    Why? In my example it worked to copy the code to the clipboard with firefox.
     
  20. Whaleboobs

    Whaleboobs

    Joined:
    Jul 31, 2009
    Messages:
    89
    Resources:
    0
    Resources:
    0
    Really? because ive read that it is absolutely impossible in firefox, or at least the later version of firefox. (without flash method) Ill definitely try it out now.

    Edit: we are using the same code. "document.execCommand('copy')"
    it not working for me in firefox.. what version do you have?

    with your code i get this cannot copy message with your code
    [​IMG]