Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Galemp on February 21, 2008, 09:22:02 pm

Title: Events with delays of <1 second
Post by: Galemp on February 21, 2008, 09:22:02 pm
Can it be done? If I wanted a rapid-firing sequence of events so each happens a fraction of a second after the previous one, how would I go about it? It seems that most of the SEXPs are based on INTs and not FLOATs. There are some hackish ways of doing it but none of them are reliable.

There are a couple other bugs with this mission (like the Vaporization not working and the Mjolnirs not being stealthy) but I think you can see pretty clearly what I'm trying to do.

This runs on FS2 SCP, with no mods.

[attachment deleted by ninja]
Title: Re: Events with delays of <1 second
Post by: Polpolion on February 21, 2008, 09:32:05 pm
IIRC there was a way where you had a stealth ship moving at say 100m/s a ways away from the action area. Every 10 meters it traveled, 0.1 seconds went by, and that's how it would be measured.

like this:

When ( "Ship-has-traveled-meters (or correlating SEXP)", 10)
{
     event
     }
When ( "Ship-has-traveld-meters", 15)
{
     event 2
     }
When ( "Ship-has-traveld-meters", 21)
{
     event 3
     }

Actually, I think I screwed up the general method, but I don't really know how to re-phrase it without mucking around in FRED for a half an hour, so I hope you get the type of thing I'm saying.

EDIT: And this seems like it would be one of those hack-ish methods. Sorry I couldn't help.  :/

EDIT2: I hate you. Now I'm mucking around in FRED.
Title: Re: Events with delays of <1 second
Post by: Dark Hunter on February 21, 2008, 09:45:02 pm
I believe Axem solved this particular problem:

It's in Karajorma's FRED Cookbook (http://homepage.ntlworld.com/karajorma/FAQ/fredcookbook.html) on his FAQ. Scroll down to the bottom of the link.
Title: Re: Events with delays of <1 second
Post by: Galemp on February 22, 2008, 05:01:24 pm
"You're listening to member-supported Galactic Public Radio. Hello, you're on FRED Talk..."

Heh. No, but seriously, for the sake of this mission I fixed my problem by making new beam weapon entrys and altering the warmup time on each one. They now fire in sequence.

So, how about the other bugs? How do I get the Demon to blow up instantly without the death roll sequence?
Title: Re: Events with delays of <1 second
Post by: Axem on February 22, 2008, 05:41:52 pm
Try greatly lowering the special explosion damage to the Demon. I believe that is one of the factors to the death roll time.

If you look at the Meson Bomb's explosion damage, its 50,000(!) (by comparison the Sath is only 800), and if you've ever tried to blow one up in a custom mission, you know they take a LONG time.

Another hacky way to do it would be setting the Kamikaze flag for the Demon and have something tiny ram into it.
Title: Re: Events with delays of <1 second
Post by: FUBAR-BDHR on February 22, 2008, 06:20:21 pm
I think Kamikaze flag and self-destruct was a workaround for that too. 
Title: Re: Events with delays of <1 second
Post by: Galemp on February 22, 2008, 09:09:49 pm
Uh-huh, that sounds possible. Can you set 'kamikaze' and 'un-kamikaze' in case the ship gets destroyed by other means?
Title: Re: Events with delays of <1 second
Post by: FUBAR-BDHR on February 22, 2008, 09:57:03 pm
Actually you can un-kamikaze.  If there isn't a sexp for it just do another kamikaze with a damage of 0.   Found that "feature" the other day.