![]() |
|
|
|
#1
|
|||
|
|||
|
You must add an 'action part' to the OnTrigger in the script, at the moment there is none. (pure radar script)
Code:
AiAction action = GamePlay.gpGetAction(shortName);
if (action != null)
action.Do();
Last edited by FG28_Kodiak; 05-02-2012 at 02:31 AM. |
|
#2
|
|||
|
|||
|
ahh I used this:
http://forum.1cpublishing.eu/showthread.php?t=28454 by you It didnt mention .cs file. So when I put in the new .cs I deleted it? |
|
#3
|
|||
|
|||
|
Only if OnTrigger is overriden if not you dont need to add the action part, in the script i use OnTrigger to detect the destruction of a radar via trigger.
Code:
public override void OnTrigger(int missionNumber, string shortName, bool active)
{
base.OnTrigger(missionNumber, shortName, active);
if (shortName.StartsWith("Radar") && shortName.EndsWith("Destroyed"))
{
GamePlay.gpLogServer(null, "Radar destroyed", null); //testing only
Headquarters.ForEach(item =>
{
item.SetObserverInactive(shortName);
});
}
}
Code:
AiAction action = GamePlay.gpGetAction(shortName);
if (action != null)
action.Do();
So the Ontrigger should look like: Code:
public override void OnTrigger(int missionNumber, string shortName, bool active)
{
base.OnTrigger(missionNumber, shortName, active);
if (shortName.StartsWith("Radar") && shortName.EndsWith("Destroyed"))
{
GamePlay.gpLogServer(null, "Radar destroyed", null); //testing only
Headquarters.ForEach(item =>
{
item.SetObserverInactive(shortName);
});
}
AiAction action = GamePlay.gpGetAction(shortName);
if (action != null)
action.Do();
}
|
|
#4
|
|||
|
|||
|
ok so all the "ontrigger parts" go together.
|
|
#5
|
|||
|
|||
|
I tried putting that piece of code in and it didnt work
|
|
#6
|
|||
|
|||
|
Must make some tests, but i am too busy at the moment.
|
|
#7
|
|||
|
|||
|
I understand. I will wait patiently.
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|