Jump to content

Recommended Posts

Posted

We all scripting newbies have by now heard a lot about "read the log", "The log tells you where you went wrong", etc. But still we are not sure what we are looking for or looking at.

 

Any way that someone can post excerpts of the log where an error is listed with a brief explanation or comment?

 

I know that there are millions of instances and circumstances. But if you could post at least what we should look for?, Also I understand that there are "trace" functions or bugging tools that you can use so it shows on the log. Can anybody expand on that a bit?

 

It would definitively be of help!

 

Thanks!!

Posted

Ok I have an example

Here is the Code

 

 

 

 

--Want to achieve:

-- 1)when Air to Air group is alive (client) a group of A2A targets will spawn

-- 1A) Make that group of target spawn ramdomly and ramdon routes

 

 

BASE:E("------------- SPAWN MENU HANDLER -------------------")

BASE:TraceOnOff(true)

BASE:TraceAll(true)

BASE:TraceClass('EVENT')

BASE:TraceClass('SPAWN')

BASE:TraceClass('ZONE')

BASE:TraceLevel(1)

BASE:TraceClass("DATABASE")

 

--************************Polygone Zone Creation

--irrelevant to the main mission right now but I wanted to try the poligon zone thing, is working BTW

GroupPolygon = GROUP:FindByName( "RUS ZONE A2A 1" )

 

PolygonZone = ZONE_POLYGON:New( "RUS ZONE A2A 1", GroupPolygon )

PolygonZone:SmokeZone( SMOKECOLOR.White, 5 )-- this is only to verify thet the zone was created, to be commented out later

 

--*******************************Spawning of A2A

GroupAwacs = group:findByName ( "US Plane Awacs" )

GroupRusAirtoAir = group:FindByName ( "RUS Plane 2 MIG29A" )

GroupUSAir2Air = group:FindByName ( "US Plane f18*3 A2A" )

 

MessageScheduler = SCHEDULER:New( nil,

function ()

 

if GroupUSAir2Air:IsAlive() == True then

Spawn_Plane_1 = SPAWN:New( "RUS Plane 2 MIG29A" )

Spawn_Group_1 = Spawn_Plane_1:Spawn()

:InitLimit(1,1)

:InitRandomizeRoute( 1, 3, 3000, 1000 )

 

--then

--Spawn_Awacs = SPAWN:New( "US Plane Awacs" )

--Spawn_Group_1 = Spawn_Awacs:Spawn()

Messager:stop()

end

 

end, {}, 1, 30

)

 

 

 

Im assuming the error is listed in this area,

 

 

 

2020-04-21 04:38:05.749 INFO SCRIPTING: *** MOOSE INCLUDE END ***

2020-04-21 04:38:05.753 INFO SCRIPTING: 15( -1)/E: BASE00000.function(------------- SPAWN MENU HANDLER -------------------)

2020-04-21 04:38:05.753 INFO SCRIPTING: 4095( 17)/E: BASE00000.TraceAll(Tracing all methods in MOOSE )

2020-04-21 04:38:05.753 INFO SCRIPTING: 4107( 18)/E: BASE00000.TraceClass(Tracing class EVENT)

2020-04-21 04:38:05.753 INFO SCRIPTING: 4107( 19)/E: BASE00000.TraceClass(Tracing class SPAWN)

2020-04-21 04:38:05.753 INFO SCRIPTING: 4107( 20)/E: BASE00000.TraceClass(Tracing class ZONE)

2020-04-21 04:38:05.753 INFO SCRIPTING: 4084( 21)/E: BASE00000.TraceLevel(Tracing level 1)

2020-04-21 04:38:05.753 INFO SCRIPTING: 4107( 22)/E: BASE00000.TraceClass(Tracing class DATABASE)

2020-04-21 04:38:05.754 INFO SCRIPTING: 8683( 9852)/F: ZONE_BASE00135.New(RUS ZONE A2A 1)

2020-04-21 04:38:05.754 INFO SCRIPTING: 9853( 10137)/F: ZONE_POLYGON_BASE00135.New({[1]=RUS ZONE A2A 1,[2]={[1]={[speed_locked]=true,[type]=Turning Point,[ETA]=0,[alt_type]=BARO,[x]=-163231.26351341,[y]=470571.36425954,[formation_template]=,[name]=DictKey_WptName_447,[ETA_locked]=true,[speed]=5.5555555555556,[action]=Off Road,[task]={[id]=ComboTask,[params]={[tasks]={},},},[alt]=188,},[2]={[speed_locked]=true,[type]=Turning Point,[ETA]=3401.1796633627,[alt_type]=BARO,[x]=-155665.79812698,[y]=487886.14071096,[formation_template]=,[name]=DictKey_WptName_448,[ETA_locked]=false,[speed]=5.5555555555556,[action]=Off Road,[task]={[id]=ComboTask,[params]={[tasks]={},},},[alt]=1998,},[3]={[speed_locked]=true,[type]=Turning Point,[ETA]=4386.4139948876,[alt_type]=BARO,[x]=-151064.1233043,[y]=484922.35014721,[formation_template]=,[name]=DictKey_WptName_449,[ETA_locked]=false,[speed]=5.5555555555556,[action]=Off Road,[task]={[id]=ComboTask,[params]={[tasks]={},},},[alt]=1091,},[4]={[speed_locked]=true,[type]=Turning Point,[ETA]=7749.9505244254,[alt_type]=BARO,[x]=-157693.6548285,[y]=467451.58471874,[formation_template]=,[name]=DictKey_WptName_450,[ETA_locked]=false,[speed]=5.5555555555556,[action]=Off Road,[task]={[id]=ComboTask,[params]={[tasks]={},},},[alt]=162,},},})

2020-04-21 04:38:05.755 INFO SCRIPTING: 10138( 28)/F: ZONE_POLYGON00135.New({[1]=RUS ZONE A2A 1,[2]={[Takeoff]={[Air]=1,[Hot]=3,[Runway]=2,[Cold]=4,},[GroupName]=RUS ZONE A2A 1,[ClassName]=GROUP,},[3]={[1]={[y]=470571.36425954,[x]=-163231.26351341,},[2]={[y]=487886.14071096,[x]=-155665.79812698,},[3]={[y]=484922.35014721,[x]=-151064.1233043,},[4]={[y]=467451.58471874,[x]=-157693.6548285,},},})

2020-04-21 04:38:05.755 INFO SCRIPTING: 6011( 10141)/F: EVENT00000.CreateEventNewZone({[1]={[ClassName]=ZONE_POLYGON,},})

2020-04-21 04:38:05.755 INFO SCRIPTING: 6229( 13)/T: EVENT00000.{[1]=S_EVENT_NEW_ZONE,[2]={[time]=0,[zone]={[ClassName]=ZONE_POLYGON,},[id]=1035,[ZoneName]=RUS ZONE A2A 1,[Zone]=,},[5]=1,}

2020-04-21 04:38:05.755 INFO SCRIPTING: 9954( 29)/T: ZONE_POLYGON00135.{[1]=1,[2]=4,[3]={[y]=470571.36425954,[x]=-163231.26351341,},[4]={[y]=467451.58471874,[x]=-157693.6548285,},}

2020-04-21 04:38:05.757 INFO SCRIPTING: 9954( 29)/T: ZONE_POLYGON00135.{[1]=2,[2]=1,[3]={[y]=487886.14071096,[x]=-155665.79812698,},[4]={[y]=470571.36425954,[x]=-163231.26351341,},}

2020-04-21 04:38:05.759 INFO SCRIPTING: 9954( 29)/T: ZONE_POLYGON00135.{[1]=3,[2]=2,[3]={[y]=484922.35014721,[x]=-151064.1233043,},[4]={[y]=487886.14071096,[x]=-155665.79812698,},}

2020-04-21 04:38:05.761 INFO SCRIPTING: 9954( 29)/T: ZONE_POLYGON00135.{[1]=4,[2]=3,[3]={[y]=467451.58471874,[x]=-157693.6548285,},[4]={[y]=484922.35014721,[x]=-151064.1233043,},}

2020-04-21 04:38:05.763 ERROR DCS: Mission script error: : [string "C:\Users\faura\AppData\Local\Temp\DCS.openbeta\/~mis00001378.lua"]:32: attempt to index global 'group' (a nil value)

stack traceback:

[C]: ?

[string "C:\Users\faura\AppData\Local\Temp\DCS.openbeta\/~mis00001378.lua"]:32: in main chunk

 

 

 

specifically this line?

 

2020-04-21 04:38:05.763 ERROR DCS: Mission script error: : [string "C:\Users\faura\AppData\Local\Temp\DCS.openbeta\/~mis00001378.lua"]:32: attempt to index global 'group' (a nil value)

stack traceback:

[C]: ?

[string "C:\Users\faura\AppData\Local\Temp\DCS.openbeta\/~mis00001378.lua"]:32: in main chunk

 

but, what is it telling me?

 

any help please!

 

Here is the DCS log (had t change it to .lua would not let me upload as .log)

dcs-log.lua

Posted
I might create another quick video covering the basics.

 

 

Buddy, this will be the topic of some importance in the re-imagined Moose world. If you want to own this completley it would be of great help. Please pass it under out noses so the "collective" can chip in :)

 

I especially would like new users to understand the causes of "nil", where to get the right line, some of the common ones, etc. Other useful info is - Discerning the moose verison, DCS "normal" errors, adding debugging entires to help isolate issues, what other things the logs can say etc. I'd rather we did it really well and start shallow and dive deep than a "quick video" ;)

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...