soloooy0 Posted March 14, 2020 Report Share Posted March 14, 2020 (edited) hola, estoy teniendo problemas con los scripts y si tengo que unirlos o agregarlos o cómo configurar los disparadores Campos gálicos (3) .js numantia test.xml Edited March 14, 2020 by soloooy0 1 Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted March 14, 2020 Report Share Posted March 14, 2020 @Stan` he have some problem with triggers scripting. Quote Link to comment Share on other sites More sharing options...
Stan` Posted March 15, 2020 Report Share Posted March 15, 2020 @FeXoR @nani Can you help? Quote Link to comment Share on other sites More sharing options...
nani Posted March 15, 2020 Report Share Posted March 15, 2020 (edited) For map triggers ask @elexis. Edited March 15, 2020 by nani 1 Quote Link to comment Share on other sites More sharing options...
Silier Posted March 15, 2020 Report Share Posted March 15, 2020 "TriggerScripts": [ "scripts/TriggerHelper.js", "skirmishes/YourTrigger.js", <-- this includes script to your map, path is relative to public/maps ], In the script file, for example "YourTrigger.js" there need to be following section { let cmpTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger); cmpTrigger.DoAfterDelay(time, "nameOfFunction", {/*parameters*/}); <- if you want to trigger function with time delay cmpTrigger.RegisterTrigger("OnInitGame", "InitFunction", { "enabled": true }) <- I would prefer this one } In InitFunction you can bind more triggers You define any function in your trigger file with Trigger.prototype.nameOfFunction Trigger.prototype.InitFunction = function() { this.RegisterTrigger("OnOwnershipChanged", "MyOwnershipChange", { "enabled": true }); <- bind to whatever On event // or call any custom function in Trigger } To give commands to entities use ProcessCommand function ProcessCommand(playerID, anyCommandInJsonForm); It is good to look into TriggerHelper file to see defined functions you can already use. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.