Author Topic: Script modification : any idea what I screwed up?  (Read 317 times)

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
EDIT: as expected it was a ridiculous copy and paste mistake
« Last Edit: 05 Jul 2018, 22:51 by Monsieur OUXX »
 

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Script modification : any idea what I screwed up?
« Reply #1 on: 04 Jul 2018, 15:41 »
I know this is not what you are asking about, and TBH I am not using that module so that's just a passer-by's opinion, but using arrays with enums instead of distinct variables look so inconvenient... You are loosing explicit variable types that way and prevent possibility of adding a setting of non-integer type (among other less important things).

For example, "text_align" variable could have type of Alignment, declaring its meaning and possible range of values, and also you get autocomplete hints when setting it. With all-ints arrays you cannot do that.

Could I suggest to instead split these variables into several structs? Like CustomDialogTextParams, CustomDialogLayoutParams etc.
You may even implement these as managed structs, then store their pointers inside bigger CustomDialogGui, if that's desired, and perform similar operations with applying and returning settings too.
« Last Edit: 04 Jul 2018, 15:57 by Crimson Wizard »

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: Script modification : any idea what I screwed up?
« Reply #2 on: 04 Jul 2018, 22:31 »
EDIT : as expected it was some ridiculous copy and paste mistake.

Add spoiler tag for Hidden:
I know this is not what you are asking about, and TBH I am not using that module so that's just a passer-by's opinion, but using arrays with enums instead of distinct variables look so inconvenient...

Yup, but there's something that you don't know because I didn't explain my plan: These arrays can then be manipulated in an abstract manner through Ultravariables (or similar module), and each value can be given a name which can be displayed on screen at any time. More settings can be added without having to duplicate accessors many times. Simply think of it as a poor man's XML settings file, except it's flat (array). Since AGS script is not reflexive, that's my way of manipulating objects members in a weakly-typed manner, and add some dynamically, as you would do in Javascript or Powershell. I'm not going over the top though : I'm only doing it for settings, not for critical, internal values.
« Last Edit: 05 Jul 2018, 22:52 by Monsieur OUXX »