Scripting Problems

Level 2
Joined
Dec 18, 2009
Messages
14
Well when i try to save the map it gives me errors with the script writing and i have no idea how to fix, can you help me? It says 2 lines are wrong.
function lc takes player lC,player K4,integer ld returns nothing
and
function lC takes nothing returns nothing
 
Level 2
Joined
Dec 18, 2009
Messages
14
well i don't know much about the codes but i'll copy some mroe of it
1. function lc takes player lC,player K4,integer ld returns nothing
if GetPlayerState(K4,PLAYER_STATE_RESOURCE_GOLD)-200>=ld then
call SetPlayerState(K4,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(K4,PLAYER_STATE_RESOURCE_GOLD)-ld)
call SetPlayerState(lC,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(lC,PLAYER_STATE_RESOURCE_GOLD)+ld)
call Kv(K4,lC,"Tribute of "+I2S(ld)+" Gold is complete.")
else
call Kv(K4,lC,"Sorry, I don't have enough Gold.")
endif
endfunction

function lD takes player lC,player K4,integer ld returns nothing
if GetPlayerState(K4,PLAYER_STATE_RESOURCE_LUMBER)-200>=ld then
call SetPlayerState(K4,PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(K4,PLAYER_STATE_RESOURCE_LUMBER)-ld)
call SetPlayerState(lC,PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(lC,PLAYER_STATE_RESOURCE_LUMBER)+ld)
call Kv(K4,lC,"Tribute of "+I2S(ld)+" Lumber is complete.")
else
call Kv(K4,lC,"Sorry, I don't have enough Lumber.")
endif
endfunction

and then

2.function lC takes nothing returns nothing
local player K4=null
local string KO=GetEventPlayerChatString()
local integer cn=0
call Ko(KO)
if udg_strings21[1]=="Help"then
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"Commander Help")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"Here are the Commands for The Commander")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"ESC")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"-Starts dialog command")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"Cmd: Help")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"-Displays Help")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"Cmd: Board")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"-Displays Colorboard")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"Cmd: Chatter")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"-Turns On/Off the Chat messages your allies will send you.")
call g2(5.00)
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"Here are the Commands for Ally use")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"Cmd: (Ally) Trib (Amount) <G or L>")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"-Using this command you can have your computer ally donate resources to you.")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"Cmd: (Ally) Cancel <All, Attack, Build, or Queue>")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"-Cancels either All, Attack, Build or Queued Commands given so far.")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"Cmd: (Ally) Stop")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"-Stops the current command.")
call g2(15.00)
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"Here are some more Commands for Ally use")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"Cmd: (Ally) No <Attacks, Creep, or Players>")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"-Stops the computer from attacking either Anything, Creeps, or Players.")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"Cmd: (Ally) Build (How Many) <A2A, A2G, G2A, or G2G>")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"-This will cause the ally to make sure that they have that many of the certain unit type.")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"Cmd: (Ally) Attack <Here, Select, or (Enemy)>")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"-Will cause that ally either to attack/guard the center of your current screen position or Selected Computer.")
call g2(15.00)
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"Here are the Queue Commands")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"Cmd: (Ally) Que <Start or Restart>")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"-Starts the Queued Commands or REstarts them.")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"Cmd: (Ally) Que <Pause or Unpause>")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"-Pauses or Unpauses the Queued Commands.")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"Cmd: (Ally) Que Undo")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"-Removes the last Queued Command.")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"Cmd: (Ally) Que Attack <Here or Select>")
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,15,"-Will Queue the Current Screen Position or Selected Unit, to be started later.")
return
endif
if udg_strings21[1]=="Board"then
call LeaderboardDisplay(udg_leaderboard01,not IsLeaderboardDisplayed(udg_leaderboard01))
return
endif
set K4=K3(udg_strings21[1],true)
if K4==null then
call KS("You have not specified a valid player.")
return
elseif K4!=Player(14)then
if GetPlayerController(K4)!=MAP_CONTROL_COMPUTER then
call KS("You have not specified a computer.")
return
elseif(not IsPlayerAlly(GetTriggerPlayer(),K4))and(not(IsPlayerObserver(GetTriggerPlayer())and udg_boolean04))then
call KU(K4,udg_string12)
return
endif
endif
if udg_strings21[2]=="Tribute"or udg_strings21[2]=="Trib"then
call lf(GetTriggerPlayer(),K4,udg_strings21[4],udg_strings21[3])
return
endif
set cn=ln()
if cn<0 then
call KU(K4,"I do not know that command.")
return
endif
if K4==Player(14)then
call lK(cn)
else
call li(K4,cn)
endif
endfunction
 
Level 2
Joined
Dec 18, 2009
Messages
14
ok but i can't find the code, i went into triggers and looked at line 6057 and it was completely different, where is all of these kept?
 
Level 9
Joined
Nov 28, 2008
Messages
704
What on earth are you doing with an unprotected map?

Also:

JASS:
function lc takes player lC,player K4,integer ld returns nothing
and
function lC takes nothing returns nothing

Seems fairly odd those would error if lc is above lC.

If you want to fix it, rename that there player variable in lc to something else and replace everywhere else inside the function with your new name.

I advise making your own maps though.
 
Level 2
Joined
Dec 18, 2009
Messages
14
i'm trying to get it working so i can play it. But like when i save and it comes up with the jasshelper thing it says lines are wrong and i can't edit it from there so i try and look for it but i can't find where about it is, do you want me to post the unprotected map?
 
Level 2
Joined
Dec 18, 2009
Messages
14
lol its ok, the map is attached. Thanks for looking at it.
 

Attachments

  • TagYoureIt(ver.2.2) deprotected.w3x
    635.7 KB · Views: 35
Level 2
Joined
Dec 18, 2009
Messages
14
It all makes sense now. This isn't a protected map? That's kind of insulting don't you think?
lol?
I tried to get it unprotected so i could re save it then it would apparently work. But i got told since it was erroring me when i open it in world edit i should try it with jass new gen world edit, i managed to get it opend but can't save it, so your saying its the program giving me errors? Got any ideas how to fix?
 
Level 17
Joined
Jan 21, 2006
Messages
2,545
Well its a problem that is derived from you trying to unprotect a protected map, something that probably isn't very favored on these forums.

Second of all, using an advanced editor won't take away syntax errors. It looks more like whatever program you used to unprotect it corrupted the file or something.
 
Level 10
Joined
Aug 15, 2008
Messages
720
Well, I have deprotected some maps. But most of deprotection programs just deprotects map and allows you to open it with world editor, but here is the problem - you can't save it, it's triggers will give you over thousands of syntax errors. Basically most of deprotection programs are only meant that people extract models/skins/terrain and etc. As I said, you can't save map if it was protected and then you deprotected it.
 
Top