VICTOR'S DAMAGE POPUP - NEED HELP

Posts

Pages: 1
So I'm using Victor's Damage Popup script. As found here...

( Tested on a completely new project with just Victor's Basic Engine + Damage Popup script, results remain the same )

What I'm having a problem with, is on Line 286, where you can customize the 'wait' feature. I want to use the 'Random' option to make the text randomly go off to the right or left. So I put 'True' for random. This causes the error:

author=Error
line 1201: TypeError occured
nil can't be coerced into Float

And here's the section of the code.

author=Victor Damage Popup
1193 #--------------------------------------------------------------------------
1194 # * New method: set_move_values
1195 #--------------------------------------------------------------------------
1196 def set_move_values(*args)
1197 @adj_x = (args - args) / (@base * 0.33)
1198 @adj_y = (args - args) / (@base * 0.33)
1199 @zoom_max_x = args
1200 @zoom_max_y = args
1201 @move_x = args * (args ? @random : 1.0) * (@damage_mirror ? -1 : 1)
1202 @move_y = args
1203 @gravity = -args
1204 end

Any ideas on how to fix this?
Trihan
"It's more like a big ball of wibbly wobbly...timey wimey...stuff."
3359
What is line 1201?
author=Victor Damage Popup
1193 #--------------------------------------------------------------------------
1194 # * New method: set_move_values
1195 #--------------------------------------------------------------------------
1196 def set_move_values(*args)
1197 @adj_x = (args - args) / (@base * 0.33)
1198 @adj_y = (args - args) / (@base * 0.33)
1199 @zoom_max_x = args
1200 @zoom_max_y = args
1201 @move_x = args * (args ? @random : 1.0) * (@damage_mirror ? -1 : 1)
1202 @move_y = args
1203 @gravity = -args
1204 end

That's the entire part of the code that I think the problem is with.
Trihan
"It's more like a big ball of wibbly wobbly...timey wimey...stuff."
3359
Okay, so let's break that down.

(args ? @random : 1.0) = if args not nil then @random, otherwise 1.0

So it's looking for a numerical value for @random. true won't work because it's not a number (you can't multiply by false, for instance)
Thanks for the response. :3
So there's no way to get the random function to work for the Damage Script is pretty much what you're saying? O: Or is there a number in that line I can change or so?

OHHH wait I think I might get it, you don't put 'True' you put a number?
EDIT: Apperently not, didn't work. x:
Trihan
"It's more like a big ball of wibbly wobbly...timey wimey...stuff."
3359
Okay, looking at the actual script I see what's happened. When you pasted the bits with square brackets, they didn't appear because the forum parser thought they were tags.

Now that I've read it to see what it does, random is indeed a boolean. Where exactly are you setting it to "true"?
Ah, sorry it did that. D: Glad you can see what's happened though.

On and near line 286, you can customize the various effects, like 'Wait', 'Pop1', 'Rise', etc. And you can choose start x coordinates, etcetc. at the end, you can choose True/False for Random. When I set it to true, it does the error mentioned above.

author=Damage Popup
284 VE_POP_BEHAVIOR = {
285 #type: [ZoomX, ZoomY, StartX, StartY, MoveX, MoveY, Gravt, Random],
286 wait: [ 1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, false],

It isn't aligned exactly, but I'm trying to change the part highlighted in Red to True.
Trihan
"It's more like a big ball of wibbly wobbly...timey wimey...stuff."
3359
And it works fine when the value is false?
Yep, it works fine when it's false.
But when it's true, I get that error.
Trihan
"It's more like a big ball of wibbly wobbly...timey wimey...stuff."
3359
Can you set any of the other ones to true?
Nope. Tested it, and it does the same error.
Something to note, not sure if it's important, is if I put it on 'true' and the effect that's on true doesn't occur in battle, it doesn't give me any errors.
So the error happens only when it's supposed to occur in the battle.
Trihan
"It's more like a big ball of wibbly wobbly...timey wimey...stuff."
3359
Okay, insert a new line above 1201:

p "Args 4: #{@args[4]} Args 7: #{@args[7]} Random: #{@random}"


And tell me what the console outputs.
Alright put it above 1201, and got this;

author=Error
Script 'Victor Damage Popup' line 1201: NoMethodError occured

undefined method '' for nil:NilClass

Put it above and below, just to be sure, same thing. o:

There's brackets that arn't showing after 'undefined method', need to quote to show them I guess.
Trihan
"It's more like a big ball of wibbly wobbly...timey wimey...stuff."
3359
Okay, from what I can tell it works normally because when @random is false, the inline-if statement that checks args[7] returns the value after the : (1.0) and the calculation does its thing as it should.

The problem is, when @random is true, it's trying to use "true" as part of an equation, which is what makes it break.
Alrighty, so any idea on what I should set random to instead of False or will it not be able to work? o.o
Trihan
"It's more like a big ball of wibbly wobbly...timey wimey...stuff."
3359
I've tried walking through the script but I'm honestly not sure what Victor was going for here.

Can you send me your project so I can debug it and find out what's going on with it?
Honestly it's just the script, not the project that's the problem. o: I mean I can send you the entire project to download or you can go to the link in the first post, make a quick new project yourself, put the script in and just work it that way. xD Up to you.
I can link you to the Victor Basic, and Victor Damage, and you can just make a new project and plug those in without the hassle of a big download if that'd be easier.
Cuz even when doing a new project with just those two scripts, it does the same thing.
Trihan
"It's more like a big ball of wibbly wobbly...timey wimey...stuff."
3359
Okay, I'll do that in a sec. Working on part 2 of Jump into Javascript at the moment.
Alrighty, sent a pm with the essentials. :3 Thanks again!
Pages: 1