Hard Light Productions Forums

Hosted Projects - Standalone => The Babylon Project => Topic started by: 0rph3u5 on December 22, 2005, 07:57:14 am

Title: some difficult FREDing
Post by: 0rph3u5 on December 22, 2005, 07:57:14 am
As you know I'm doing a PSI Corps campaign.. for realism I want to do some stealth missions when you have to prevent being detected by the enemy and gather top secret infos...
unlike in "Raider Wars" or "Tale of EAS Janus - Earth Minbari War" I don't want the player to fly another ship (this would not be nessicary since the PSI Furies are black with white markings is hard to see them against a pich black sky and they have special equidment of course)
so I'm playing with the tought to do a special stealth system for this...

this is not needed for the TBH: FSitA release which will be released at firday if things are going on as planed but I would be nice to have it done before the next year comes (I wanted to start out with the new part of TBH in January)

the system is related to the player's ship "shield-recharge-pct" (to be found in the category "status" - the "Shield" as remaining part of original FS2 has no noticalbe effect on the gameplay of TBP anymore) and consits of 2 variables: Stealth-Level(0) & Stealth-Range(30000) [number in bracets some standart value of the variable]
Stealth-Level(0) shall discribe if your stealth is on (0 - off; 1-3 on) and shall regulate Stealth-Range(30000)
Stealth-Range(30000) shall discribe the minimal distance (see table coming at the bottom of the post) which enemy fighters need to detect you (there are other factors that may be responsible for your detection in the mission too but they will have their own sexpts which are easier to do)

1st sexpt looks like this:
"Stealth level 1"
every-time
- >
-- shield-recharege-pct
--- Gamma 1
-- 50
- modify-varibale
-- Stealth-Level(0)
-- 1

2nd sexpt should look like this:
"set sr at sl 1"
every-time
- =
-- Stealth-Level(0)
-- 1
- modify-varibale
-- Stealth-Range(30000)
-- 6000

3rd sexpt should look like this:
"detect"
every time
- <
-- distance
--- <any hostile>
--- Gamma 1
-- Stealth-Range(x) [x descirbes to current value of the variable]
- unportect-ship
-- Gamma 1
- add-goal (y-times) [for every fighter wing and other craft able to chase fighters]
-- <hostile craft/wing> [fill in any name]
-- ai-chase
--- Gamma 1
--- 89

as you may have guessed by now the 2nd and 3rd sexpt are the difficult ones
I'm simply not able to get the variable as values into the "<" and "=" conditinoals...
my FREDBuilt is 3.6.5... old though but it serves my needs related to freding

Stealth-Level(a) - Stealth-Range(b)
0 - 30000
1 - 6000
2 - 4000
3 - 2000
Title: Re: some difficult FREDing
Post by: karajorma on December 22, 2005, 01:57:06 pm
I've noticed something. In the last month I've noticed a sudden upsurge in the quality and quantity of the FREDding for TBP. Both yourself and Megadoomer have impressed me by using variables for some pretty interesting FREDding. I've got no idea where you're both learning to use variables (and in megadoomer's case the new argument conditionals) but seeing as how I know many FREDders who have been in the community for years and are scared of them I'm very happy to see it. Keep it up :yes:

Anyway getting back to the topic. I'm a little confused by your problem. Are you telling me that when you have

When
- =
-- 0
-- 0
-do-nothing

you are actually unable to change that into

When
- =
-- variable-name{0}
-- 0
-do-nothing

Cause doing so is as simple as right clicking on the top 0 choosing replace variable and selecting the variable off of the list.

If you're doing that and it's grayed out or something you're probably dealing with a bug and should upgrade your version of FRED. Actually you should do that anyway. 3.6.5 is 3 days less than a year old and there are many features that are missing from it that an inventive FREDder like yourself would find very useful. For instance this event

every time
- <
-- distance
--- <any hostile>
--- Gamma 1
-- Stealth-Range(x) [x descirbes to current value of the variable]
- unportect-ship
-- Gamma 1
- add-goal (y-times) [for every fighter wing and other craft able to chase fighters]
-- <hostile craft/wing> [fill in any name]
-- ai-chase
--- Gamma 1
--- 89

Would become

every time argument
every-of
Enemy Wing 1
Enemy Wing 2
Enemy Wing 3 {etc}
- <
-- distance
--- <any hostile>
--- Gamma 1
-- Stealth-Range(x) [x descirbes to current value of the variable]
- unportect-ship
-- Gamma 1
- add-goal
-- < argument >
-- ai-chase
--- Gamma 1
--- 89

You now have only one copy of the add goal SEXP instead of having to do tedious cutting and pasting for all the enemy wings. If you decide to change the behaviour you'd only have to change it in one place.

One further word of warning. I haven't tested this so I don't know if it will happen but if you start getting odd behaviour from the enemy wings it's because they're being given new orders 70 times a second cause of your use of every-time and a trigger that will come true that often. If that turns up post here (cause I'm interested in knowing now that I've thought of it) and if you can't solve the problem I'll tell you what I'd do :)
Title: Re: some difficult FREDing
Post by: Megadoomer on December 22, 2005, 03:55:45 pm
When it comes to fredding I just decide what I want to do and then work out how to do it. I won't know if somethings not possible till I try. Your faq has also been useful, especially when I started.

I haven't had problems with variable names, though I have to manually enter <argument> in a few cases.
Title: Re: some difficult FREDing
Post by: karajorma on December 22, 2005, 05:11:45 pm
I've always found a "nothing's impossible till I've tried to do it" approach works well for me too. A lot of people make assumptions about what FRED can actually do without actually trying it and you'll often find that the new stuff in FSO makes things possible that were completely impossible last year.

People who are newer to FRED don't make those assumptions because they've never used retail FRED for any length of time :)
Title: Re: some difficult FREDing
Post by: Megadoomer on December 22, 2005, 05:54:04 pm
The fact I've been doing computer programming for the last 5 years, did a degree partly on it and have been doing it for a job for the last 4 months probably helps too  :nod:
Title: Re: some difficult FREDing
Post by: 0rph3u5 on December 23, 2005, 04:24:53 am
right clicking and replacing does not work...
I'll get me a new FREDbuild than... I did not want to upgrade it since I wanted the mission to run without the player having to upgrade his files

I'm doing a tutorial (I think it is needed) for that right now so if bugs with the sexps appear I can still isolate and fix them before this is going to have effects on story missions
Title: Re: some difficult FREDing
Post by: karajorma on December 23, 2005, 04:34:31 am
I can understand that but I'd be willing to bet that TBP 3.3 will ship with 3.6.7 or higher anyway so your target audience will probably have upgraded anyway unless you are going to release very soon.

If you really don't want to upgrade you may be able to get away with typing in @variableName{default value} manually then saving and reloading. I've done that a few times to get around a FRED bug with string variables and I suspect it would work with numeric variables too. Since you're saving over a working version I recommend backing up before you try it of course :)
Title: Re: some difficult FREDing
Post by: 0rph3u5 on December 31, 2005, 09:14:24 am
It's finished  ;) ;) ;)
only some test runs are needed now and than it's ready for action!

insterted the variables like this: @variablename[standartvalue]
Fred gave me an Errorreport 'cause it's "No number" but it was fine after saving and reloading
Title: Re: some difficult FREDing
Post by: karajorma on December 31, 2005, 10:41:20 am
Yeah. I should have warned you that it would give you an error on saving :) When it tries to load the mission though it will find exactly the syntax it's expecting and it should work fine :)