Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Razial on July 25, 2009, 06:32:35 pm
-
I have a tricky question. I am having a part of the mission that has constant chatter for a couple of minutes in one set-message-list. I also want to have a sexp that says if a pilot flies to far from convoy he gets a warning msg, but can I set this so that it interrupts the main chatter and doesn't just overlap it? Also that the chatter continues as soon as any event started sexp is done?
-
Couple of things you can try. First set the chatter priority to low and the warning to high. Second instead of send-message-list used chained events each checking to make sure the conditions for the warning aren't met. Third use a training message instead of normal messages for the warning.
-
Hmmm, can a training msg be sent to look like someone sent it, not just 'your computer'? Also how can i design a sexp to give random fluctuations of electromagnetic interference at random intervals and only briefly each time, but for the duration of the mission?
-
No on the training message.
Do you mean like an EMP burst? If so make two variable (rand[0] and delay[0]. Have one event
everytime
-true
--modify-variable
---rand[0]
----rand-multiple
------(min)
------(max)
Second event
when
--and
--- >
------mission-time
------start of EMP effects
--- >
------mission-time
------delay[0]
--modify-varible
----delay[0]
---- +
------mission-time
------rand[0]
--emp-effect (whatever the sexp is called)
make this one repeat every second count 99999999
-
k thx dude i will try that (looks puzzled already :P) I havn't really got the hang of variables yet. It is still a bit confusing for me! :)
-
Before someone else asks. The first event isn't entirely necessary but I've found it does make the rand-multi function actually act random.
-
Dude even copying i cant figure out how to setup that sexp. I cant find the modify variable op. Am i trying to add one in the wrong place?
[attachment deleted by Tolwyn]
-
For reference, here's a list with all sexps currently present in 3.6.10 Final. This'll tell you exactly where to find all the sexps.
[attachment deleted by Tolwyn]
-
You need to replace the do-nothing. It's under change.
-
Ok dude thanks that sort of works, only thing is im not sure what to set the actually function as. I tried an invisible explosion with a shockwave and emp intensity of 100 for 2 seconds but that didn't work i just tried scramble msgs but that just does it constantly! I'm not sure what other options i have.
[attachment deleted by Tolwyn]
-
OK how long do you want the messages to be scrambled for? I wasn't even thinking about the scramble message. This makes it a little more colplicated
One thing you want to do is create one more event. Copy the modify variable delay[0] to it then replace the rand[0] in the existing one to 999999.
So what you are going to end up with is something like this
Second event
when
--and
--- >
------mission-time
------start of EMP effects
--- >
------mission-time
------delay[0]
--modify-varible
----delay[0]
---- 999999
------mission-time
------rand[0]
--modify-varible
----delay2[999999]
---- +
------mission-time
------rand[0] (or a set value or a second random value)
--scramble messages
Third event
when
--and
--- =
------ delay[0]
------ 999999
--- >
------mission-time
------delay2[999999]
--modify-varible
----delay2[999999]
---- 999999
--modify-varible
----delay[0]
---- +
------mission-time
------rand[0]
--unscramble messages
-
Ah thx dude that looks good. Just one question, where is start emp events? I cant find anything to do with emp, apart from one of the modifiers in explosion-effect. The only reason i was considering scramble msg is because i couldn't find any sexp that created the sort of emp effect you get when in an emp nebula.
-
That's just whatever you want to trigger the effect to start. You could add on for when you want it to end as well.
-
I have tried and tried different things to make a random emp effect and to no avail. I would really appreciate it if someone could at least give me a basic EMP pulse setup during a mission (not even a random one with variables)I can manage the triggers, but I cannot for the life of me replicate the effect that you get whilst inside a nebula with an EMP storm where your HUD flickers randomely with an EMP sound *frustrated*
-
I didn't try this but it's logical
explosion-effect
--get-object-x
----Alpha 1
--get-object-y
----Alpha 1
--get-object-z
----Alpha 1
1
10
0
20
50
0
0
0
50 (experiment here)
20 (how ever long you want)
This should cause an emp explosion at the players location that does 1 point of damage. You could put a ship invulnerable right before and a vulnerable right after to counter this.
-
Thanks FUBAR that worked fine :D Unfortunately it didn't work with the random variable modifier template above. I am not sure what the conditions are for how variables work but all the templates i have seen so far seem to make sense, but I cant use them in context (this one for example)
I would like an emp wave to happen, at random, continuously throughout the mission but at 5-15 second intervals. To do this with variables is a little past my understanding atm :) Time will sort that im sure. Any help and advice recieved is greatly appreciated :)
-
everytime
-true
--modify-variable
---rand[0]
----rand-multiple
------10 (5 + emp duration from next event)
------20 (15 + emp duration from next event)
when
-- >
----mission time
----delay[15] (first one will happen 15 seconds in. Adjust initial value to whatever you want)
--explosion-effect
----get-object-x
------Alpha 1
----get-object-y
------Alpha 1
----get-object-z
------Alpha 1
----1
----10
----0
----20
----50
----0
----0
----0
----50 (experiment here)
----5 (how ever long you want)
--modiy-variable
----delay[15]
------ +
--------mission-time
--------rand[0]
repeating every second 99999999 times
That should do it.
-
Dude you're a life saver lol! That works perfectly xD I just need to try and learn it so I dont need to ask so many questions :) Those sexps work perfectly but would you mind briefly explaining the different parts of the sexps containing variables, and what they affect. That will be my final request on this matter!! :p
-
Before someone else asks. The first event isn't entirely necessary but I've found it does make the rand-multi function actually act random.
Eh?
Sounds like a bug in rand-multiple then.
Bear in mind that I improved the way the random SEXPs work about 6 months ago as there was a problem with them which caused them to be less random than they should have been.
-
well modify-variable assigns a value to a variable. Anywhere else reads that value and uses it. So the first event is replacing rand[0] with a value determined by rand-multiple. It's continously generating random values. Not entirely necessary but it seems to work better then just using rand-multiple where you normally would. In the second one it checks for the mission time being greater then delay[15]. When it is it processes the event then adds whatever the value of rand[0] is at the time to the mission time and stores it to delay[15] so the event won't process the effect again until that delay is up.
-
Before someone else asks. The first event isn't entirely necessary but I've found it does make the rand-multi function actually act random.
Eh?
Sounds like a bug in rand-multiple then.
Bear in mind that I improved the way the random SEXPs work about 6 months ago as there was a problem with them which caused them to be less random than they should have been.
Maybe it does work now. I just got so used to doing it that way I've never tried it. I do remember when you modified it for that bug I found with big values.
-
None of that should be the slightest bit different from simply using rand-multiple directly though.
In fact I wouldn't be at all surprised if someone pointed at maths that proved that storing 1000 random numbers and picking one at random is actually less random than the method used for generating random numbers. :p
-
In the second one it checks for the mission time being greater then delay[15]
Dude I almost completely understand now, the only thing is the 'adding to mission time'. I dont understand what 'mission time' has to do with any of the repeats after the intial trigger (5 seconds after mission start, triggers first of the emp blasts). Wont adding anything to mission time just add a random variable between 5-15 to the mission time, which could be anything from 5 seconds to 2 minutes, added to 5-15 seconds?
-
mission-time is a sexp that returns the current mission time in seconds. So you add 5-15 to that value and store it to delay each time. It doesn't adjust the mission time or anything.
@Kara. I know it doesn't make sense but it always seemed like rand-multi when used in certain instances has an uncanny knack of returning the same sets of values. Having it process repeatedly and probably more importantly in a separate event seems to get around that. But like i said I don't think I've tried it any other way in ages so who knows it might work fine now.