How would you re right this code to make it work?? I AM USING SPARKYS DLL.Any help is truly a appreshiated.
type enemies
ehealth
estates
endtype
Dim enemy(11)as enemies
enemy(8).estates=8
enemy(9).estates=9
enemy(10).estates=10
enemy(11).estates=11
enemy(8).ehealth =10
enemy(9).ehealth =6
enemy(10).ehealth =4
enemy(11).ehealth =8
do
Rem *****************************************************************************************
Rem ******** Enemy setup *********
Rem *****************************************************************************************
for e = 8 to 11
rem this is just for the enemies animations to play,they all play at the same time.Not good
if animestate2#=0
loop object enemy(e).estates,236,265 rem,this is the animation loop for my array
set object speed enemy(e).estates,70
endif
rem walk animation
if animestate2#=1
loop object enemy(e).estates,266,303
endif
rem jump animation
if animestate2#=2
loop object enemy(e).estates,396,430
set object speed enemy(e).estates,140
endif
rem crouch animation
if animestate2#=3
loop object enemy(e).estates,431,460
set object speed enemy(e).estates,150
endif
rem run animation
if animestate2#=4
loop object enemy(e).estates,300,318
set object speed enemy(e).estates,100
endif
rem distance set up
dx# = object position x(2) - object position x(enemy(e).estates)
dy# = object position y(2) - object position y(enemy(e).estates)
dz# = object position z(2) - object position z(enemy(e).estates)
dx# = dx# * dx#: dy# = dy# * dy#: dz# = dz# * dz#
Dist# = dx# + dy# + dz#
rem distance check
if dist# < (800 * 800)
gothit=3
walktome1=0
animestate2#=0
endif
rem distance call
if dist# < (600 * 600) and trig1=0 then walktome1=1
rem distance command
if walktome1=1
gothit=0
rem move enemies towards the player and slide them
oldx# = object position x(enemy(e).estates)
oldy# = object position y(enemy(e).estates)
oldz# = object position z(enemy(e).estates)
point object e,object position x(2),object position y(2),object position z(2)
move object enemy(e).estates,2
animestate2#=1
x# = object position x(enemy(e).estates)
y# = object position y(enemy(e).estates)
z# = object position z(enemy(e).estates)
rem little spheres collide with all (0)
collide = sc_sphereSlide(0,oldx#,oldy#,oldz#,x#,y#,z#,littleRadius#,enemy(e).estates)
if collide>0
position object enemy(e).estates,sc_getCollisionSlideX(),sc_getCollisionSlideY(),sc_getCollisionSlideZ()
endif
sc_updateObject enemy(e).estates
sc_updateObject 2
endif
rem if object collides with player it changes attack states
if OBJECT COLLISION(enemy(e).estates, 2)
trig1=1:walktome1=0
endif
rem another state change for walk to attack'
if trig1=1
move object enemy(e).estates,0
animestate2#=3
gothit=1
point object enemy(e).estates,object position x(2),object position y(2),object position z(2)
sc_updateObject enemy(e).estates
sc_updateObject 2
endif
rem Rem, this is just saying if enemy is not touching me then its time to chase me
if OBJECT COLLISION(2,enemy(e).estates)=0 and gothit=1 then trig1=0:walktome1=1
rem,not important
E2#=object frame(enemy(e).estates)
if E2#<450.0
inc E2#,1.0
if E2#>=450.0
play sound 1
E2#=50.0
endif
endif
E1#=object frame(enemy(e).estates)
if E1#<460.0
inc E1#,1.0
if E1#>=460.0
DEC PHEALTH
E1#=50.0
endif
endif
next e
sync
loop
my signature keeps being erased by a mod So this is my new signature.