Originally posted by Akalabeth Angel
Okay, for a mission I'm making (for FA academy). What I'm doing is I'm giving a ship several possible waypoint paths depending on the situation. So for each possibility, I have an event. But in order to ensure that other events aren't introduced after the first correct one I'm trying to use a variable.
I always get a special thrill when I see people using variables

Glad to see you're being brave and trying them out. They aren't really that hard but a lot of people are scared of them.
Originally posted by Akalabeth Angel
Basically, one of the conditions of the events going off is that a numeric variable has value < 1. Then when an event works, the value is supposed to be increased by 1 (from 0 to 1), therefore, invalidating the other events.
Sounds like a fair plan although I'm a little confused as to why you're using a variable for this rather than simply checking if the event is true or not.
Originally posted by Akalabeth Angel
I was just wondering if my code was cool:
conditional:
--op <
--courseconfirm(0)
--0
**Meaning: If variable's value is less than one, return true
As Sesquipedalian said you can use the equals operator in this case. The equals operator works perfectly well with variables because you can control what state the variable is in. The rest of the time you should always use the greater than and less than ops because it's possible for a value to skip the value your testing for (For instance testing that damage to a ship =50% is a bad idea because some weapons can instantly take the damage from 51% to 49% without passing 50).
There is nothing wrong with using the less than operator in this example though but if you wanted to do so your code would still be wrong as you're testing if the variable is less than 0 at the moment (maybe that was a typo though)
Originally posted by Akalabeth Angel
modifier to variable:
--op modify-variable
|--courseconfirm(0)
---op +
--- 1
--- 0
**Meaning: Take variable, and add a value of 1 to it. Making it "1" and invalidating the conditional (above).
What you've done here would actually work in this mission. It's just a little pointless.
What the event you've got here does is take the value 1. Add 0 to it (obviously pointless) and then assign that value to the variable (ignoring whatever the variables value was). In this case your event would work as the variable has a default value of 0 but if your variable started as 1 it's vaule would still be 1 at the end of it. Your event isn't actually refering to the value of the variable at any point. It's just assigning a value to it.
What Sesquipedalian has told you to do is to simply change the SEXP to
-modify-variable
--variablename (0)
--1
In this simple example this works perfectly and is all you need to do. But since the Academy is all about teaching FRED I may as well show you the code for adding one to a variable. You were actually on the right track.
--modify-variable
---courseconfirm(0)
----+
-----courseconfirm(0)
-----1
Notice the difference now? This time the value held in the courseconfirm variable is referenced. 1 is added to it and then the new value is assigned to the courseconfirm variable.
Originally posted by Akalabeth Angel
I don't quite follow here, I tried to "replace data" when fixed on the op + bit and it when I entered 1 it just moved me down a line. What do I press to get to where you're talking about.
Yeah. That's exactly what happened to me when I tried it just now so I don't think you did anything wrong. Just FRED being a little buggy. Just change the whole modify-variable SEXP into something else (do-nothing is an obvious choice) and then start again.