I accidently discovered this when I was trying to rotate the sight area sprite for a sneak dungeon in my game. The character sprite started "walking weird" since I made a mistake in the scripts. I present you the DRUNKEN ADD-ON!
You can activate it for an event by using the script call "$game_map.events[ID].drunken = true" or for the player "$game_player.drunken = true".
class Game_Character
attr_accessor :drunken
end
class Sprite_Character
alias init_drunken_later initialize
def initialize(viewport, character = nil)
@drunken_mode = true
init_drunken_later(viewport, character)
end
alias upd_drunken_later update
def update
upd_drunken_later
if @character != nil && @character.drunken
if @character.moving? || self.angle != 0
if @drunken_mode
self.angle += 1
@drunken_mode = (self.angle <= 8)
else
self.angle -= 1
@drunken_mode = (self.angle < -8)
end
else
@drunken_mode, self.angle = true, 0
end
end
end
end
It comes above Blizz-ABS if you use it. I suggest you try this out, it's fun. :D
When I read this, made me laugh so hard. XD
XD took me 3 seconds to get here from the time I saw the title. Would be a really interesting add-on for some bars and whatnot :P
I get some undefined method 'angle' error whenever I try this for both the character and other events
lol, that is the funniest script I have ever seen. I think you should add it to tons of addons, making a "drunk" state possible. That'd be awesome, especially for the blizzABS. It could decrease accuracy, and increase strength and whatnot. Great discovery blizz.
Yes, that's right. Blizzard is so good at scripting he can make awesome scripts by accident. XD
This is ROFL worthy. Great job! :D
I wasn't going to support that script. xD I just put it up because it was kinda fun. And yeah, it's possible that it doesn't work right with some systems. Heck, it's even possible that it's buggy itself. xD
I think this would be an awesome script to add and fix up a bit. It could really be interesting to put with some beer and a character in battle after some city bar hopping >.>
Bump due to awesomeness. :3
I love it :P :)
Could somebody post some screenshots of this please, Lmao...
If not that would be okay, because anything Blizzard is worth the download.
I'm just asking for someone to save me the hassle.
It's really hard to post a screenshot of something that changes the animation of a hero unless the screenshot is an animated image. And I never really got to doing or finding out how to do that (I would know how thanks to Google).
Oh...nevermind...
I thought it would be like them staggering and you would be able to get a shot of them kinda diagonal or something...sorry...
I will be less lazy and download the demo
could this script work with moving events, becuase it would be well funny just to have random drunk people walking about. :haha:
Sure.
that is hellish funny, i just made like 10 random people walking like they were drunk.
That's so silly Blizz XD
I don't know whether I should say 'Good job' or 'Good mistake' :P
But it's lovable, lol!
It is indeed XD
How practical it is is another matter.
It's still nice as an add-on. As a few people here suggested, it can be used to display a drunken status effect when displaying status effects on the map.
or just place drunk people in a game for the fun of it. most games have easter eggs in them (jokes) and i plan to have a few jokes in mine aswell and this is a perfect joke.
(http://img405.imageshack.us/img405/6047/0001af5.png)
Screenshot for those who wish it :)
Sooo... if I wanted to "be used to display a drunken status effect when displaying status effects on the map", how would I go about it? >.<
You are quite right Blizz.
I do not believe you made it with a practical purpose in mind though.
Even so it is quite nice XD
Nice screenshot Aqua. It depicts how it works quite nicely.
As I said, it was an accident after all. xD
Hey, penicillin was an accident! ;)
Sometimes accidents are wonderful :P
Well, not all scripts need to be pivotal to the game. Little ones like this mount up and add to the overall presentation. You could use this to simply place a drunken NPC outside a bar or something.
Nice accidental script you've made here. 8)
Necro due to overwhelming amount of awesome. I may just have to use this. xD
I approve your decision to necro-bump. :haha:
Made an entire event system based off of this script. Now you get can buy beer at the bar and if you drink more than 4 (Lightweight) the colors start messing up and the drunken state is on. May not be entirely practical considering the beer has no other effects yet, but I really want to work on it more so who knows. Thanks for posting your mistake. :haha:
Polish it up and post it :P
Quote from: Hellfire Dragon on August 29, 2008, 10:23:15 am
lol that's awesome :haha:Is there a way for them to keep 'wobbling' when they are standing still?
class Game_Character
attr_accessor :drunken
end
class Sprite_Character
alias init_drunken_later initialize
def initialize(viewport, character = nil)
@drunken_mode = true
init_drunken_later(viewport, character)
end
alias upd_drunken_later update
def update
upd_drunken_later
if @character != nil && @character.drunken
if @character.moving? || self.angle != 0 || !@character.moving?
if @drunken_mode
self.angle += 1
@drunken_mode = (self.angle <= 8)
else
self.angle -= 1
@drunken_mode = (self.angle < -8)
end
else
@drunken_mode, self.angle = true, 0
end
end
end
end
EDIT:
Sorry, didn't notice the post date.
Its fine this time. The last date wasn't 90 days ago. Necro posting is when you post in a topic that hasn't been replied to in over 90 days. Its only allowed if you're relating to the thread as in helping, asking for help, etc... In this case you didn't necro and if you did, its helpful to the topic.
I'm sorry for necroposting.
Did anyone know how to deactivate this script?
because once you activate it, it works all the time.
So, how to do the character get sober again?
PS: my english sucks. :^_^':
$game_map.events[ID].drunken = false
$game_player.drunken = false
Quote from: LiTTleDRAgo on March 12, 2013, 01:03:35 am
$game_map.events[ID].drunken = false
$game_player.drunken = false
I tried this: $game_player.drunken = false , but then the whole game stop.
sorry, just the player stop, and no matter what, he doesn´t move.
http://forum.chaos-project.com/index.php/topic,938.0.html
I should just add this to my siggy, seeing as I've posted this link over 5 or 6 times now.