Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => FRED Academy => Topic started by: Fishfood1 on August 16, 2008, 12:56:23 pm

Title: distance question
Post by: Fishfood1 on August 16, 2008, 12:56:23 pm
when using retail FS2's FRED2, what do i need to do to use the "distance" SEXPs? i mean when i create a new event, the distance SEXPs seems to be always grayed out/unable to be used, even if i have ships in the map/mission already placed. so can anyone help me? thanks
Title: Re: distance question
Post by: Shade on August 16, 2008, 01:32:34 pm
The "distance" operator returns a number, so you can only use it in a place where a number is legal. For example:

op when
   op <
      op distance
         # Alpha 1
         # Jump node
      # 500
   op fix-warp
      #Alpha 1

As you can see, the "distance" operator in this case is used as one of the arguments for a "less-than" logical operator, which happens to require two numbers and thus will allow the use of "distance". It can't be used on its own, but must always be used as an argument in a logical or action operator that accepts a number.
Title: Re: distance question
Post by: Fishfood1 on August 16, 2008, 01:43:39 pm
okay thank you very much!