Problem with a script, can't find the issue.
Moderator: Cheaters
-
- Junior Member
- Posts: 44
- Joined: August 13th, 2007, 8:52 am
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.
Also could anyone let me know if this can be used with udg and gg variables?
Thanks in advance.
You do not have the required permissions to view the files attached to this post.
-
- Super Moderator
- Posts: 3197
- Joined: February 24th, 2009, 1:31 pm
- Location: JEW LAND
- Been thanked: 1 time
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
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
-
- Junior Member
- Posts: 44
- Joined: August 13th, 2007, 8:52 am
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 :
-
- Super Moderator
- Posts: 3197
- Joined: February 24th, 2009, 1:31 pm
- Location: JEW LAND
- Been thanked: 1 time
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.
-
- Junior Member
- Posts: 44
- Joined: August 13th, 2007, 8:52 am
Re: Problem with a script, can't find the issue.
Okay, here's the map.
You do not have the required permissions to view the files attached to this post.
-
- Super Moderator
- Posts: 3197
- Joined: February 24th, 2009, 1:31 pm
- Location: JEW LAND
- Been thanked: 1 time
Re: Problem with a script, can't find the issue.
1) why in the code file you have the same funtion twice (and empty)
2) I fixed your function main before. You still have it broken, here is the FIXED function main
Code: Select all
function InitGlobals takes nothing returns nothing
endfunction
function InitGlobals takes nothing returns nothing
endfunction
Code: Select all
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