Page 1 of 2

[Script] Get difficulty settings from script

Posted: Thu May 15, 2014 9:58 pm
by MasterJoe
Hi everyone,

How can I, through a script, check what was selected for a difficulty level (easy, medium or hard)?

In my dungeon I would like the players, for example:

-for the play on "hard" give +50% exp reward.
-for the play on "easy" give -50% exp reward.

Thanks in advance.

Re: [Script] Get difficulty settings from script

Posted: Thu May 15, 2014 10:22 pm
by Isaac
MasterJoe wrote:Hi everyone,

How can I, through a script, check what was selected for a difficulty level (easy, medium or hard)?

In my dungeon I would like the players, for example:

-for the play on "hard" give +50% exp reward.
-for the play on "easy" give -50% exp reward.

Thanks in advance.
Wish I knew... I don't think that you can. Something to hope for in LoG2.

** I suppose that you could start the game in a custom settings ~room; and allow the player to flip a lever to choose the difficulty of your mod... or script a GUI menu for it.

Re: [Script] Get difficulty settings from script

Posted: Fri May 16, 2014 2:37 pm
by MasterJoe
Thanks for the quick reply.

In addition, I have been thinking BUT:
How do I make the opponent, as in the regular game: Stronger, more aggressive, more HP, etc.? That would be indeed a huge script. :?

Re: [Script] Get difficulty settings from script

Posted: Sat May 17, 2014 12:54 am
by Isaac
MasterJoe wrote: How do I make the opponent, as in the regular game: Stronger, more aggressive, more HP, etc.? That would be indeed a huge script. :?
Well I have not tried it, but the function setLevel() sets the monster's level... so I would assume that a script could iterate through all of them and boost the level; [as per the monster's definition] or... A script could bump the monsters up a notch when entering the floor for the first time.

In either case, I don't think it would need an overly long script to manage it.
Monster:setLevel(level)
Advances the monster in levels by giving it more health as specified by its level health adjustment property.

Re: [Script] Get difficulty settings from script

Posted: Sat May 17, 2014 1:06 pm
by Komag
Master Quest measures the party's average level and adjust all the monsters accordingly

Re: [Script] Get difficulty settings from script

Posted: Sat May 17, 2014 1:13 pm
by MasterJoe
Ok thanks! :mrgreen:

:?: 2 questions I have thus yet:
1) How "find" I ALL monsters in the dungeon?
2) How do I change, with this script, certain values ​​of the Monster (HP, level, etc.)?

Re: [Script] Get difficulty settings from script

Posted: Sat May 17, 2014 7:12 pm
by Isaac
MasterJoe wrote:Ok thanks! :mrgreen:

:?: 2 questions I have thus yet:
1) How "find" I ALL monsters in the dungeon?
2) How do I change, with this script, certain values ​​of the Monster (HP, level, etc.)?
_________

AH put a list of supported script functions in their 'Modding >> Script Reference' section.

The ones that you want are:
  • allEntities(level)
    Returns an iterator for all entities in a given level.
and
  • Monster:setLevel(level)
    Advances the monster in levels by giving it more health as specified by its level health adjustment property.

Re: [Script] Get difficulty settings from script

Posted: Sun May 18, 2014 12:17 am
by MasterJoe
thanks,

is there a way to set the "attack power" for a monster via script?

Re: [Script] Get difficulty settings from script

Posted: Sun May 18, 2014 1:21 am
by JohnWordsworth
Hey MasterJoe, there are 2 ways I can suggest to scale monsters during the game.

1. In your monster definition, you can set the base 'attackPower' and then 'attackPowerIncrement'. Then, using 'setLevel(...)' on the monster, you can select the current level of the monster, which will increment the attackPower. For instance, if you give a monster attackPower 100 and attackPowerIncrement 50. Then using setLevel(3) would theoretically set it to 200 (100 Base at Level 1 and then 50 more for each extra level). I'm not 100% sure of the maths, as I don't know if the baseLevel is 0 or 1, but this is the idea. I also don't know if there is a max level. It might be 5 or there might not be a max level at all (worth experimenting - just try to set a monster's level to 100 and see if it murders you really fast).

2. If you want to have vastly different types of monsters (throwing bigger spells around at higher levels or changing textures on models to represent 'hard-ass ogre'), then you can use cloneObject({...}) to have slightly different definitions for your monsters and then destroy/recreate monsters in upcoming areas before you get there. You can use this to say "oh, the party are level 1 - we'll give them snails" or "agh, now they're level 30, lets throw a bunch of uggardians at them".

Re: [Script] Get difficulty settings from script

Posted: Sun May 18, 2014 3:28 am
by JohnWordsworth
P.S. I've been thinking for a while now if there is a way to get the official game difficulty at all. I wonder if Monster health changes on hard? If yes, then you *might* be able to do spawn a snail say, set it to level 1 and then see if it has X or Y health. Of course, this might not scale (it might affect damage or other properties instead) but might be worth a try?