Author Topic: Selectable Difficult for scenarios  (Read 772 times)

titi_son

  • Draco Rider
  • *****
  • Posts: 283
  • titi_son
    • View Profile
Selectable Difficult for scenarios
« on: 24 September 2011, 21:54:35 »
I mean the following:
If in the script of the scenario are these lines:
Code: [Select]
<difficult-selectable value="true"/>
<difficult number="1" name="Easy"/>
<difficult number="2" name="Medium"/>
<difficult number="3" name="Hard"/>
</difficult-selectable>
You will be ask before start for difficult and
there is a variable for the producer of the scenario (like unitCount )
This variable is set on the number before the name of the difficult.

If this is to hard to make this way may be easier:
Questions ingame: Then you can ask for something like "Do you want 20 archers or swordmans?" too.

i need that for my time is the enemy scenario because i want to ask for difficult.  :P
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Selectable Difficult for scenarios
« Reply #1 on: 25 September 2011, 01:42:48 »
First of all, it should not use a "name" parameter, since that part in particular is translatable. Instead, it should use the number system scenarios already use (0-5), which would be translated into the equivalent word. As well, get rid of the number attribute, for reasons explained below (which would make the tag <difficulty value="x"/>).

Secondly, it would be easier if there was a function to get the difficulty level, eg:
Code: [Select]
if difficultyLevel()==3 do
   createUnit( ... )
end
(Where difficultyLevel() is our function that returns the difficulty selected, as the specified number described above (0-5), in the same method as the other functions do (we don't use variables for other callbacks; we always use functions, and consistency is nice).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

titi_son

  • Draco Rider
  • *****
  • Posts: 283
  • titi_son
    • View Profile
Re: Selectable Difficult for scenarios
« Reply #2 on: 25 September 2011, 16:22:51 »
Secondly, it would be easier if there was a function to get the difficulty level, eg:
Code: [Select]
if difficultyLevel()==3 do
   createUnit( ... )
end
(Where difficultyLevel() is our function that returns the difficulty selected, as the specified number described above (0-5), in the same method as the other functions do (we don't use variables for other callbacks; we always use functions, and consistency is nice).
i mean that
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Selectable Difficult for scenarios
« Reply #3 on: 26 September 2011, 06:17:41 »
Copied from same thread on GAE board

While I certainly prefer the engine callback, it would be best to have some mechanism so that a scenario could tell the engine what difficulty levels it supports, not all authors will be wanting to support all levels.
Example of my proposal method in proper XML:
Code: [Select]
<difficulty-selectable value="true"/>
<difficulty value="0"/>
<difficulty value="3"/>
<difficulty value="5"/>
</difficulty-selectable>
(Note from the first post, difficult -> difficulty)
This would mean we'd have the 0, 3, and 5 difficulties available (aka: "Very easy", "Hard", and "Insane" in the default english translation). As well, the difficulty-selectable tag would replace the difficulty tag, and if both occur, it will take priority. As well, for displaying the "chooseable" difficulty levels, it would probably display it as GAE currently does, with a table showing information about the scenario, but the difficulty value would have arrows around its value. The default value of the difficulty field would be whichever "difficulty" tag appears first, so if the tag is:
Code: [Select]
<difficulty-selectable value="true"/>
<difficulty value="3"/>
<difficulty value="0"/>
<difficulty value="5"/>
</difficulty-selectable>
Then the default difficulty will be 3 (Hard), that way if a scenario has support for a far easier than intended difficulty level, a player who doesn't realize they can choose won't end up playing in a way easier than intended; though more-over it's just to give modders an extra element of choice.

This graphical method of using arrows around the value (similar to how maps  work) could later be expanded to allow choices for different factions or tilesets (though different factions would be far more complex and would also need some method of checking what faction the player chose; in order to create the correct units, etc).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

 

anything