Author Topic: Quick FREDing question  (Read 20396 times)

0 Members and 1 Guest are viewing this topic.

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Good point. I hadn't thought of using send-random-message because I've never had any conditions where that that SEXP would be useful so I tend to forget it exists. :D

In this case once the bug with messages is fixed then it would probably be the best solution :D

*Suspects that my missions are going to see a proliferation of random messages now* :D
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Hippo

  • Darth water-horse
  • 211
  • Grazing.
    • All Hands to War
Actually, to make TP's even better, do this:

Code: [Select]
Event 1
-every-time-argument
--any-of
---Ship 1
---Ship 2
---Ship 3
--is-destroyed-delay
---< argument >
---0
--modify-variable
---convoyships(0)
---+
----convoyships(0)
----1
--do-nothing

Event 2 (chained)
+--and
|--not
|---is-event-true-delay
|----Event 5
|----0
+--is-destroyed-delay
|---Ship 1
|---1
+Send message
 |-#command
 |-Med
 |-Message

Event 3
+every-time
+--and
|--not
|---is-event-true-delay
|----Event 5
|----0
+---is-event-true-delay
|----Event 1
|----1
+---is-destroyed-delay
|-----Ship 2
|-----0
+-Send message
 |-#command
 |-Med
 |-Message

Event 4
+every-time
+--and
+--not
|----is-event-true-delay
|-----Event 1
|-----1
+---is-destroyed-delay
|-----Ship 3
|-----0
+-Send message
 |-#command
 |-Med
 |-Message

ad infinium
But wait! There's more!

Event 5
+when
|--=
|---Variable(0)
|---2
-+send-message
 |-#command
 |-[b]High[/b]
 |-2 freighters down message


So basically, each of the middle 3 events checks to see that the variable event (probably still there so that one can get debreifs done better) is true, and then checks to see that the events respective transport has been destroyed, BUT that the event triggered when 2 are destroyed is NOT true, so that the messages don't overlap, and sends the appropriate single ship message.

EDIT: the high and mediums are there, just so that should it backfire, you won't hear them at the same time...
« Last Edit: April 24, 2005, 07:20:03 am by 681 »
VBB Survivor -- 387 Posts -- July 3 2001 - April 12 2002
VWBB Survivor -- 100 Posts -- July 10 2002 - July 10 2004

AHTW

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Sorry hippo but I can't make head nor tail of that. If you want to really beef up TP's SEXP what I'd do is this.

Event 1
-every-time-argument
--any-of
---Ship 1
---Ship 2
---Ship 3
--is-destroyed-delay
---< argument >
---0
--modify-variable
---convoyships(0)
---+
----convoyships(0)
----1
--modify-variable
--RequestMessage(0)
--1

Event 2
every-time-argument
-m1
-m2
-m3
-m4
-m5
=
-RequestMessage(0)
-1
send-message
-#command
--medium
-< argument >
-invalidate-argument
--< argument >
modify-variable
-RequestMessage(0)
-0

Then you make 5 messages called m1 to m5 each of which goes something like this.

Alpha 1 you must cover those frighters better. We've already lost $convoyships of them

or

Freighter number $convoyships going down.


The above two events will give you a new message every time you lose a ship. No message will ever repeat and they'll appear in a different random order every time you play :D

BTW The best ideas from this post are going up in the FRED Cookbook as soon as this thread dies down. There's some very good stuff in here :D
« Last Edit: April 24, 2005, 08:55:33 am by 340 »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Singh

  • Hasn't Accomplished Anything Special Or Notable
  • 211
  • Degrees of guilt.
Re: Quick FREDing question
Quote
Originally posted by Blitzerland
This should be a fairly simple request, but I've been having trouble FREDing it.

I have six transports. If five survive, command sends a certain message. If three survive, another message. Less than that, another message.

I've been fiddling with this for awhile, and can't get it to work. Percent-ships destroyed doesn't work, neither does percent-ships departed, because it keeps calling multiple sexps.

*five ships survive sexp called*

Sexp called, but because five departed, it also implies that three departed.

*three ships survive sexp called*

Next I tried using this:

And
 
 -Percent-ships-destroyed-or-departed
 -100
 -(ship list)

 -Percent-ships-destroyed
 -50
 -(ship list)
 

Didn't work. Still calls muliple sexps. As soon as the "three ships departed" message plays, the "five ships departed" message follows it.



Would this work?

-when
--and
----=
----percent-departed-delay
----(ship list)
----percentage for three ships
---<
----precent-departed-delay
----(ship list)
----percentage for five ships
-----sendmessage

-when
----=
----percent-departed-delay
----(ship list)
----percentage for five ships
-----send message

-when
---=
----precent-departed-delay
-----(ship list)
------100%
-------send message


?
"Blessed be the FREDder that knows his sexps."
"Cursed be the FREDder that trusts FRED2_Open."
Dreamed of much, accomplished little. :(

 

Offline Singh

  • Hasn't Accomplished Anything Special Or Notable
  • 211
  • Degrees of guilt.
wait, actually that won't work.

Ach - never mind...my mind is playing tricks on me.
"Blessed be the FREDder that knows his sexps."
"Cursed be the FREDder that trusts FRED2_Open."
Dreamed of much, accomplished little. :(

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Actually it looks fine to me at a quick glance :D

It's actually pretty close to what I suggested doing at the bottom of my post.
« Last Edit: April 24, 2005, 09:21:11 am by 340 »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Now that I understand what a string-variable is, (and after reading your FRED Bugs thread Kara), I'd be nice to use the single envent every-time-argument line (once the bugs are fixed) so the message would include both the name of the ship going down, and the numer that have been lost.  Something like:

"The GTFr Nelson is going down!  That's 2 freighters we've lost so far."

Actually, it be better to have 3 variables within this event, 2 numerical and one string.  The string is changed to the content of < argument > when the event fires, and one numerical variable displays the number of ships lost, and the other calculates how many remain.  That way your early messages tell you you've lost 2 out of 6 transports, while later messages tell you you've only got 2 transports left.  If there was a way to perform calculations within a message there'd be no need for the 2nd variable, but that's what we've got.
The Trivial Psychic Strikes Again!

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Yeah. I'd been thinking about calculations in messages too. But for the moment I'd rather see what we have working. :D

I like the idea of having the name in the message too. Main thing that stopped me suggesting something along those lines is the bug we currently have regarding writing an argument to a string variable. The event I posted would actually work now.

Like the idea of having a couple of variables though. I'd probably work it so that each message had a combination of all three rather than all of them being used in every message to make it more realistic.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Cobra

  • 212
  • Snake on a Cain
    • Minecraft
    • Skype
    • Steam
    • Twitter
even though i've learned a little about what variables do, i still don't know how the hell to use 'em or when... that's why it scares me...
To consider the Earth as the only populated world in infinite space is as absurd as to assert that in an entire field of millet, only one grain will grow. - Metrodorus of Chios
I wept. Mysterious forces beyond my ken had reached into my beautiful mission and energized its pilots with inhuman bomb-firing abilities. I could only imagine the GTVA warriors giving a mighty KIAAIIIIIII shout as they worked their triggers, their biceps bulging with sinew after years of Ivan Drago-esque steroid therapy and weight training. - General Battuta

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Perhaps a few more events would be better.  Lets say that there are 6 convoy ships.  The first is the key every-time-argument event that performs changes to the variables.  Another would be keyed to fire when the ShipsDestroyed numeric variable = 1 so that a message is displayed saying that one ship is destroyed and what that ship name is using the string variable.  This singular event is useful because then you can say "ship" (the singular) after the first is destroyed, then additional events chained to the key event that include the plural "ships".  Furthermore, have the second event also keyed only to fire if the shipsdesroyed variable is between 1 (greater than) and 4 (less than) and include a send-message-random with various wordings of "XXX is destroyed!  That's Y ships we've lost so far".  Then another event keyed to fire when shipsdestroyed variable is between (greater than) 3 and (less than) 5, and another send-message-random with various wordings of "XXX is desrtoyed!  We've only got Z ships left", using the ShipsLeft numeric variable.  Then another event that only fires when shipsdestroyed is equal to 5 saying that "XXX is destroyed!  We've only got 1 ship left" so we can use the singular.  Then another event fires when shipsdestroyed = 6 saying that all convoy ships have been destroyed.

While I was typing this, I remembered that occasionally, there is an option to insert additional "when" conditionals within an event.  Perhaps some multiple when conditionals can be inserted within the master event so that we can condense all of the above into a single event.
The Trivial Psychic Strikes Again!

 

Offline Primus

  • Ranger
  • 29
  • Lusus Naturae
@Cobra
The tutorial that comes with FS2 gives a good example. :)
No surrender, no retreat.

 

Offline Nuclear1

  • 211
*cough*Walkthrough, anyone?*cough*
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 Cobra

  • 212
  • Snake on a Cain
    • Minecraft
    • Skype
    • Steam
    • Twitter
*ahem* yes, i've done the walkthrough, i've done about half of that mission, but i always get bored with it, and make something else. it's just that it doesn't give a halfways decent explanation of variables. (and yes, i read the new walkthrough karajorma made)
To consider the Earth as the only populated world in infinite space is as absurd as to assert that in an entire field of millet, only one grain will grow. - Metrodorus of Chios
I wept. Mysterious forces beyond my ken had reached into my beautiful mission and energized its pilots with inhuman bomb-firing abilities. I could only imagine the GTVA warriors giving a mighty KIAAIIIIIII shout as they worked their triggers, their biceps bulging with sinew after years of Ivan Drago-esque steroid therapy and weight training. - General Battuta

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
I assume you're on about Darkage's or TopAce's. I haven't made my own walkthrough (Although maybe I should :D )
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Hippo

  • Darth water-horse
  • 211
  • Grazing.
    • All Hands to War
Now i want to :nervous: :p

Oh, and incase you don't feel like drudging up the walkthrough on your computer, click here.
VBB Survivor -- 387 Posts -- July 3 2001 - April 12 2002
VWBB Survivor -- 100 Posts -- July 10 2002 - July 10 2004

AHTW

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
hmmm. I think I should add that to the FAQ. I've got the files available for download but sometimes you just want to check something quickly.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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