Jump to content

Photo

How does the drunk effect work?


  • Please log in to reply
7 replies to this topic

#1 Architect Abdiel

Architect Abdiel

    Kingdom Builder

  • Members
  • Real Name:Michael
  • Location:Florida

Posted 11 January 2018 - 11:42 PM

So I've been working in the enemy editor today and two of my enemies give drunk effect on touch.

The enemy editor on wiki says...
Drunk: Link's drunk clock is incremented. Link's controls are randomly interfered with while it is in effect. Effect Strength determines how much.

Can someone elaborate on what how much means? And maybe give me some examples on a good number to use for effect strength?

#2 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 12 January 2018 - 12:09 AM

So I've been working in the enemy editor today and two of my enemies give drunk effect on touch.

The enemy editor on wiki says...
Drunk: Link's drunk clock is incremented. Link's controls are randomly interfered with while it is in effect. Effect Strength determines how much.

Can someone elaborate on what how much means? And maybe give me some examples on a good number to use for effect strength?

 

Drunk randomises if button input is translated into an effect. As far as I can see, the clock only determines how long the effect lasts (in frames). The actual randomisation looks like this:

bool DrunkRight()
{
    return drunk()?(rand()%2)?0:!Right():Right();
}

Translated, if Link is drunk, produce a random number from 0 to 1. If that value is 0, interfere/block that input; otherwise let it work as normal.

 

The effect 'strength' does not determine the randomness, or the way that button presses are changed. It is only the duration. A good value is anywhere from 30 to 240, determining on how evil you want to be. 30 would be 1/2 second, 240 would be 4 seconds.

 

Setting the DrunkClock to -1 would mean that the effect is perpetual, and you would need a scripted way to undo that. The DrunkClock is cleared on death.


  • KingPridenia likes this

#3 Architect Abdiel

Architect Abdiel

    Kingdom Builder

  • Members
  • Real Name:Michael
  • Location:Florida

Posted 12 January 2018 - 12:19 AM

So, if I'm understanding this correctly, if I put in a number that isn't 1 Link should not have his buttons affected, and will just have the drunk effect?

#4 Anthus

Anthus

    Lord of Liquids

  • Members
  • Location:Ohio

Posted 12 January 2018 - 01:12 AM

Setting the DrunkClock to -1 would mean that the effect is perpetual, and you would need a scripted way to undo that. The DrunkClock is cleared on death.

And work on Link's Hangover just resumed.

So is 'drunk effect' the amount of frames that each effect lasts for then? Or is it the amount of frames between potential changes? I was wondering about this too.



#5 strike

strike

    life is fragile, temporary, and precious

  • Members
  • Real Name:Olórin

Posted 12 January 2018 - 09:02 AM

Number of frames it lasts for


  • Anthus likes this

#6 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 12 January 2018 - 09:48 AM

So, if I'm understanding this correctly, if I put in a number that isn't 1 Link should not have his buttons affected, and will just have the drunk effect?

Not sure what you mean there... The random button pressing is the drunk effect.
The value you enter just determines how long it lasts. The behavior is the same regardless.

#7 Deedee

Deedee

    Bug Frog Dragon Girl

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

Posted 12 January 2018 - 01:44 PM

Yeah, Drunk is basically random button presses. If you were hoping for a "Dizzy Screen" effect, ya need to script that.



#8 Architect Abdiel

Architect Abdiel

    Kingdom Builder

  • Members
  • Real Name:Michael
  • Location:Florida

Posted 12 January 2018 - 02:58 PM

Thanks. Yeah, I've been playing with the effect strength. Getting a better idea of how it works by purposefully running into enemies.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users