Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - WJSZ12

1
I decompiled some of the LUA files of Mafia2.




But I couldn't understand them.


 




For example :


 




I noticed that each LUA file has these two functions:


 







Quotefunction
onGameInit(_ARG_0_
)




xxxxxxx




end



 




function
onEvent(_ARG_0_
,
_ARG_1_
)




xxxxxxx




end









 




1. Is the function "onGameInit" the main function, or the function "onEvent"?


 




2. What do the _ARG_0_
and
_ARG_1_
 mean?


 


 



<hr class="bbcode_rule" />
Thank you !!!
2
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!