![]() |
|
|
|
#1
|
|||
|
|||
|
you only need one instance of the "public overide void on trigger" with all four triggers contained within it.
am doing this from a phone so can't paste an example for you. should have computer/ internet access tomorrow if you haven't figured it out by then. |
|
#2
|
|||
|
|||
|
Quote:
I'll need an example - I have a HUGE blind spot when it comes to coding. Thanks Hood |
|
#3
|
|||
|
|||
|
ok, new modem and I have internet
you need to have something like this example with 4 triggers in Code:
using System;
using maddox.game;
using maddox.game.world;
using System.Collections.Generic;
public class Mission : AMission
{
public override void OnTrigger(int missionNumber, string shortName, bool active)
{
base.OnTrigger(missionNumber, shortName, active);
if ("41".Equals(shortName) && active)
{
AiAction action = GamePlay.gpGetAction("41");
if (action != null)
{
action.Do();
}
GamePlay.gpHUDLogCenter("41");
GamePlay.gpGetTrigger(shortName).Enable = false;
}
if ("46".Equals(shortName) && active)
{
AiAction action = GamePlay.gpGetAction("46");
if (action != null)
{
action.Do();
}
GamePlay.gpHUDLogCenter("46");
GamePlay.gpGetTrigger(shortName).Enable = false;
}
if ("605".Equals(shortName) && active)
{
AiAction action = GamePlay.gpGetAction("605");
if (action != null)
{
action.Do();
}
GamePlay.gpHUDLogCenter("605");
GamePlay.gpGetTrigger(shortName).Enable = false;
}
if (GamePlay.gpGetTrigger("mis").Active) {
end = true;
//GamePlay.gpHUDLogCenter("!");
}
}
}
I don't think I've made any errors but I haven't tested this, just cut out a trigger section from one of my campaigns and plugged it into the structure you gave (Amission etc)good luck |
|
#4
|
|||
|
|||
|
Thanks. I think I need one extra section but will copy and paste.
Thanks again Hood |
|
#5
|
|||
|
|||
|
there are actually 4 triggers- just the last one
Code:
if (GamePlay.gpGetTrigger("mis").Active) {
end = true;
//GamePlay.gpHUDLogCenter("!");
}
You using notepad++/visual studio? - these will help with 'bracket pairing' and finding line numbers for any errors generated |
|
#6
|
|||
|
|||
|
Um just notepad or word pad.
I think I can work out the brackets. Too busy toasting marshmallows right now though. Will try it tomorrow and will report back. Hood |
![]() |
|
|