How does the drunk effect work?
#1
Posted 11 January 2018 - 11:42 PM
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
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
Posted 12 January 2018 - 12:19 AM
#4
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
Posted 12 January 2018 - 09:02 AM
Number of frames it lasts for
- Anthus likes this
#6
Posted 12 January 2018 - 09:48 AM
Not sure what you mean there... The random button pressing is the drunk effect.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?
The value you enter just determines how long it lasts. The behavior is the same regardless.
#7
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
Posted 12 January 2018 - 02:58 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users