YesNoOk
avatar

[solved] Expression Truncated to Integer (Read 374 times)

Started by O Ilusionista, August 06, 2011, 07:32:25 am
Share this topic:
[solved] Expression Truncated to Integer
New #1  August 06, 2011, 07:32:25 am
  • *****
  • 11 years of MFG and counting :)
    • Brazil
    • www.brazilmugenteam.com
I'm having a hard time guessing what is wrong on this code. The code works perfectly, but the debug shows me "Expression Truncated to Integer".
I don't know why since I'm using floor and fvars.

This is the code (which mugen blames):

Quote
;---------------------------------------------------------------------------

[State 1010, HelperPosSet]
type = PosSet
trigger1 = !time
x = floor(parent, pos X)
y = floor(parent, pos Y -60)


[State 1010, ParentVarSet]
type = ParentVarSet
trigger1 = 1
fv = 2
value = floor(pos X)
ignorehitpause = 1

[State 1010, ParentVarSet]
type = ParentVarSet
trigger1 = 1
fv = 3
value = floor(pos Y)
ignorehitpause = 1

[State 1010, Close1]
type = explod
trigger1 = 1
Anim = 1005
pos = (parent,fvar(0)+floor(parent,fvar(0)-parent,fVar(2))/1.1),(parent,fvar(1)+floor(parent,fvar(1)-parent,fVar(3))/1.1)+60
postype = p1
removetime = 1
sprpriority = 4


and at state -3:

Quote
[State -3, PosOffsetX]
type = VarSet
trigger1 = 1
fv =0
value = floor(pos X)

[State -3, PosOffsetY]
type = VarSet
trigger1 = 1
fv = 1
value = floor(pos Y) -60


What is happening?
Last Edit: August 06, 2011, 09:48:48 am by _K.o.W_
Re: Expression Truncated to Integer
#2  August 06, 2011, 07:36:59 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
You have indeed. Except here

cos(time/28.0*pi)*time/2, -80+sin(time/28.0*pi)*time/2

That needs to be an integer too. For the record, cos you have floors rammed all through there where you don't need them. You just need to floor/ciel the result. Not each bit that comes out a float. So the above would be

floor(cos(time/28.0*pi)*time/2), floor(-80+sin(time/28.0*pi)*time/2)

It also makes it simpler to stop yourself missing anything.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Expression Truncated to Integer
#3  August 06, 2011, 07:39:40 am
  • *****
  • 11 years of MFG and counting :)
    • Brazil
    • www.brazilmugenteam.com
but that part isn't part of the problem code. I can take that part away (the Bind) and the problem persists.

edit: I got it:

Quote
pos = floor(parent,fvar(0)+parent,fvar(0)-parent,fVar(2)/1.4),floor(parent,fvar(1)+parent,fvar(1)-parent,fVar(3)/1.4)+60

but now the result is weird:


where the right is this:

Last Edit: August 06, 2011, 07:48:31 am by _K.o.W_
Re: Expression Truncated to Integer
#4  August 06, 2011, 08:45:10 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
For that, i'd actually use parentdist over pos X. Cos pos X changes at mid way.

Doesn't help with the up/down action. Start with a point on your character rather than a variable and work backwards. To me, that equation looks like you're making something simple complicated. Does the Y axis it comes out at actually move, or is it just a static position?

Assuming the ball is a helper? Have it posadd to the right spot and position the helpers behind itself based on parentdist. Or something. What you have looks awkward for what appears to me to be a simple "leave behind blobs for chain"


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Expression Truncated to Integer
#5  August 06, 2011, 08:53:12 am
  • *****
  • 11 years of MFG and counting :)
    • Brazil
    • www.brazilmugenteam.com
Re: Expression Truncated to Integer
#6  August 06, 2011, 09:25:23 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
You want to do that EXACT thing? What you just sent me lets me move the ball on the fly, assuming that's not what you're after. You want it to go out, then pull back to where it left?


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Expression Truncated to Integer
#7  August 06, 2011, 09:29:40 am
  • *****
  • 11 years of MFG and counting :)
    • Brazil
    • www.brazilmugenteam.com
The movement is unfinished, its just for testing. Yes, the ball will move back to the original position.
I will use this formula to make many of its attacks, so I need the get rid of the debug flood.

Send me the code with the clean debug, please.

Seeing the code now, do you think its still complicating something simple? If you have other suggestions, drops me a line
Re: Expression Truncated to Integer
#8  August 06, 2011, 09:48:33 am
  • *****
  • 11 years of MFG and counting :)
    • Brazil
    • www.brazilmugenteam.com
thanx, I got it now.