Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

• 0 Votes - 0 Average
• 1
• 2
• 3
• 4
• 5
 Script Help Explain float afAmount and etc...? Author Message
MissMarilynn
Member

Posts: 74
Joined: Oct 2011
Reputation: 0
 Post: #1 Explain float afAmount and etc...? So a part of my script is StartScreenShake(float afAmount, float afTime, float afFadeInTime, float afFadeOutTime) Can someone explain how to write the numbers? Like for float afAmount say I want it to shake like an explosion...what is the best number to put? There is a cave in so what would be the appropriate amount? Thanks.
01-10-2012 12:25 AM
SCAN ME!

Posts: 3,233
Joined: Jul 2011
Reputation: 215
 Post: #2 RE: Explain float afAmount and etc...? Floats are normally 32-bit decimals (if that confuses you, then just drop the "32-bit" adjective), though it is perfectly fine to use integers too. The best amount is up to you. Note, though, if you don't place an "f" at the end of a decimal number, the script will first consider it a double (a 64-bit float, which uses more memory than a float). PHP Code: (Select All) `float num = 0.0f;num = 5.1233045f;num = 10; ` Tutorials: From Noob to Pro (This post was last modified: 01-10-2012 12:34 AM by Your Computer.)
01-10-2012 12:33 AM
MissMarilynn
Member

Posts: 74
Joined: Oct 2011
Reputation: 0
 Post: #3 RE: Explain float afAmount and etc...? (01-10-2012 12:33 AM)Your Computer Wrote:  Floats are normally 32-bit decimals (if that confuses you, then just drop the "32-bit" adjective), though it is perfectly fine to use integers too. The best amount is up to you. Note, though, if you don't place an "f" at the end of a decimal number, the script will first consider it a double (a 64-bit float, which uses more memory than a float). PHP Code: (Select All) `float num = 0.0f;num = 5.1233045f;num = 10; ` How are these numbers then? StartScreenShake(10, 5, 3, 3); I want it to start as soon as he hits the area, last for about 10 seconds, and then fade out.
01-10-2012 12:52 AM
flamez3
Posting Freak

Posts: 1,320
Joined: Apr 2011
Reputation: 57
 Post: #4 RE: Explain float afAmount and etc...? floatAmount is how much the screen shake. Make that around a 2. floatafTime make that around 10.0f floatFadeTime would be like 0.5f FloatFadeOutTime would be 10.0f If you want to make it fade out. Use FadeOut(10.0f); Aswell Mystery: Chapter 1 http://www.frictionalgames.com/forum/thread-11077.html (This post was last modified: 01-10-2012 03:37 AM by flamez3.)
01-10-2012 01:11 AM
MissMarilynn
Member

Posts: 74
Joined: Oct 2011
Reputation: 0
 Post: #5 RE: Explain float afAmount and etc...? (01-10-2012 01:11 AM)flamez3 Wrote:  floatAmount is how much the screen shake. Make that around a 2. floatafTime make that around 10.0f floatFadeTime would be like 0.5f FloatFadeOutTime would be 10.0f If you want to make it fade out. Use FadeOut(10.0f); Aswell (01-10-2012 01:11 AM)flamez3 Wrote:  floatAmount is how much the screen shake. Make that around a 2. floatafTime make that around 10.0f floatFadeTime would be like 0.5f FloatFadeOutTime would be 1.0f If you want to make it fade out. Use FadeOut(10.0f); Aswell Perfect, thank you very much!
01-10-2012 01:35 AM
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)