Scripts / Having trouble with death of a character.

Author
Message
happymancub
9
Years of Service
User Offline
Joined: 26th May 2015
Location:
Posted: 6th Jun 2015 16:56
I have the flying insect Wasp and he is basically able to attack me but I can't do any damage to him. Editing the insectflying script I did not see anything showing he could take damage. I also have the crawling hand and it can be killed so I looked at it's script and see this at the end of the script

function hand_exit(e)
StopAnimation(e)
StopSound(e,0)
Destroy(e)
end

I added that to end of the flying insect script but I still can't do any damage to the Wasp. Here is the entire script if anyone can see how to fix this sure would appreciate it )

local attack_delay = {}
rotation = {}
flying = {}
attacking = {}
stinging = {}
vertmovement = {}
w_animating = {}
maxvolume = {}
minvolume = {}
noise = {}
nvolume = {}



function insectflying_init(e)
attack_delay[e] = 250
rotation[e] = 0
flying[e] = 1
attacking[e] = 0
stinging[e] = 0
vertmovement[e] = 0
w_animating[e] = 0
SetSoundVolume(100)
maxvolume[e] = 100
minvolume[e] = 1
noise[e] = 0
nvolume[e] = 0
end

GravityOff(e)

function insectflying_main(e)
--PlayerDist = GetPlayerDistance(e)
rotation[e] = math.random(-200,200)
vertmovement[e] = math.random(-50,50)

nvolume[e] = maxvolume[e] - ( GetPlayerDistance(e) / 100.0 )
if nvolume[e] < minvolume[e] then
StopSound(e,0)
noise[e]=0
else
if noise[e] == 0 then
LoopSound(e,0)
noise[e] = 1
end
SetSoundVolume(nvolume[e])

end


if stinging[e] == 0 and g_Entity[e]['animating'] == 0 then
SetAnimationFrames(1,2)
LoopAnimation(e)
g_Entity[e]['animating'] = 1
end
if stinging[e] == 0 and w_animating[e] == 1 then
StopAnimation(e)
end


if GetPlayerDistance(e) < 71 then
flying[e] = 0
attacking[e] = 0
stinging[e] = 1
end
if GetPlayerDistance(e) < 500 and GetPlayerDistance(e) >70 then
flying[e] = 0
attacking[e] = 1
stinging[e] = 0
end
if GetPlayerDistance(e) > 500 then
flying[e] = 1
attacking[e] = 0
stinging[e] = 0
end
if flying[e] == 1 then
MoveForward(e,100)
if g_Entity[e]['y'] < 1000 and g_Entity[e]['y'] > 700 then
MoveUp(e,vertmovement[e])
elseif g_Entity[e]['y'] > 1000 then
MoveUp(e,-20)
elseif g_Entity[e]['y'] < 700 then
MoveUp(e,20)
end
RotateY(e,rotation[e])
elseif attacking[e] == 1 then
MoveForward(e,100)
MoveUp(e,vertmovement[e])
if g_Entity[e]['y'] > g_PlayerPosY then
MoveUp(e,-20)
elseif g_Entity[e]['y'] < 650 then
MoveUp(e,20)
end
RotateToPlayer(e)
elseif stinging[e] == 1 then
MoveForward(e,100)
RotateToPlayer(e)
if w_animating[e] == 0 then
StopAnimation(e)
w_animating[e] = 1
end
if w_animating[e] == 1 then
if g_Entity[e]['animating'] == 0 then
SetAnimationFrames(5,14)
LoopAnimation(e)
g_Entity[e]['animating'] = 1
end
end
if GetTimer(e) > attack_delay[e] then
HurtPlayer(e,1)
attack_delay[e] = GetTimer(e) + 250
end
end



function insectflying_exit(e)
StopAnimation(e)
StopSound(e,0)
Destroy(e)

end
end
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 6th Jun 2015 17:59
this is not a script issue but an fpe issue, check the fpe for collision and / or physics and make sure they are on, you can't kill something if it doesnt have any collision detection
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
happymancub
9
Years of Service
User Offline
Joined: 26th May 2015
Location:
Posted: 7th Jun 2015 14:49
ty. Did not see a section for FPE questions )
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 7th Jun 2015 15:31
In the FPE file for that character, Try adding these to the FPE file under the orientation section and delete the dbo and bin file associated with it and try again.

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

Gtox
3D Media Maker
10
Years of Service
User Offline
Joined: 5th Jun 2014
Location: South Africa
Posted: 7th Jun 2015 19:04 Edited at: 7th Jun 2015 19:05
I've modified the fpe files of the bee & wasp, and created a new script, which should make them killable. Download and unzip the attached file, add the two fpe files & bmp files to the folder containing the insects, and copy the insectflyingdeath.lua file into the scriptbank.

Attachments

Login to view attachments
happymancub
9
Years of Service
User Offline
Joined: 26th May 2015
Location:
Posted: 8th Jun 2015 15:27
Thanks Gtox for editing those. I found a problem with the wasp and Bee. They only show up as a white dot on the editor and when I go in to test they are still a white dot. Also tried shooting them and they did not die?
PM
happymancub
9
Years of Service
User Offline
Joined: 26th May 2015
Location:
Posted: 8th Jun 2015 15:39
thanks Pirate Myke, I added that code and it must conflict with something as it locks up as soon as I click on wasp to drop down on editor. Hopefully Gtox will have time to fix them
PM
HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 8th Jun 2015 15:49
More as a reminder. if you make changes in the fpe file. make sure you delete the bin and dbo files in that folder. and restart GG
Sometimes that will also help.

harry
Harry
PM
Gtox
3D Media Maker
10
Years of Service
User Offline
Joined: 5th Jun 2014
Location: South Africa
Posted: 8th Jun 2015 16:00
Did you place the bee(killable).fpe and wasp(killable).fpe files in the same folder as the originals?
happymancub
9
Years of Service
User Offline
Joined: 26th May 2015
Location:
Posted: 8th Jun 2015 18:24
No I had made a directory called toons to make it easier to find all the characters. When i copied them to your origional dir under purchased/Gtox/critters/insects it worked fine ) thank you so much for fixing this for me.
PM

Login to post a reply

Server time is: 2024-12-22 01:36:29
Your offset time is: 2024-12-22 01:36:29