Author Topic: FRED doesn't like fractions  (Read 16465 times)

0 Members and 1 Guest are viewing this topic.

Offline Axem

  • 211
FRED doesn't like fractions
Sigh...

I'm trying to time events exactly to something, however FRED will only let me set delays or chains to whole numbers. I've tried inputting it as a decimal number (47.5), as a fraction using the divide operator (95/2), even going into notepad and working behind FRED's back, but alas none of it works.

Anyone have any ideas how to get around this?

 

Offline Nuclear1

  • 211
FRED doesn't like fractions
The only time I've had fractions work for me is in send-message-list, but otherwise, I don't think there is a way around. Sorry bro.
Spoon - I stand in awe by your flawless fredding. Truely, never before have I witnessed such magnificant display of beamz.
Axem -  I don't know what I'll do with my life now. Maybe I'll become a Nun, or take up Macrame. But where ever I go... I will remember you!
Axem - Sorry to post again when I said I was leaving for good, but something was nagging me. I don't want to say it in a way that shames the campaign but I think we can all agree it is actually.. incomplete. It is missing... Voice Acting.
Quanto - I for one would love to lend my beautiful singing voice into this wholesome project.
Nuclear1 - I want a duet.
AndrewofDoom - Make it a trio!

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
FRED doesn't like fractions
SEXPs are built to work on intergers. I don't think there's much of a way round this.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
FRED doesn't like fractions
Would it be possible to use variables for these figures?  Then you could calculate the decimal figure you want and store its value in a variable, and use that.  Is that possible?
The Trivial Psychic Strikes Again!

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
FRED doesn't like fractions
AFAIK variables also use integers. You can try it but I doubt you'll have much success.

Even if you could get an integer into a variable though FS2 would simply cast it to an integer as soon as it's used in a SEXP anyway and you've be back to square one.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline ShadowWolf_IH

  • A Real POF Guy
  • 211
    • CoW
FRED doesn't like fractions
there was once a discussion in the scp about changing the entire system over to ms instead of seconds......but if that happens...so much for backward compatability.
You can't take the sky from me.  Can't take that from me.

Casualties of War

 

Offline Kie99

  • 211
FRED doesn't like fractions
Couldn't there be some extra sexps, for example, has-time-elapsed and has-time-elapsed-ms?
"You shot me in the bollocks, Tim"
"Like I said, no hard feelings"

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
FRED doesn't like fractions
The entire sexp system is based around integers.  Period.  You can't use decimal numbers without rewriting part or all of the sexp system.

 

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
FRED doesn't like fractions
I suspect that a situation that requires such precise timing is likely to break once the player gets in there and starts mucking around anyway.
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

The Scroll of Atankharzim | FS2 syntax highlighting

 

Offline Axem

  • 211
FRED doesn't like fractions
What I was thinking to trick by finding something that takes half a second to do (or some fraction of a second), and then use the event delay so it fires off at a whole number of seconds later. I would just need to find something that takes a half second to do, or is almost everything based on whole seconds?

I should add this is for a cutscene, not a player controlled enviroment, so what the player does, doesn't matter.
« Last Edit: September 14, 2005, 08:02:49 pm by 1840 »

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
FRED doesn't like fractions
Do this then. Create a ticker timer with an event like this

Timer - Provides half seconds
When
-is-event-true-delay
--Some event half a second before what you want.
-modify-variable
--TickerTimer(0)
-- +
---TickerTimer(0)
---1

Give it 30 repeats and a delay of 0

Then simply used this

Trigger Event
When
- =
--TickerTimer(0)
--30


Problem with this is that the speed at which TickerTimer is incremented depends on the player's PC. A fast PC seems to update quicker than a slow one. But if you keep the numbers low enough you might manage to get it to work. Make sure you test on a variety of high end and low end PCs just to be sure.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Axem

  • 211
FRED doesn't like fractions
Yay, I got it to work another way. I used Physics to trick FRED. An Amazon Advanced Drone at full speed (50m/s) will cover 25m in 0.5s. Using the distance operation and a no warp effect option, the Amazon arrives at the instance I need it, at full speed, and produces the delay needed.

Now syncing to the music will be a breeze!

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
FRED doesn't like fractions
math 4tw
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
FRED doesn't like fractions
indeed :D

Make sure you put the drone somewhere really far away and make it cloaked, so the player doesn't notice.

 

Offline Mongoose

  • Rikki-Tikki-Tavi
  • Global Moderator
  • 212
  • This brain for rent.
    • Minecraft
    • Steam
    • Something
FRED doesn't like fractions
The ingenuity of FREDers never ceases to amaze me :D

  

Offline Nuclear1

  • 211
FRED doesn't like fractions
Quote
Originally posted by Mongoose
The ingenuity of FREDers never ceases to amaze me :D


You gotta give us some credit. Sitting around all that math-related work does something to you... :D
Spoon - I stand in awe by your flawless fredding. Truely, never before have I witnessed such magnificant display of beamz.
Axem -  I don't know what I'll do with my life now. Maybe I'll become a Nun, or take up Macrame. But where ever I go... I will remember you!
Axem - Sorry to post again when I said I was leaving for good, but something was nagging me. I don't want to say it in a way that shames the campaign but I think we can all agree it is actually.. incomplete. It is missing... Voice Acting.
Quanto - I for one would love to lend my beautiful singing voice into this wholesome project.
Nuclear1 - I want a duet.
AndrewofDoom - Make it a trio!

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
FRED doesn't like fractions
Quote
Originally posted by Axem
Yay, I got it to work another way. I used Physics to trick FRED. An Amazon Advanced Drone at full speed (50m/s) will cover 25m in 0.5s. Using the distance operation and a no warp effect option, the Amazon arrives at the instance I need it, at full speed, and produces the delay needed.

Now syncing to the music will be a breeze!


That's going right into the cookbook. Far better than my solution. :D
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
FRED doesn't like fractions
Speaking of things like this, anyone remember that old FRED2 tips and tricks thread on the VBB? There was some very useful stuff in there; does anyone still have a copy of it?

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
FRED doesn't like fractions
Yep. I'll have to see about putting it up if no one else steps forward. I know that sandwich did have it up at one point but the link is dead now.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]