Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Can somone help fix this small bug in a zora  (Read 2186 times)

0 Members and 1 Guest are viewing this topic.
Can somone help fix this small bug in a zora
« on: June 28, 2011, 01:49:28 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 262
Hi,

Well, I'm still working on the creation of the enemies for TLOZ:CR, but I'm having a problem with the zora enemie type right now. It works as intended except for 1 thing. Unfortunately this is a rather important thing.
The zora enemie is set to have a small moment between disappearing and reappearing, but currently if you swim over it while its not visilbe, ( while not diving ) you still get hit.

Getting hit is set in the link object in a step event that says that if link collides with objHurt ( the parent of obj_zora ) link gets hurt. Can someone look at this?

Below is the information of obj_zora:

Code: [Select]
Information about object: obj_zora
Sprite: sprZora
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: objHurt
Mask:

Create Event:

execute code:

alarm[0]=90
HP=3
stunned=0
image_index=0
image_speed=.1

Alarm Event for alarm 0:

execute code:

randoom=floor(random(8))
if randoom=0 && place_meeting(x+32,y,objdeepwater) && !place_meeting(x+32,y,obj_link)
{
x+=32
}
if randoom=1 && place_meeting(x-32,y,objdeepwater) && !place_meeting(x-32,y,obj_link)
{
x-=32
}
if randoom=2 && place_meeting(x,y+32,objdeepwater) && !place_meeting(x,y+32,obj_link)
{
y+=32
}
if randoom=3 && place_meeting(x,y-32,objdeepwater) && !place_meeting(x,y-32,obj_link)
{
y-=32
}
if randoom=4 && place_meeting(x+80,y,objdeepwater) && !place_meeting(x+80,y,obj_link)
{
x+=80
}
if randoom=5 && place_meeting(x-80,y,objdeepwater) && !place_meeting(x-80,y,obj_link)
{
x-=80
}
if randoom=6 && place_meeting(x,y+80,objdeepwater) && !place_meeting(x,y+80,obj_link)
{
y+=80
}
if randoom=7 && place_meeting(x,y-80,objdeepwater) && !place_meeting(x,y-80,obj_link)
{
y-=80
}
visible=true
image_index=0
alarm[0]=90

Step Event:

execute code:

if place_meeting(x,y,objSword) or place_meeting(x,y,objSwordCharge) && global.swordlvl=1 && image_alpha=1{
    sound_play(EHit)
    HP-=1
    if direction=90{
        if(place_meeting(x,y+5,objdeepwater)){
            y+=5
        }
    }
    if direction=270{
        if(place_meeting(x,y-5,objdeepwater)){
            y-=5
        }
    }
    if direction=360 or direction =0{
        if(place_meeting(x-5,y,objdeepwater)){
            x-=5
        }
    }
    if direction=180{
        if(place_meeting(x+5,y,objdeepwater)){
            x+=5
        }
    }
    image_alpha=0.75
    alarm[1]=10
}

if place_meeting(x,y,objSwordSpin) && global.swordlvl=1 && image_alpha=1{
    sound_play(EHit)
    HP-=2
    if direction=90{
        if(place_meeting(x,y+5,objdeepwater)){
            y+=5
        }
    }
    if direction=270{
        if(place_meeting(x,y-5,objdeepwater)){
            y-=5
        }
    }
    if direction=360 or direction =0{
        if(place_meeting(x-5,y,objdeepwater)){
            x-=5
        }
    }
    if direction=180{
        if(place_meeting(x+5,y,objdeepwater)){
            x+=5
        }
    }
    image_alpha=0.75
    alarm[1]=10
}

if place_meeting(x,y,objSword) && global.swordlvl=2 && image_alpha=1{
    sound_play(EHit)
    HP-=2
    if direction=90{
        if(place_meeting(x,y+5,objdeepwater)){
            y+=5
        }
    }
    if direction=270{
        if(place_meeting(x,y-5,objdeepwater)){
            y-=5
        }
    }
    if direction=360 or direction =0{
        if(place_meeting(x-5,y,objdeepwater)){
            x-=5
        }
    }
    if direction=180{
        if(place_meeting(x+5,y,objdeepwater)){
            x+=5
        }
    }
    image_alpha=0.75
    alarm[1]=10
}

if place_meeting(x,y,objSwordSpin) && global.swordlvl=2 && image_alpha=1{
    sound_play(EHit)
    HP-=4
    if direction=90{
        if(place_meeting(x,y+5,objdeepwater)){
            y+=5
        }
    }
    if direction=270{
        if(place_meeting(x,y-5,objdeepwater)){
            y-=5
        }
    }
    if direction=360 or direction =0{
        if(place_meeting(x-5,y,objdeepwater)){
            x-=5
        }
    }
    if direction=180{
        if(place_meeting(x+5,y,objdeepwater)){
            x+=5
        }
    }
    image_alpha=0.75
    alarm[1]=10
}

if place_meeting(x,y,objSwordCharge) && global.swordlvl=2 && image_alpha=1{
    sound_play(EHit)
    HP-=3
    if direction=90{
        if(place_meeting(x,y+5,objdeepwater)){
            y+=5
        }
    }
    if direction=270{
        if(place_meeting(x,y-5,objdeepwater)){
            y-=5
        }
    }
    if direction=360 or direction =0{
        if(place_meeting(x-5,y,objdeepwater)){
            x-=5
        }
    }
    if direction=180{
        if(place_meeting(x+5,y,objdeepwater)){
            x+=5
        }
    }
    image_alpha=0.75
    alarm[1]=10
}

if place_meeting(x,y,objSwordCharge) && global.swordlvl=3 && image_alpha=1{
    sound_play(EHit)
    HP-=5
    if direction=90{
        if(place_meeting(x,y+5,objdeepwater)){
            y+=5
        }
    }
    if direction=270{
        if(place_meeting(x,y-5,objdeepwater)){
            y-=5
        }
    }
    if direction=360 or direction =0{
        if(place_meeting(x-5,y,objdeepwater)){
            x-=5
        }
    }
    if direction=180{
        if(place_meeting(x+5,y,objdeepwater)){
            x+=5
        }
    }
    image_alpha=0.75
    alarm[1]=10
}

if place_meeting(x,y,objSwordSpin) && global.swordlvl=3 && image_alpha=1{
    sound_play(EHit)
    HP-=7
    if direction=90{
        if(place_meeting(x,y+5,objdeepwater)){
            y+=5
        }
    }
    if direction=270{
        if(place_meeting(x,y-5,objdeepwater)){
            y-=5
        }
    }
    if direction=360 or direction =0{
        if(place_meeting(x-5,y,objdeepwater)){
            x-=5
        }
    }
    if direction=180{
        if(place_meeting(x+5,y,objdeepwater)){
            x+=5
        }
    }
    image_alpha=0.75
    alarm[1]=10
}

if place_meeting(x,y,objSword) && global.swordlvl=3 && image_alpha=1{
    sound_play(EHit)
    HP-=4
    if direction=90{
        if(place_meeting(x,y+5,objdeepwater)){
            y+=5
        }
    }
    if direction=270{
        if(place_meeting(x,y-5,objdeepwater)){
            y-=5
        }
    }
    if direction=360 or direction =0{
        if(place_meeting(x-5,y,objdeepwater)){
            x-=5
        }
    }
    if direction=180{
        if(place_meeting(x+5,y,objdeepwater)){
            x+=5
        }
    }
    image_alpha=0.75
   }

execute code:

if place_meeting(x,y,obj_link) && obj_link.usingshield{
    if global.facing="U"{
        sound_play(Bump)
        if(place_meeting(x,y-5,objdeepwater)){
            y-=5
        }
    }
    if global.facing="D"{
        sound_play(Bump)
        if(place_meeting(x,y+5,objdeepwater)){
            y+=5
        }
    }
    if global.facing="R"{
        sound_play(Bump)
        if(place_meeting(x-5,y,objdeepwater)){
            x+=5
        }
    }
    if global.facing="L"{
        sound_play(Bump)
        if(place_meeting(x+5,y,objdeepwater)){
            x-=5
        }
    }
}
if place_meeting(x,y,objFirerod) or place_meeting(x,y,objIcerod) or place_meeting(x,y,objMRod) && image_alpha=1{
    sound_play(EHit)
    HP-=1
    image_alpha=0.75
    alarm[1]=10
    if direction=90{
        if(place_meeting(x,y+5,objdeepwater)){
            y+=5
        }
    }
    if direction=270{
        if(place_meeting(x,y-5,objdeepwater)){
            y-=5
        }
    }
    if direction=360 or direction =0{
        if(place_meeting(x-5,y,objdeepwater)){
            x-=5
        }
    }
    if direction=180{
        if(place_meeting(x+5,y,objdeepwater)){
            x+=5
        }
    }
}
if place_meeting(x,y,objFire) or place_meeting(x,y,objWind)or place_meeting(x,y,Arrow) or place_meeting(x,y,objfirer) or place_meeting(x,y,objHammer)or place_meeting(x,y,objSwordshoot) && image_alpha=1{
    sound_play(EHit)
    HP-=2
    if direction=90{
        if(place_meeting(x,y+5,objdeepwater)){
            y+=5
        }
    }
    if direction=270{
        if(place_meeting(x,y-5,objdeepwater)){
            y-=5
        }
    }
    if direction=360 or direction =0{
        if(place_meeting(x-5,y,objdeepwater)){
            x-=5
        }
    }
    if direction=180{
        if(place_meeting(x+5,y,objdeepwater)){
            x+=5
        }
    }
    image_alpha=0.75
    alarm[1]=10
}



if place_meeting(x,y,objicer) && !stunned{
    sound_play(EHit)
    instance_create(self.x,self.y,objChink)
    stunned=1
    speed=0
    image_speed=0
    image_blend=c_blue-150
    alarm[0]=180
    alarm[2]=180
}

if place_meeting(x,y,objBoomerang) && global.boomerlvl=1 && !stunned{
    sound_play(EHit)
    instance_create(self.x,self.y,objChink)
    stunned=1
    speed=0
    image_speed=0
    image_alpha=0.8
    alarm[0]=90
    alarm[1]=90
}

if place_meeting(x,y,objBoomerang) && global.boomerlvl=2 && !stunned{
    sound_play(EHit)
    HP-=1
    instance_create(self.x,self.y,objChink)
    stunned=1
    speed=0
    image_speed=0
    image_alpha=0.7
    alarm[0]=120
    alarm[1]=120
}
if HP<=0{
   instance_change(objEDie,true)
}

execute code:

if image_index=3{
instance_create(x,y,obj_zorashot)
}

End Step Event:

execute code:

vx = 0
vw = 160
vy = 32
vh = 158

if (x< vx)
{
x=xprevious
y=yprevious
}

else if ((x+sprite_width) > vx+vw)
{
x=xprevious
y=yprevious
}

else if (y< vy)
{
x=xprevious
y=yprevious
}

else if ((y+sprite_height) > vy+vh)
{
x=xprevious
y=yprevious
}

Collision Event with object objMagic:

execute code:


    sound_play(EHit)
    HP-=2
    if direction=90{
        if(place_meeting(x,y+5,objdeepwater)){
            y+=5
        }
    }
    if direction=270{
        if(place_meeting(x,y-5,objdeepwater)){
            y-=5
        }
    }
    if direction=360 or direction=0{
        if(place_meeting(x-5,y,objdeepwater)){
            x-=5
        }
    }
    if direction=180{
        if(place_meeting(x+5,y,objdeepwater)){
            x+=5
        }
    }
    with other{instance_destroy()}


Other Event: Animation End:

execute code:

visible=false




Logged
Re: Can somone help fix this small bug in a zora
« Reply #1 on: June 28, 2011, 04:46:31 pm »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1767
Well just setting it's visibility to false will still make it collide-able. What you could try doing is giving your objHurt object a variable called state or active or something, then in your Link object's collision code check whether or not the zora is in the correct state to be hurting Link.

So basically:
Code: [Select]
// objLink Collision Check
if (other.state == 'canHurtYou')
{
    // Code for Link getting hurt.
}
else
{
    // Code for Link not getting hurt, or just skip this completely
}
Logged
  • https://colbydude.com
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.023 seconds with 39 queries.