wc3edit.net https://forum.wc3edit.net/ |
|
Problem with a script, can't find the issue. http://forum.wc3edit.net/deprotection-cheating-f64/problem-with-a-script-can-t-find-the-issue-t29964.html |
Page 1 of 1 |
Author: | Dissed [ April 15th, 2015, 4:05 am ] |
Post subject: | Problem with a script, can't find the issue. |
Could anyone help me out in finding the error? Also could anyone let me know if this can be used with udg and gg variables? Thanks in advance. |
Author: | haxorico [ April 15th, 2015, 6:31 am ] |
Post subject: | Re: Problem with a script, can't find the issue. |
1) function datdoif every function needs to take and return, even if it is nothing. In your case, it returns a boolean (true/false) so change it to: function datdoif takes nothing returns boolean 2) call SetCameraBounds( -3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), -3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP), -3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), -3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM) ) call SetDayNightModels( "Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl" ) call NewSoundEnvironment( "Default" ) call SetAmbientDaySound( "LordaeronSummerDay" ) call SetAmbientNightSound( "LordaeronSummerNight" ) call SetMapMusic( "Music", true, 0 ) call InitBlizzard( ) call InitGlobals( ) All this belonds IN function main. Not outside. Fix function main to look like this function main takes nothing returns nothing local integer zzz=0 loop exitwhen zzz>11 call TriggerRegisterPlayerChatEvent( CMD, Player(0), "ARRR", true ) set zzz=zzz+1 endloop call TriggerAddCondition(CMD, Condition(function datdoif)) call TriggerAddAction(CMD, function datdostuff3) call SetCameraBounds( -3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), -3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP), -3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), -3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM) ) call SetDayNightModels( "Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl" ) call NewSoundEnvironment( "Default" ) call SetAmbientDaySound( "LordaeronSummerDay" ) call SetAmbientNightSound( "LordaeronSummerNight" ) call SetMapMusic( "Music", true, 0 ) call InitBlizzard( ) call InitGlobals( ) endfunction |
Author: | Dissed [ April 15th, 2015, 3:01 pm ] |
Post subject: | Re: Problem with a script, can't find the issue. |
It still brings me back to the menu when I try to load/play/test it. Thanks though, just missing something else as well it seems. I deleted attributes right away as well to insert this... Odd though it should work now. Spoiler for :
|
Author: | haxorico [ April 16th, 2015, 6:18 am ] |
Post subject: | Re: Problem with a script, can't find the issue. |
Not sure how well you fixed it yourself. Best way to know is if you upload the map itself. |
Author: | Dissed [ April 16th, 2015, 9:54 am ] |
Post subject: | Re: Problem with a script, can't find the issue. |
Okay, here's the map. |
Author: | haxorico [ April 17th, 2015, 8:42 pm ] |
Post subject: | Re: Problem with a script, can't find the issue. |
1) why in the code file you have the same funtion twice (and empty) Code: function InitGlobals takes nothing returns nothing endfunction function InitGlobals takes nothing returns nothing endfunction 2) I fixed your function main before. You still have it broken, here is the FIXED function main Code: function main takes nothing returns nothing
local integer zzz=0 loop exitwhen zzz>11 call TriggerRegisterPlayerChatEvent( CMD, Player(0), "ARRR", true ) set zzz=zzz+1 endloop call TriggerAddCondition(CMD, Condition(function datdoif)) call TriggerAddAction(CMD, function datdostuff3) call SetCameraBounds( -3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), -3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP), -3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), -3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM) ) call SetDayNightModels( "Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl" ) call NewSoundEnvironment( "Default" ) call SetAmbientDaySound( "LordaeronSummerDay" ) call SetAmbientNightSound( "LordaeronSummerNight" ) call SetMapMusic( "Music", true, 0 ) call InitBlizzard( ) call InitGlobals( ) endfunction |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |