YesNoOk
avatar

Envshake's increasing problem (Read 1427 times)

Started by *Ken_Masters*, March 09, 2009, 11:03:39 am
Share this topic:
Envshake's increasing problem
#1  March 09, 2009, 11:03:39 am
  • avatar
  • *
Ok i am making a charge code and i want to make it so the env shake gets bigger the longer i stay in the charge state

Thats all working.

But when i stop charging and restarts, the envshake starts small agian

So is it possible for the envshake to remain large when i return the charge like the aura i added

This is the envshake code

Quote
[State 1500, EnvShake]
type = EnvShake
trigger1 = !(time%4)
time = 4
freq = 2+ceil(Time*.05)
ampl = 2+ceil(Time*.05)
Re: Envshake's increasing problem
#2  March 09, 2009, 11:07:22 am
  • ****
  • Master of the palm and foot.
    • randomselect.piiym-net.com/
Use a variable or possible a power check. Time resets to 0 at the start of each state, meaning that when you leave the charge but then return into it, it'll start back over at 0 and cause the envshake effect to start off small again.

By the way, you should probably add some sort of ifelse cap in there so it doesn't get too big.
Re: Envshake's increasing problem
#3  March 09, 2009, 11:13:31 am
  • avatar
  • ******
    • Thailand
You could base it off of your current power:

change the (time*.5) into this: (power*.01)

that way if your power limit is 3000, you can get up to a 30 point boost in your evnshake.

or use a variable as time

varadd
trigger1=time
var(0)=1

that will increase it as the time increases, then instead of time you can use ceil(var(0)*.5), the variable won't reset at the begginign of the state so, reset the variable accordingly.

I recommend playing around with the power thing, it's simple and requires no wasting of variables.



Re: Envshake's increasing problem
#4  March 09, 2009, 11:15:25 am
  • avatar
  • *

I used your first method and it worked thanks Rajaa agian  :)

And thanks Kung_Fu_Man aswell  :)

Oh and BTW Kung_Fu_Man  where would you suggest putting that ifelse cap becuase it does get very big  :-\
Last Edit: March 09, 2009, 11:23:34 am by Ifelse
Re: Envshake's increasing problem
#5  March 09, 2009, 12:57:47 pm
  • avatar
  • ******
    • Thailand
You probably won't need ifelse because the limit is the amount of power you can have in total multiplied by the amount you specified.

Oh it does get big. hold on.

you put it in the equation,

ceil(ifelse(power >= 2000, 20 , power*.01))

In english:

if your power is greater than or equal to 2000, add 20 to the envshake, if power is not greater than 2000, then add "power*.01."

that's an example, if your power is equal to 2000 and is multiplied by .01 you will get a plus 20 to the envshake, so you can make it so when it reaches that point, it stays there. That's what the ifelse statement above does. You can just do the math to figure out how much it increases, then limit it.

Last Edit: March 09, 2009, 01:04:11 pm by Rajaa
Re: Envshake's increasing problem
#6  March 09, 2009, 01:06:59 pm
  • avatar
  • *
You probably won't need ifelse because the limit is the amount of power you can have in total multiplied by the amount you specified.

Oh it does get big. hold on.

you put it in the equation,

ceil(ifelse(power >= 2000, 20 , power*.01))

In english:

if your power is greater than or equal to 2000, add 20 to the envshake, if power is not greater than 2000, then add "power*.01."

that's an example, if your power is equal to 2000 and is multiplied by .01 you will get a plus 20 to the envshake, so you can make it so when it reaches that point, it stays there. That's what the ifelse statement above does. You can just do the math to figure out how much it increases, then limit it.



Ah its a good strength now, i was trying all kinds of crazy codes before hand thanks for all your help ;D
Re: Envshake's increasing problem
#7  March 09, 2009, 01:11:12 pm
  • avatar
  • ******
    • Thailand
Next time, it won't be copy & paste  >:(

Spoiler, click to toggle visibilty