Announcement

If you are having trouble logging in, please reset your password.
If you are not getting an activation email, please check your spam or
use the "Contact Us" to contact an admin.
February 12, 2015, 07:04:02 AM Last Edit: January 01, 1970, 12:00:00 AM by Guest
Could you answer my questions about the LUA Script in Mafia II?




1.What are the differences between the standard LUA grammar and Mafia II LUA grammar?


 



<hr class="bbcode_rule" />





This is the standard LUA grammar of function:



<hr class="bbcode_rule" />



 







Quotefunction
func_name (arguments-list)




statements-list





return





values





end









 



<hr class="bbcode_rule" />





This is a Mafia II LUA command:



<hr class="bbcode_rule" />



 







Quote--By eXistenZ34





ply=game.game:GetActivePlayer()





DelayBuffer:Insert(
function
(l_1_0)




CommandBuffer:Insert(l_6_0,{





function
(l_1_0)return
ply:SetControlStyle(enums.ControlStyle.LOCKED)end
,




function
(l_2_0)return
ply:AnimPlay("sc_man_smoke_in", false)end
,




function
(l_3_0)return
ply:AnimPlay("sc_man_smoke_stat_a", false)end
,




function
(l_4_0)return
ply:AnimPlay("sc_man_smoke_stat_b", false)end
,




function
(l_5_0)return
ply:AnimPlay("sc_man_smoke_stat_c", false)end
,




function
(l_6_0)return
ply:AnimPlay("sc_man_smoke_stat_d", false)end
,




function
(l_7_0)return
ply:AnimPlay("sc_man_smoke_out", false)end
,




function
(l_8_0)return
ply:SetControlStyle(enums.ControlStyle.FREE)end
})




end
,{l_1_0},500,1,false)













 



<hr class="bbcode_rule" />





2.Where is the name of a function in Mafia II LUA command?




3.What do the l_1_0 , l_2_0 , l_6_0 , and etc. mean? Are they arguments? Or are they the names of functions?



<hr class="bbcode_rule" />



 



<hr class="bbcode_rule" />





This is another LUA script of Mafia II:



<hr class="bbcode_rule" />



 







QuoteDelayBuffer:Insert(function
(l_1_0
) xxxxxx end
,{l_1_0
},10000,10,false)








 


 


 



<hr class="bbcode_rule" />





4.What do the two l_1_0
mean?




5.And what is the usage of CommandBuffer:Remove() ?



<hr class="bbcode_rule" />



 



<hr class="bbcode_rule" />
Thank you!

#1 March 16, 2015, 10:28:05 AM Last Edit: January 01, 1970, 12:00:00 AM by Guest
From what it looks like to me it's calling the functions but I'm not a Expert at LUA 100% so