Jump to content

Photo

Difficulty settings


  • Please log in to reply
41 replies to this topic

#16 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 06 February 2017 - 08:58 PM

I myself have some serious trouble finding out how to do this. So sorry, I can't help you, but I would like to see this script too.


Of finding out how to make a script that doubles damage, or triples it?

I could make a simple version of this in a few hours. The real issue, is how complex you want it to be.

This could come close... I placed some functions for a difficulty mode adjustment into HurtEffects.zh. Support for this is limited, and you may not Like how I handled 'boosting' enemy HP, as all that I did was reduce the power of Link's weapons.

The alternative is messy, and would require giving npcs more HP as they spawn, and flagging them. The problem with flagging them, is that ghost.zh uses up most of their Misc[] indices. Pick your poison.



You can test this using the Ex1 and Ex2 buttons to adjust the difficulty level down, and up, respectively, with a hardcoded range of ( 1 to 3 ).

Edited by ZoriaRPG, 06 February 2017 - 09:18 PM.


#17 OmegaX

OmegaX

    Leader of Omega GamingHunters101

  • Members
  • Real Name:Matthew
  • Location:Rochester, NY

Posted 06 February 2017 - 09:34 PM

It seems that this request is giving some of you guys a hard time. I've Been thinking about this and so i change my mind on this. I'm reconsidering about blocking the bonus dungeon on easy mode.



#18 Naru

Naru

    Magus

  • Members

Posted 07 February 2017 - 07:53 AM

In regards of the bonus dungeon - if you are finished you could just ask for help including more info. Like my messy workaround ideas, there are solutions, maybe a bit different from what you originally planned, but it is not that much of a big deal. The problem is that we don't know enough about your quest (you don't need to show it here, you could just ask someone to look at it for help and only show it to him/her) and it is always more tricky too find a perfectly general solution.

 

Like my idea with a key given away through a string-code, I don't know if you have NPC's in your quest, if they are NES-guys, if it does fit storywise to have one that gives you a key, if you use level keys, if you used the magic key already, if keys are obtainable through a shop and so on. If you just show your quest to someone with knowledge about scripting it is likely that he/she can point out a script (that you maybe also already use in your quest for other reasons) for a solution that will satisfy your needs.



#19 Deedee

Deedee

    Bug Frog Dragon Girl

  • Moderators
  • Real Name:Deedee
  • Pronouns:She / Her, They / Them
  • Location:Canada

Posted 07 February 2017 - 08:19 AM

It seems that this request is giving some of you guys a hard time. I've Been thinking about this and so i change my mind on this. I'm reconsidering about blocking the bonus dungeon on easy mode.

It's not that this is a hard script to make: It's fairly easy. What's bad about it is that you'd either have to make the default mode easy, or do a really odd workaround where you set Link's Max HP to something high and hide it.



#20 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 07 February 2017 - 08:39 AM

I've mostly been skimming this thread. Why is this so hard?

 

Here's a snippet I extracted from my cancelled quest Kodfest, in which you could press Ex1 out of dungeons to change the difficulty. I removed the changing function so you could make your own menu for it.

 

All it needs is one global variable and one enemy Misc index. And I was using Ghost.zh in this quest.

const int NPC_MISC_DIFF = 0; //When set, enemy difficulty has been adjusted
const int DIFF_EASY = 1;
const int DIFF_MED = 2;
const int DIFF_HARD = 3;
const int DIFF_INSANE = 4;

int difficulty = DIFF_MED;

global script active {
    void run() {
        while(true) {
            //Difficulty adjustment
            if ( difficulty != DIFF_MED ){ //If not medium (default)
                //Check each enemy
                for ( int i = Screen->NumNPCs(); i > 0; i-- ){
                    npc enem = Screen->LoadNPC(i);
                    //If difficulty not adjusted
                    if ( enem->Misc[NPC_MISC_DIFF] == 0 ){
                        if ( difficulty == DIFF_EASY ){    //Easy
                            //Can't set health or damage lower than 1
                            enem->HP = Max(enem->HP * .5, 1); //HP = 50%
                            enem->Damage = Max(enem->Damage * .5, 1); //Damage = 50%
                            enem->WeaponDamage = Max(enem->WeaponDamage * .5, 1); //WeaponDamage = 50%
                            enem->Step *= .85; //Step speed = 85%
                        }
                        else if ( difficulty == DIFF_HARD){ //Hard
                            enem->HP *= 1.5; //HP = 150%
                            enem->Damage *= 2; //Damage = 200%
                            enem->WeaponDamage *= 2;
                            enem->Step *= 1.2; //Step speed = 120%
                        }
                        else{ //Insane (!!!!!)
                            enem->HP *= 1.5; //HP = 150%
                            enem->Damage *= 3; //Damage = 400%
                            enem->WeaponDamage *= 4; //WeaponDamage = 400%
                            enem->Step *= 1.5; //Step speed = 150%
                            enem->Haltrate += 2; //Halt/fire rate increased by 2
                        }
                        enem->Misc[NPC_MISC_DIFF] = 1; //Mark as adjusted
                    }
                }
            }
            
            Waitframe();
        }
    }
}

Edited by MoscowModder, 07 February 2017 - 05:53 PM.

  • Avaro likes this

#21 OmegaX

OmegaX

    Leader of Omega GamingHunters101

  • Members
  • Real Name:Matthew
  • Location:Rochester, NY

Posted 07 February 2017 - 03:45 PM

Thank you, this will do nicely. Two questions though, one when I try to import it into zc it says the difficulty function is undeclared. Two how can I create my own menu to change the difficulty.

#22 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 07 February 2017 - 05:52 PM

Ah, forgot that difficulty had been a function (looking at your items), not a global variable. Updated that. Now you just need to add a menu for setting difficulty and you should be good to go.



#23 OmegaX

OmegaX

    Leader of Omega GamingHunters101

  • Members
  • Real Name:Matthew
  • Location:Rochester, NY

Posted 07 February 2017 - 08:39 PM

all right then it works now, thanks.



#24 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 07 February 2017 - 09:15 PM

You're welcome! Glad to hear it worked.



#25 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 10 February 2017 - 10:30 PM

 

I've mostly been skimming this thread. Why is this so hard?

 

Here's a snippet I extracted from my cancelled quest Kodfest, in which you could press Ex1 out of dungeons to change the difficulty. I removed the changing function so you could make your own menu for it.

 

All it needs is one global variable and one enemy Misc index. And I was using Ghost.zh in this quest.

const int NPC_MISC_DIFF = 0; //When set, enemy difficulty has been adjusted
const int DIFF_EASY = 1;
const int DIFF_MED = 2;
const int DIFF_HARD = 3;
const int DIFF_INSANE = 4;

int difficulty = DIFF_MED;

global script active {
    void run() {
        while(true) {
            //Difficulty adjustment
            if ( difficulty != DIFF_MED ){ //If not medium (default)
                //Check each enemy
                for ( int i = Screen->NumNPCs(); i > 0; i-- ){
                    npc enem = Screen->LoadNPC(i);
                    //If difficulty not adjusted
                    if ( enem->Misc[NPC_MISC_DIFF] == 0 ){
                        if ( difficulty == DIFF_EASY ){    //Easy
                            //Can't set health or damage lower than 1
                            enem->HP = Max(enem->HP * .5, 1); //HP = 50%
                            enem->Damage = Max(enem->Damage * .5, 1); //Damage = 50%
                            enem->WeaponDamage = Max(enem->WeaponDamage * .5, 1); //WeaponDamage = 50%
                            enem->Step *= .85; //Step speed = 85%
                        }
                        else if ( difficulty == DIFF_HARD){ //Hard
                            enem->HP *= 1.5; //HP = 150%
                            enem->Damage *= 2; //Damage = 200%
                            enem->WeaponDamage *= 2;
                            enem->Step *= 1.2; //Step speed = 120%
                        }
                        else{ //Insane (!!!!!)
                            enem->HP *= 1.5; //HP = 150%
                            enem->Damage *= 3; //Damage = 400%
                            enem->WeaponDamage *= 4; //WeaponDamage = 400%
                            enem->Step *= 1.5; //Step speed = 150%
                            enem->Haltrate += 2; //Halt/fire rate increased by 2
                        }
                        enem->Misc[NPC_MISC_DIFF] = 1; //Mark as adjusted
                    }
                }
            }
            
            Waitframe();
        }
    }
}

 

That's the other way of going about it, certainly.

 

The reason that I used Link's attributes, is so that I had fewer instructions, but if you want to set it on the enemy itself, that also works. I think that most people have problems with weird modifiers when making these, and I have no idea why it would be 'hard' to make unless you do something truly exotic.

 

I was just being lazy and using something that already exists as an example. :P



#26 OmegaX

OmegaX

    Leader of Omega GamingHunters101

  • Members
  • Real Name:Matthew
  • Location:Rochester, NY

Posted 11 February 2017 - 09:46 PM

I tried testing the difficulty setting script but it doesn't seem to work. Most importantly, i don't know how to create the menu, am i suppose to use strings, create it through the sub screen, i not really sure?



#27 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 12 February 2017 - 11:29 AM

How do you want the menu to work? When will it be accessible? What should it look like?



#28 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 13 February 2017 - 10:15 AM

How do you want the menu to work? When will it be accessible? What should it look like?

 

MM, if you want, I'll knock out a quick menu for it, that is easy to edit. It'll take me all of 20 minutes.



#29 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 13 February 2017 - 11:30 AM

Go right ahead.

#30 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 14 February 2017 - 09:27 AM

Go right ahead.

 

Brilliant. I'll see if I can do it tonight, and record it. :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users