Author Topic: FRED problem  (Read 1524 times)

0 Members and 1 Guest are viewing this topic.

Offline IPAndrews

  • Disgruntled Customer
  • 212
  • This site stole my work
I have a shuttle and 2 freighters. I want the shuttle to do the following:

1. dock freighter 1
2. undock freighter 1
3. dock freighter 2
4  undock freighter 2.

I want it to repeat this a very large number of times (for the sake of argument lets say 1,000,000). How can I achieve this in FRED without writing 1,000,000 * 4 events?

Be warned, I do not think this is a trivial problem. I have been looking at it for a number of days and cannot find a solution.
Be warned: This site's admins stole 100s of hours of my work. They will do it to you.

 

Offline diamondgeezer

Er... repeats not going to work?

 

Offline KARMA

  • Darth Hutt
  • 211
    • http://members.fortunecity.com/aranbanjo
i'm not a fredder but i think that if there isn't a solution, it is something that should be reported to scp since it sound important... maybe allowing something like -dock freighter group- to have docking with all the ships in a wing

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Um. Is there something you`re not telling us? I got this one to work using two events in 5 mins.

Take the two ships and time how long it takes to do the run between them (in both directions cause it might take longer in one direction)

I set up to Argos with a 40 second run.

Event 1 : Repeats  Interval Time 120

when
-true
-add-goal (ai-dock Argo 1 etc)

Event 2 : Repeats Interval Time 120

when
-has-time-elapsed
--60
--add-goal (ai-dock Argo 2 etc)

Since the interval time is half the time before event 2 goes of the two are exactly out of phase. One event is always in it's interval time while the other is being executed.

EDIT : Don`t try using had-docked-delay or you`ll be there all night :D Since you can't pass a variable to it as an arguement there is no way to increase the number of times the ship has docked so the event becomes immediately true every time it's interval time is up regardless of if the ship is docked or not. :)
« Last Edit: April 07, 2003, 01:18:18 pm by 340 »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Quote
Originally posted by karajorma
Since you can't pass a variable to it...


You can using the SCP. ;)

I don't know how much it would help, though.  That two-event system is what I was thinking of as well.  Seems the simplest and most efficient way to solve the problem.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Quote
Originally posted by Goober5000


You can using the SCP. ;)


Really? I`ll give that a go. Using has-docked would be better because it eliminates the possibility of error due to a ship being knocked off course. I didn`t test to see what would happen if something delays the ship so that it doesn`t make it to the docking point.
 Most likely it would just turn around and head back the way it came when the other event kicks in.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

  

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Yeah, I went through and replaced all the straight test-the-argument checks with evaluate-the-argument checks.  The previous way prevented any sexps from being used as values.

Not sure what version it's in, though.  Try the 3.5.1 unofficial update.

 

Offline Petrarch of the VBB

  • Koala-monkey
  • 211
And what update is this? Does it have your new ultra-SEXPs?

 

Offline IPAndrews

  • Disgruntled Customer
  • 212
  • This site stole my work
Well I was trying to do it the has-docked-delay way. The time dependant method will work for one mission where this activity is happening in the background and is unimportant. What I've been told about has-docked-delay not using variables does scupper another nice mission I was doing though where shuttles on opposing sides are flying around capturing and recapturing freighters.
Be warned: This site's admins stole 100s of hours of my work. They will do it to you.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Quote
Originally posted by IPAndrews
Well I was trying to do it the has-docked-delay way. The time dependant method will work for one mission where this activity is happening in the background and is unimportant. What I've been told about has-docked-delay not using variables does scupper another nice mission I was doing though where shuttles on opposing sides are flying around capturing and recapturing freighters.


I assume this is for TBP. Just write the mission and when TBP gets it's own source code version you can bring it in :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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