July 03, 2009, 11:35:21 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Someone on the administration decided it would be fun to reset everybody's Theme Settings as part of a debugging spree, without telling anybody.  (No, it wasn't Goober.)  If you've changed any of your settings (e.g. enabling quick replies, topic notifications, PMs saving to your outbox, PMs most-recent-first) then make sure you go to your Profile and fix your preferences on each of the Modify Profile pages.
   Home   Help Calendar Members Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: FRED doesn't like fractions  (Read 7754 times)
0 Members and 1 Guest are viewing this topic.
Axem
Just Another FREDder
Moderator
210

Offline Offline

Posts: 1,083

or Frakker...


View Profile WWW
« on: September 13, 2005, 09:58:37 PM »

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?
Logged

[21:50] <redsniper> but yeah, child abuse is only entertaining to a point
Just look at the crazy antics you miss out on at #hard-light on irc.esper.net!
--
AxemSpace! | Just Another Day! | Shadows of Lylat! | Diaspora!
Nuclear1
Scorched
211

Offline Offline

Posts: 2,294


View Profile
« Reply #1 on: September 13, 2005, 10:04:48 PM »

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.
Logged

Quote
Captain Zelnick - Don't do it, old warrior!  You still have so much to live for!

Tanaka - Like what?  My race is dead.  My world is an airless rock.  And I've seen all of my FunRoms at least a hundred times.  My life is over.  I have already picked out a nice asteroid to smash into, so, if you don't mind, I'll just go and kill myself.  Unless, you want to annihilate me yourself?
<Erik> i liked inferno because it had big ships
<Erik> 8D
<Erik> i was like WOOHOO BIG SHIPS
<Erik> ...and then i realised they were stupid
karajorma
Robin Hood
Administrator
214

Offline Offline

Posts: 22,204



View Profile WWW
« Reply #2 on: September 14, 2005, 05:45:15 AM »

SEXPs are built to work on intergers. I don't think there's much of a way round this.
Logged

Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

Only developers should be getting HEAD.
Trivial Psychic
211

Offline Offline

Posts: 3,536

Snoop Junkie


View Profile
« Reply #3 on: September 14, 2005, 09:08:45 AM »

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?
Logged

The Trivial Psychic Strikes Again!
karajorma
Robin Hood
Administrator
214

Offline Offline

Posts: 22,204



View Profile WWW
« Reply #4 on: September 14, 2005, 10:15:31 AM »

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.
Logged

Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

Only developers should be getting HEAD.
ShadowWolf_IH
A Real POF Guy
210

Offline Offline

Posts: 1,476


View Profile WWW
« Reply #5 on: September 14, 2005, 10:31:31 AM »

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.
Logged

Extraordinary people do extraordinary things, normal people stay home and do nothing.

Combat Federation        Control....is just an illusion

Casualties of War 2 -- Waterlord
Kie99
210

Offline Offline

Posts: 1,934


View Profile
« Reply #6 on: September 14, 2005, 01:23:39 PM »

Couldn't there be some extra sexps, for example, has-time-elapsed and has-time-elapsed-ms?
Logged

"You shot me in the Bollocks Tim"
"Like I said, No hard feelings"
Goober5000
91st Shadows, GTI
Administrator
213

Offline Offline

Posts: 13,841



View Profile WWW
« Reply #7 on: September 14, 2005, 04:38:53 PM »

The entire sexp system is based around integers.  Period.  You can't use decimal numbers without rewriting part or all of the sexp system.
Logged

Fortunes of War | Ross 128 | Deus Ex Machina | Terran-Vasudan War Project | FreeSpace Port | Silent Threat: Reborn | Scroll of Atankharzim

Report SCP bugs with Mantis

"How I wish you could put things like that on your CV though.  'Accidentally fooled Computer Press into thinking Freespace 3 was going to be on the XBox.'  That's very nearly a 'Goob wins the Internet' moment, at the very least a high end-of-level boss." -- Flipside

"I view Python for game usage about the same as going fishing with a stick of dynamite.  It will do the job but it's big, noisy, you'll probably get soaking wet and you've still got to get the damn fish out of the water." -- Taylor
Sesquipedalian
Atankharz'ythi
210

Offline Offline

Posts: 1,870


View Profile
« Reply #8 on: September 14, 2005, 04:54:03 PM »

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.
Logged

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.
Axem
Just Another FREDder
Moderator
210

Offline Offline

Posts: 1,083

or Frakker...


View Profile WWW
« Reply #9 on: September 14, 2005, 08:00:27 PM »

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 » Logged

[21:50] <redsniper> but yeah, child abuse is only entertaining to a point
Just look at the crazy antics you miss out on at #hard-light on irc.esper.net!
--
AxemSpace! | Just Another Day! | Shadows of Lylat! | Diaspora!
karajorma
Robin Hood
Administrator
214

Offline Offline

Posts: 22,204



View Profile WWW
« Reply #10 on: September 15, 2005, 02:35:11 AM »

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.
Logged

Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

Only developers should be getting HEAD.
Axem
Just Another FREDder
Moderator
210

Offline Offline

Posts: 1,083

or Frakker...


View Profile WWW
« Reply #11 on: September 16, 2005, 09:54:49 PM »

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!
Logged

[21:50] <redsniper> but yeah, child abuse is only entertaining to a point
Just look at the crazy antics you miss out on at #hard-light on irc.esper.net!
--
AxemSpace! | Just Another Day! | Shadows of Lylat! | Diaspora!
phreak
Gun Phreak
211

Offline Offline

Posts: 3,918

-1


View Profile
« Reply #12 on: September 16, 2005, 09:59:33 PM »

math 4tw
Logged

CP5670
Dr. Evil
Global Moderator
212

Offline Offline

Posts: 4,559

142857


View Profile
« Reply #13 on: September 17, 2005, 12:10:06 AM »

indeed Big grin

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

Mongoose
Rikki-Tikki-Tavi
211

Online Online

Posts: 2,287


View Profile WWW
« Reply #14 on: September 17, 2005, 08:01:45 PM »

The ingenuity of FREDers never ceases to amaze me Big grin
Logged

Prepare for Descent...
Nuclear1
Scorched
211

Offline Offline

Posts: 2,294


View Profile
« Reply #15 on: September 17, 2005, 09:47:59 PM »

Quote
Originally posted by Mongoose
The ingenuity of FREDers never ceases to amaze me Big grin


You gotta give us some credit. Sitting around all that math-related work does something to you... Big grin
Logged

Quote
Captain Zelnick - Don't do it, old warrior!  You still have so much to live for!

Tanaka - Like what?  My race is dead.  My world is an airless rock.  And I've seen all of my FunRoms at least a hundred times.  My life is over.  I have already picked out a nice asteroid to smash into, so, if you don't mind, I'll just go and kill myself.  Unless, you want to annihilate me yourself?
<Erik> i liked inferno because it had big ships
<Erik> 8D
<Erik> i was like WOOHOO BIG SHIPS
<Erik> ...and then i realised they were stupid
karajorma
Robin Hood
Administrator
214

Offline Offline

Posts: 22,204



View Profile WWW
« Reply #16 on: September 18, 2005, 02:51:31 AM »

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. Big grin
Logged

Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

Only developers should be getting HEAD.
CP5670
Dr. Evil
Global Moderator
212

Offline Offline

Posts: 4,559

142857


View Profile
« Reply #17 on: September 18, 2005, 03:08:29 AM »

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?
Logged

karajorma
Robin Hood
Administrator
214

Offline Offline

Posts: 22,204



View Profile WWW
« Reply #18 on: September 18, 2005, 03:54:10 AM »

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.
Logged

Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

Only developers should be getting HEAD.
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!