![]() |
#1
|
|||
|
|||
![]()
Hello, sorry for my English and my ignorance in c # programming.
I've already started a course to learn to program, but until it is mastered ... I added the following scrip. Quote:
What else would you add? there is the complete scrip Quote:
|
#2
|
|||
|
|||
![]()
Ai will interfere with player detection, players are actors aswell.
However I believe actions are for ai actions, for players you need another piece This bit enables resetting of a trigger , true to keep alive, false to turn off People use the false to stop double activation GamePlay.gpGetTrigger(shortName).Enable = false; However asking this if("trigger".Equals(shortName)) also looks for the trigger in both true and false states. Listing as if("trigger".Equals(shortName) && Active) will look for true trigger in true only. Because you are basically always using the trigger to activate the code you might find you also need a reference to the trigger, so may have to combine the 2 methods following Re quote from Kodiak Code:
using System; using System.Collections; using System.Collections.Generic; using maddox.game; using maddox.game.world; public class Mission : AMission { public override void OnTrigger(int missionNumber, string shortName, bool active) { base.OnTrigger(missionNumber, shortName, active); AiAction Action = GamePlay.gpGetAction(shortName); if (Action != null) Action.Do(); GamePlay.gpGetTrigger(shortName).Enable = false; } } Code:
using System; using System.Collections; using System.Collections.Generic; using maddox.game; using maddox.game.world; public class Mission : AMission { public override void OnTrigger(int missionNumber, string shortName, bool active) { base.OnTrigger(missionNumber, shortName, active); if("trigger".Equals(shortName) && Active) { GamePlay.gpPostMissionLoad("missions/etc/etc/MissionName.mis"); // load sub mission as result of player AiAction Action = GamePlay.gpGetAction(shortName); // note this shortname is action shortname and ai response if (Action != null) Action.Do(); } } } Last edited by Smokeynz; 03-19-2012 at 07:46 PM. |
#3
|
|||
|
|||
![]()
OK, but if I understand.
The flights activated by human need put in a submission or it is not necessary? because all tiggres, Ia and human i have put on same mision. thx |
#4
|
|||
|
|||
![]()
Yeah, bare in mind there is no documention regarding what each function is actually intended for, so many experiement to find out by trial and error to see what happens.
As noted before the action function seems to work(best) with ai actors. (I could be wrong aswell, just haven't found reason why yet) Generally it is used to create repeating ai cycles, the ai airgroup reaches trigger point and new group spawns and repeats. Don't be afraid of using many small sub missions to do spawning, add in objects etc. In fact using sub missions has many advantages over using the main master mission for everything. By utilising the trigger reponse to activate other cs code you can hijack the trigger to do far more operations in general. Also note there are also bugs in source, and we find some things work in player server hosted then they don't work in dedicated hosting. In general, the trigger/actions are simple setup operations for fairly simple mission design. (although it can be part of a larger set of missions). There is a legacy hangover with old il246 mission design, many are trying to do everything in one mission. The basic problem with this is one mission can get large and very complex. By breaking aspects into sub missions, loaded by timers or triggers you lower the individual mission design difficulty. Back to trigger and action, check you are using the correct trigger event. You can trigger by army, passthrough, player etc. Noting there is limits to this, for example you can't set to player and army, so army will allow ai aswell as players, also in army setup, if the ai get to the trigger first they interfere with player detection. This is to do with the trigger, not the action. I have a method of cs code where I bypass the trigger. The trigger is alive always and I reference the same location, but I treat ai and players separately in the cs code. In this way interferance is limited. sorry if some of this is confusing(language as well) |
#5
|
|||
|
|||
![]()
thanks for the reply, it's all very clear.
Now I'm editing the mission, to put all activated human flight in sub missions. |
![]() |
|
|