游戏达人
  
- 贡献度
- 457
- 金元
- 14893
- 积分
- 3317
- 精华
- 0
- 注册时间
- 2008-10-19
|
拒绝灌水!!!!!!
作者: Alexander /Alexander Blade / Alexander Koryakin ,flacs
翻译试用:星梦sK.y(本人琢磨了一个多小时)
安 装 :
1 打上ASI Loader补丁
2 把"copy"文件夹里的所有东西拷贝到GTA4根目录
3 example文件夹里有一些范例脚本,把你需要的脚本拷贝到...GTAIVAlice目录
4 进入游戏后,切换出来会看到GTA4目录里自动生成了alice.log,打开可以看到很多跟你的GTAIVAlice目录下的脚本相关的信息
比如,你从example文件夹拷贝了playercoords.lua,那么alice.log里将包含你在游戏所处位置的坐标信息(相当于坐标获取器拉!!!)
5 使用本脚本补丁,在游戏里,可能出现部分贴图丢失,退出游戏后,有可能有出错信息,不要紧的。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
进阶说明:(程序员看)
1.Alice脚本(即本工具)是什么 ?
Alice是基于lua脚本语言的GTA4的脚本引擎。
本工具需要打上ASI Loader补丁
2.关于本工具包里的脚本 ?
所有脚本(后缀为.lua)必须放在"GTAIVAlice"文件夹里。保存或者读取游戏后,脚本功效不会丢失。
3. 脚本信息 :
[!!! 强烈建议抽出时间关注下面的脚本范例]
----- General functions -----
To push integer/float parameter into the calling native func use
PushInt(Value) / PushFloat(Value)
To push script pointer use
PushVarPtr() -- no params, if native changes pushed value
-- u must use this function and after native
-- calling read the value of this variable
To get integer/float param from stack after native call use
Value = GetIntParam(ParamNumber) /
Value = GetFloatParam(ParamNumber)
To get the integer/float result of function (if exists) use
Val = GetIntResult() / Val = GetFloatResult()
At least, to call native function use
CallNative("NATIVE_FUNCTION_NAME") -- names are declared in
-- other files
(WARNING : You can't use functions which operate with models,
and now i don't know what is the reason of this .)
----- Other needed functions (not for natives) -----
Game must be started to use native functions, so we need a check:
bool IsPlayerPoolCreated() -- if player pool is ok then we can
-- use some native functions
bool IsKeyPressed(AnsiKeyNum) -- checking any ansi key state
Wait(Milliseconds) -- stops script for a needed time
PrintFloatToLog(Value) / PrintStrToLog("STRING") -- prints
-- to log
----- Call example -----
-- GET_PLAYER_CHAR(0, &Var)
-- declarations of functions u will see soon ,
-- and now look at additional files
PushInt(0) -- 0 param
PushVarPtr() -- 1 param (this is our &Var)
CallNative("GET_PLAYER_CHAR") -- making a call
PLAYER_CHAR = GetIntParam(1) -- reading the value
-- from 1 parameter
----- Player structure organization -----
int GET_PLAYER_ID() -- get player id , using only for getting
-- results of next functions
-- (always 0 in single player mode);
int CONVERT_INT_TO_PLAYERINDEX( GET_PLAYER_ID() ) -- get player
-- index from id , this is player definition variable
-- (in SA was $PLAYER_CHAR) (always 0 in single player mode);
GET_PLAYER_CHAR( CONVERT_INT_TO_PLAYERINDEX( GET_PLAYER_ID() ), &layerChar )
-- get player char from player index , this is "player as ped/actor"
-- definition variable (in SA was $PLAYER_ACTOR);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
本补丁自带了作者编写的三个脚本:玩家坐标获取、超人(无敌)、即时保存,如果你有编程基础,那么你也可以按照它的范例教程,创作更好更强大的脚本。然后把你编写的脚本放到...GTAIV Alice目录下,进游戏后测试你写的脚本有没有效 ^_^
|
|