soloooy0 Posted March 14, 2020 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 Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted March 14, 2020 Share Posted March 14, 2020 @Stan` he have some problem with triggers scripting. Link to comment Share on other sites More sharing options...
Stan` Posted March 15, 2020 Share Posted March 15, 2020 @FeXoR @nani Can you help? Link to comment Share on other sites More sharing options...
nani Posted March 15, 2020 Share Posted March 15, 2020 (edited) For map triggers ask @elexis. Edited March 15, 2020 by nani 1 Link to comment Share on other sites More sharing options...
Silier Posted March 15, 2020 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now