PDA

View Full Version : Signal question


Maceblade
05-19-2013, 09:57 PM
I have an encounter I am doing but i want the mobs to be killed in a specific order and if not then the signals get reset.

for instance: 6 mobs, 1,2,3 send signal 1 2 3 and the mobs depop and chest spawns. Is there a way to add a check for a signal 4 that would come from 4,5,6 and reset the entire event and repop mobs?

joligario
05-20-2013, 01:58 AM
There are multiple ways you can do what it seems like you are asking. It all depends on how you want your event controlled. What is the current setup? i.e. one boss mob already popped with several others or invisible trigger/controller?

Maceblade
05-20-2013, 06:49 PM
6 mobs spawned that all have different ID's and I only want 3 of them to be killed in order to spawn the chest. IE: 999284, 285, and 286 but if 287, 288, 289 are killed it resets the event. My idea was to have the chest spawned after last singal was sent in order.

nenelan
05-20-2013, 08:21 PM
One way that could work is as follows.
You could have the three correct ones pass a 1 as their signalwith to the event handler, have the incorrect ones pass a 4 as their signal to the event handler. Have the mob receiving signals add up the signals.
Once we hit "3", spawn the chest and depop all other mobs. If we end up going over 3 at all, completely reset the event.
That should give you an angle to how to get started, if you need anything else, post what you tried from using these suggestions and we'll help further!

EDIT: DOH! I read that wrong. You said specific order. Above would not work for that. Leaving it up for posterity though as it would work if a certain amount of mobs being killed.

For a specific order, the first mob could pass a "1", the second mob could pass a "2", and the third mob could pass a "3", with "0s" being passed by the incorrect mobs. Again have a counter variable that would start at 0. Test the signal being sent. If it is 0, reset the event. Then, if it does not reset, test the variable against the signal, if it was incremented by 1, we would consider that a correct kill, and store the signal as the variable. If it was incremented by anything but 1, reset the event. If 3 ever gets stored, spawn the chest. For example:
We start with a 0. We kill the wrong mob, a 0 gets passed and we reset the event.
We kill mob with signal 2, the variable test 0 vs 2, and it did NOT increment by 1, so we would reset the event.
We kill mob with signal 1, the variable would be tested 0 vs 1, and it did increment by 1. We replace the variable with the 1.
Next we kill mob 2, the variable would be tested 1 vs 2, and it did increment by 1. We would replace the variable with the 2.
Next we kill mob 3, the variable would be tested 2 vs 3, and it did increment by 1. We would replace the variable with the 3, and since that is what we were looking for for a successful win, we would end the event and pop a chest.
If, for instance, we killed mob 3 after mob 1, the variable would be tested 1 vs 3, and it would reset the event.

Hopefully that helps for the general gist of how it would work and you should be able to work from there. There might be easier ways to do this, but this is the first one that came to mind for me.

Maceblade
05-20-2013, 09:51 PM
I appreciate the input and help Ive already got most of it written im just curious as to what the command is to reset lol..

Like i know
sub EVENT_SIGNAL {
if($signal == 1) {
quest::spawn2("your mom")
is what you enter to recieve the signal but what im actually asking for is there a specific command to reset the signal list so that it doesn't see it has already recieved signal 1?


Or should I make it less complicated and have it do an NPCentity check instead.

nenelan
05-20-2013, 10:26 PM
There's no "resetting" the list. When it gets a signal, that's over and done with. Us storing and manipulating variables is kind of like that list you are talking about.
We'll go back to my tests I was talking about.
So, say we start with a variable $placeholder = 0, we'll set this when the Event Handler mob spawns in EVENT_SPAWN. This will be what we are going to use to test our signals with.
Now, rather than using
if ($signal == 1) {
we will instead use
if (($placeholder + 1) == $signal) {
$placeholder = $signal;
##Anything else we want done
}
And then in the false condition of that test, put whatever you would do to reset the event, as well as resetting $placeholder to 0. Depop mobs, repop mobs, heal mobs, etc.
So, as long as you give your critters the code to pass the signals of 1, 2, 3 on their death, this SHOULD handle it quite easily, and the rest is just mob manipulation.

Hopefully that helps!