Bully-Board

Bully Modding Section => Modding Questions/Help => Modding Questions/Help Archives => Topic started by: Ky on February 19, 2015, 12:33:59 PM

Title: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 12:33:59 PM
GlobalImportScript("SObjTest.lua")
ImportScript("Library/LibTable.lua")
ImportScript("SZone.lua")

 l_0_0 = 60

MissionSetup = function()
  local l_1_0 = 270 -- X coords
  local l_1_1 = -110 -- Y coords
  local l_1_2 = 6.4000000953674 -- Z coords
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)

  PedSetTypeToTypeAttitude(1, 13, 2)
  PedSetTypeToTypeAttitude(2, 13, 2)
  PedSetTypeToTypeAttitude(3, 13, 1)
  PedSetTypeToTypeAttitude(4, 13, 4)
  PedSetTypeToTypeAttitude(5, 13, 1)
  PedSetTypeToTypeAttitude(6, 13, 2)
  PedSetTypeToTypeAttitude(11, 13, 2)
 
  SoundPlayStream("MS_FightingJohnnyVincentBossFight.rsm", 0.69999998807907)
 
  Johnny = PedCreateXYZ(23, l_1_0 +1, l_1_1 +1, l_1_2 +1)
  PedRecruitAlly(gplayer, Johnny)
  Hal = PedCreateXYZ(22, l_1_0 +2, l_1_1 +2, l_1_2 +2)
  PedRecruitAlly(Johnny, Hal)
 
  PlayerSetHealth(2000)
  PedSetHealth(Johnny, 1500)
  PedSetHealth(Hal, 1000)
 
  end

F_MissionSetup = function()

  LoadAnimationGroup("G_Johnny")
  LoadActionTree("G_Striker_A")
  LoadActionTree("G_Johnny")
 
  PlayerSetControl(1)
 
  CameraFollowPed(gPlayer)
 
  ClockSet(8, 30)
 
  ClockSetTickRate(0.0060000000521541)
 
  LaunchScript("SObjTest.lua")

end



MissionCleanup = function()
  ClearTextQueue()
  EnablePOI()
  gMissionRunning = false
  shared.gMissionEventFunction = nil
  WeatherRelease()
  PlayerSetControl(1)
  PlayerSetPunishmentPoints(0)
end



main = function()
  F_MissionSetup()
  gMissionRunning = true
  while gMissionRunning do
  if IsButtonPressed(2,0) then
  PedSetActionNode(gPlayer, "/Global/G_Johnny/Cinematic/ThroatGrab", "Act/Anim/G_Johnny.act")
  elseif IsButtonPressed(0,0) then
  PedSetActionTree(gPlayer, "/Global/G_Johnny", "Act/Anim/G_Johnny.act")
  elseif IsButtonPressed(15,0) then
  PedSetActionTree(gPlayer, "/Global/G_Striker_A", "Act/Anim/G_Striker_A.act")
  elseif IsButtonPressed(1,0) and IsButtonPressed(9,0) then
  PedSetActionNode(gPlayer, "/Global/G_Johnny/Offense/Short/Strikes/LightAttacks/Punch_1/Punch_2/Punch_3/ShortJohnny", "act/anim/G_Johnny.act"
  end
  UpdateTextQueue()
    Wait(0)
  end
end
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: deadpoolXYZ on February 19, 2015, 12:38:11 PM
Dude that's my avatar -.-
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 12:44:41 PM
Dude that's my avatar -.-
sorry, but help me please
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Mick3Mouse on February 19, 2015, 12:49:56 PM
GlobalImportScript("SObjTest.lua")
ImportScript("Library/LibTable.lua")
ImportScript("SZone.lua")

 l_0_0 = 60

MissionSetup = function()
  local l_1_0 = 270 -- X coords
  local l_1_1 = -110 -- Y coords
  local l_1_2 = 6.4000000953674 -- Z coords
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)

  PedSetTypeToTypeAttitude(1, 13, 2)
  PedSetTypeToTypeAttitude(2, 13, 2)
  PedSetTypeToTypeAttitude(3, 13, 1)
  PedSetTypeToTypeAttitude(4, 13, 4)
  PedSetTypeToTypeAttitude(5, 13, 1)
  PedSetTypeToTypeAttitude(6, 13, 2)
  PedSetTypeToTypeAttitude(11, 13, 2)
 
  SoundPlayStream("MS_FightingJohnnyVincentBossFight.rsm", 0.69999998807907)
 
  Johnny = PedCreateXYZ(23, l_1_0 +1, l_1_1 +1, l_1_2 +1)
  PedRecruitAlly(gplayer, Johnny)
  Hal = PedCreateXYZ(22, l_1_0 +2, l_1_1 +2, l_1_2 +2)
  PedRecruitAlly(Johnny, Hal)
 
  PlayerSetHealth(2000)
  PedSetHealth(Johnny, 1500)
  PedSetHealth(Hal, 1000)
 
  end

F_MissionSetup = function()

  LoadAnimationGroup("G_Johnny")
  LoadActionTree("G_Striker_A")
  LoadActionTree("G_Johnny")
 
  PlayerSetControl(1)
 
  CameraFollowPed(gPlayer)
 
  ClockSet(8, 30)
 
  ClockSetTickRate(0.0060000000521541)
 
  LaunchScript("SObjTest.lua")

end



MissionCleanup = function()
  ClearTextQueue()
  EnablePOI()
  gMissionRunning = false
  shared.gMissionEventFunction = nil
  WeatherRelease()
  PlayerSetControl(1)
  PlayerSetPunishmentPoints(0)
end



main = function()
  F_MissionSetup()
  gMissionRunning = true
  while gMissionRunning do
  if IsButtonPressed(2,0) then
  PedSetActionNode(gPlayer, "/Global/G_Johnny/Cinematic/ThroatGrab", "Act/Anim/G_Johnny.act")
  elseif IsButtonPressed(0,0) then
  PedSetActionTree(gPlayer, "/Global/G_Johnny", "Act/Anim/G_Johnny.act")
  elseif IsButtonPressed(15,0) then
  PedSetActionTree(gPlayer, "/Global/G_Striker_A", "Act/Anim/G_Striker_A.act")
  elseif IsButtonPressed(1,0) and IsButtonPressed(9,0) then
  PedSetActionNode(gPlayer, "/Global/G_Johnny/Offense/Short/Strikes/LightAttacks/Punch_1/Punch_2/Punch_3/ShortJohnny", "act/anim/G_Johnny.act")
  end
  UpdateTextQueue()
    Wait(0)
  end
end


I fixed it.


You forgot a "   )  "
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 12:54:42 PM
The same error is happening, no code works :(
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 01:02:25 PM
I've tried various codes, but always of the same error
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: SWEGTA on February 19, 2015, 01:11:16 PM
Code: [Select]
GlobalImportScript("SObjTest.lua")
ImportScript("Library/LibTable.lua")
ImportScript("SZone.lua")

local l_0_0 = 60
local gMissionRunning = true

MissionSetup = function()
  LoadAnimationGroup("G_Johnny")
  LoadActionTree("G_Striker_A")
  LoadActionTree("G_Johnny")

  local l_1_0 = 270 -- X coords
  local l_1_1 = -110 -- Y coords
  local l_1_2 = 6.4000000953674 -- Z coords
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
 
  PlayerSetControl(1)
 
  CameraFollowPed(gPlayer)
 
  ClockSet(8, 30)
 
  ClockSetTickRate(0.0060000000521541)
 
  LaunchScript("SObjTest.lua")

  PedSetTypeToTypeAttitude(1, 13, 2)
  PedSetTypeToTypeAttitude(2, 13, 2)
  PedSetTypeToTypeAttitude(3, 13, 1)
  PedSetTypeToTypeAttitude(4, 13, 4)
  PedSetTypeToTypeAttitude(5, 13, 1)
  PedSetTypeToTypeAttitude(6, 13, 2)
  PedSetTypeToTypeAttitude(11, 13, 2)
 
  SoundPlayStream("MS_FightingJohnnyVincentBossFight.rsm", 0.69999998807907)
 
  Johnny = PedCreateXYZ(23, l_1_0 +1, l_1_1 +1, l_1_2 +1)
  PedRecruitAlly(gplayer, Johnny)
  Hal = PedCreateXYZ(22, l_1_0 +2, l_1_1 +2, l_1_2 +2)
  PedRecruitAlly(Johnny, Hal)
 
  PlayerSetHealth(2000)
  PedSetHealth(Johnny, 1500)
  PedSetHealth(Hal, 1000)
 
  end


MissionCleanup = function()
  ClearTextQueue()
  EnablePOI()
  gMissionRunning = false
  shared.gMissionEventFunction = nil
  WeatherRelease()
  PlayerSetControl(1)
  PlayerSetPunishmentPoints(0)
end



main = function()
  if gMissionRunning == true then
  if IsButtonPressed(2,0) then
  PedSetActionNode(gPlayer, "/Global/G_Johnny/Cinematic/ThroatGrab", "Act/Anim/G_Johnny.act")
  elseif IsButtonPressed(0,0) then
  PedSetActionTree(gPlayer, "/Global/G_Johnny", "Act/Anim/G_Johnny.act")
  elseif IsButtonPressed(15,0) then
  PedSetActionTree(gPlayer, "/Global/G_Striker_A", "Act/Anim/G_Striker_A.act")
  elseif IsButtonPressed(1,0) and IsButtonPressed(9,0) then
  PedSetActionNode(gPlayer, "/Global/G_Johnny/Offense/Short/Strikes/LightAttacks/Punch_1/Punch_2/Punch_3/ShortJohnny", "act/anim/G_Johnny.act")
  end
  UpdateTextQueue()
    Wait(0)
  end
end


You forgot to declare 1_0_0 a local. I think it should work now... hehe...
You also have multiple mission setup, so I did some minor adjustments to your script.
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 01:18:52 PM
Does not work I'm still desperate
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 01:28:55 PM
This error appears in all codes, even in codes that I was compiling perfect before
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: DaBOSS54320 on February 19, 2015, 01:43:47 PM
I took out unnecessary code, and also fixed a few things. I compiled it successfully and could load the script successfully, I had 2 allies recruited and music was playing.
I added a comment to everything I changed.

Code: [Select]
-- Removed unnecessary imported scripts, you do not need them.

-- Removed l_0_0 = 60 because you never use it in the script

MissionSetup = function()
  -- Changed names of variables to something that makes more sense. X makes more sense than l_1_0
  local X = 270
  local Y = -110
  local Z = 6.4
  AreaTransitionXYZ(0, X, Y, Z)

  PedSetTypeToTypeAttitude(1, 13, 2)
  PedSetTypeToTypeAttitude(2, 13, 2)
  PedSetTypeToTypeAttitude(3, 13, 1)
  PedSetTypeToTypeAttitude(4, 13, 4)
  PedSetTypeToTypeAttitude(5, 13, 1)
  PedSetTypeToTypeAttitude(6, 13, 2)
  PedSetTypeToTypeAttitude(11, 13, 2)
 
  SoundPlayStream("MS_FightingJohnnyVincentBossFight.rsm", 0.69999998807907)
 
  Johnny = PedCreateXYZ(23, X +1, Y +1, Z +1)
  PedRecruitAlly(gPlayer, Johnny) -- Capitalized gPlayer. You had "gplayer"
  Hal = PedCreateXYZ(22, X +2, Y +2, Z +2)
  PedRecruitAlly(Johnny, Hal)
 
  PlayerSetHealth(2000)
  PedSetHealth(Johnny, 1500)
  PedSetHealth(Hal, 1000)
 
end

F_MissionSetup = function()

  LoadAnimationGroup("G_Johnny")
  LoadActionTree("Act/Anim/G_Striker_A.act") -- Specified full directory of act file. You only had "G_Striker_A"
  LoadActionTree("Act/Anim/G_Johnny.act") -- Specified full directory of act file. You only had "G_Johnny"
 
  PlayerSetControl(1)
 
  CameraFollowPed(gPlayer)
 
  ClockSet(8, 30)
 
  ClockSetTickRate(0.0060000000521541)
 
  -- Removed LaunchScript("SObjTest.lua") because there is no reason you need to launch another script for this mod

end



MissionCleanup = function()
  ClearTextQueue()
  EnablePOI()
  gMissionRunning = false
  shared.gMissionEventFunction = nil
  WeatherRelease()
  PlayerSetControl(1)
  PlayerSetPunishmentPoints(0)
end



main = function()
  F_MissionSetup()
  gMissionRunning = true
  while gMissionRunning do
    if IsButtonPressed(2,0) then
      PedSetActionNode(gPlayer, "/Global/G_Johnny/Cinematic/ThroatGrab", "Act/Anim/G_Johnny.act")
    elseif IsButtonPressed(0,0) then
      PedSetActionTree(gPlayer, "/Global/G_Johnny", "Act/Anim/G_Johnny.act")
    elseif IsButtonPressed(15,0) then
      PedSetActionTree(gPlayer, "/Global/G_Striker_A", "Act/Anim/G_Striker_A.act")
    elseif IsButtonPressed(1,0) and IsButtonPressed(9,0) then
      PedSetActionNode(gPlayer, "/Global/G_Johnny/Offense/Short/Strikes/LightAttacks/Punch_1/Punch_2/Punch_3/ShortJohnny", "act/anim/G_Johnny.act") -- Added a ')' on the end. You forgot it.
    end
    UpdateTextQueue()
    Wait(0)
  end
end

I used notepad++ to write the code, LuaC by Fred Tetra/MadmaN to compile, and MadmaN's IMG Toolkit V1 to add/replace in the Scripts.img.
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 01:46:19 PM
still the same error
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 01:47:01 PM
I've tried with various codes and always the same error, what should it be?
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: DaBOSS54320 on February 19, 2015, 01:47:57 PM
Something is wrong with your lua editor or compiler or visual studio then.

It worked for me perfectly, and I used notepad++ to write the code, LuaC by Fred Tetra/MadmaN to compile, and installed the Visual Studio version supplied with MadmaN's LuaC release.
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 01:52:55 PM
Something is wrong with your lua editor or compiler or visual studio then.

It worked for me perfectly, and I used notepad++ to write the code, LuaC by Fred Tetra/MadmaN to compile, and installed the Visual Studio version supplied with MadmaN's LuaC release.
what I can do ? could send me the link of all I need, I try to uninstall and reinstall
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: DaBOSS54320 on February 19, 2015, 01:57:34 PM
Notepad++ (http://notepad-plus-plus.org/download/v6.7.4.html): You'll use this to write your LUA code.

LuaC (http://www.bully-board.com/index.php?action=downloads;sa=view;down=60): You'll use this to compile the LUA code. Read all the ReadMe.txts and install what it says.

IMG Toolkit V1 (http://www.bully-board.com/index.php?action=downloads;sa=view;down=159): You can use this to put your compiled LUR files into the Scripts.img. Make sure to delete the old LUR file of the one you're replacing first.
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 02:02:11 PM
already uninstalled and installed again and nothing, the same error occurs
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Mick3Mouse on February 19, 2015, 02:05:43 PM
The same error is happening, no code works :(

Mine compiled it. 
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 02:08:06 PM
it was like  DABoss said something wrong is going on, what will be be?
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 02:11:41 PM
I guess I'll never learn modding Bully :(
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: deadpoolXYZ on February 19, 2015, 02:36:04 PM
You can try compiling in a different directory or create a new .lua file, copy and paste all the code from your original script, and then name it something different. This might help you since the script itself is not the problem.
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: DaBOSS54320 on February 19, 2015, 03:14:10 PM
You're compiling THIS script right? Not another one that contains the error?

Give us the line you put in command prompt, or screenshot it also with the folder the script file is in open so we can see that you gave LuaC proper arguments and the file is in a good place.
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 04:16:04 PM
here goes a print
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 04:17:45 PM
You can try compiling in a different directory or create a new .lua file, copy and paste all the code from your original script, and then name it something different. This might help you since the script itself is not the problem.
How can I do this?
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Toni C. on February 19, 2015, 04:46:34 PM
^^ man you dont've a copy of ArcRace1.lur in your LUA folder. check it out
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 04:48:44 PM
^^ man you dont've copy of ArcRace1.lur in your LUA folder. check it out
yes
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: DaBOSS54320 on February 19, 2015, 05:02:18 PM
LuaC makes a new ArcRace1.lur when it successfully compiles.
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 05:03:04 PM
:(
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: DaBOSS54320 on February 19, 2015, 05:03:47 PM
Try to download this file, drag over your C:/LUA, and replace the old luascript.lua. http://www.filedropper.com/luascript (http://www.filedropper.com/luascript)

If this doesn't work, I really have no idea what to do.
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 05:07:57 PM
Try to download this file, drag over your C:/LUA, and replace the old luascript.lua. http://www.filedropper.com/luascript (http://www.filedropper.com/luascript)

If this doesn't work, I really have no idea what to do.
It worked :) thank you, tell me what the problem was?
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: DaBOSS54320 on February 19, 2015, 05:39:12 PM
The code I gave you there is the exact same as the code I gave before in a code box in a previous post. I just put it in a lua file and saved it. Something is wrong with your LUA editor (Notepad++, and if that's not what you used to make the code, that may be the problem)
Title: Re: I can not compile anything luascript.lua:5: unexpected symbol near 'T'
Post by: Ky on February 19, 2015, 05:44:38 PM
The code I gave you there is the exact same as the code I gave before in a code box in a previous post. I just put it in a lua file and saved it. Something is wrong with your LUA editor (Notepad++, and if that's not what you used to make the code, that may be the problem)
I use Notepad++