Scripts / Scripts insert in editor

Author
Message
alextherimp
9
Years of Service
User Offline
Joined: 12th Dec 2015
Location:
Posted: 16th Dec 2015 03:54
Good day
How can I insert scripts I have the respawn script of smallg
How can I insert the script I have tested it I did right click and then went in the Properties then Ai System> Main example then the ai_cover.lua replaced with my ai_respawn.lua
This is not somehow the bot moves no piece

greeting

Google Translate
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 16th Dec 2015 04:02
Hello, Could you post your script in code tags? So we can see what you adjusted.

Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

alextherimp
9
Years of Service
User Offline
Joined: 12th Dec 2015
Location:
Posted: 16th Dec 2015 04:11
Here is the script
https://forum.game-guru.com/thread/207801?page=10#msg2533489

dead = {}
function ai_respawn_init(e)
package.path = "scriptbank/?.lua;"
require('ai_soldier') --name of AI script to use (no .lua needed)
ai_soldier_init(e) --init(e) call from the AI script used
dead[e] = 0
end

--script to be used in conjunction with ai_respawner.lua
function ai_respawn_main(e)
if dead[e] == 0 then
Show(e)
ai_soldier_main(e) --main(e) call from the AI script used
elseif dead[e] > 2 then
ai_soldier_init(e) --init(e) call from the AI script used
Hide(e)
CollisionOff(e)
end
end

function ai_respawn_exit(e)
dead[e] = 1
ai_soldier_exit(e) --exit(e) call from the AI script used

--time to wait before removing the dead bodies (in seconds)
--note, dont set too long or it may get removed by the system and then there will be no possibility of respawn
local body_removal_delay = 2
--time to wait before respawning the enemies (in seconds)
local respawn_delay = 6

--amount of variation in x,y and z placements when enemies are respawned (in percent)
--note this is taken from where they die
--note2 y position doesnt currently work due to a GG bug
local xmod = 0.02
local zmod = 0.02
local ymod = 0

--time to wait between checks (for performance reasons)
local delay = 1000

---------
local x = {}
local y = {}
local z = {}
local timer = {}

--script to work in conjunction with ai_respawn.lua
--set always active
function ai_respawner_init(e)
Hide(e)
CollisionOff(e)
end

function ai_respawner_main(e)
Hide(e)
CollisionOff(e)
if GetTimer(e) > delay then
StartTimer(e)
for a = 1,9999 do
if g_Entity[a] ~= nil and a ~= e then
if dead[a] ~= nil then
if dead[a] == 1 then
if xmod <= 0 or xmod > 99 then
x[a] = g_Entity[a]['x']
else
x[a] = g_Entity[a]['x'] * math.random(1-(xmod/10),1+(xmod/10))
end
if ymod <= 0 or ymod > 99 then
y[a] = g_Entity[a]['y']
else
y[a] = g_Entity[a]['y'] * math.random(1-(ymod/10),1+(ymod/10))
end
if zmod <= 0 or zmod > 99 then
z[a] = g_Entity[a]['z']
else
z[a] = g_Entity[a]['z'] * math.random(1-(zmod/10),1+(zmod/10))
end
dead[a] = 2
timer[a] = g_Time + (body_removal_delay*1000)

--check body for removal
elseif dead[a] == 2 then
if g_Time >= timer[a] then
--PromptDuration("removed body",500)
timer[a] = g_Time + (respawn_delay*1000)
Spawn(a)
Hide(a)
CollisionOff(a)
SetPosition(a,x[a],y[a],z[a])
ResetPosition(a,x[a],y[a],z[a])
AIEntityGoToPosition(g_Entity[a]['obj'],x[a],z[a])
dead[a] = 3
end

--check for respawn
elseif dead[a] == 3 then
if g_Time >= timer[a] then
--PromptDuration("respawned enemy",500)
Show(a)
CollisionOn(a)
dead[a] = 0
end
end
end
end
end
end


end


function ai_respawner_exit(e)
end
PM

Login to post a reply

Server time is: 2024-12-22 10:06:56
Your offset time is: 2024-12-22 10:06:56