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: [Request / Listing] deku baba [GM6]  (Read 1855 times)

0 Members and 1 Guest are viewing this topic.
[Request / Listing] deku baba [GM6]
« on: June 21, 2006, 05:10:21 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 448
Need help coding a deku baba. so far all I have is "if distance_to_object(objchara_link) < 4".
I need help with things like ,how you make the baba attack left if link is to the left of it.
« Last Edit: February 11, 2012, 01:42:44 pm by Niek »
Logged

pxl_moon (dotyue)

Team Dekunutz
Re: deku baba [GM6]
« Reply #1 on: June 21, 2006, 05:40:41 am »
  • .越//
  • *
  • Reputation: +5/-1
  • Offline Offline
  • Gender: Male
  • Posts: 2280
i'm not a coder but maybe something like that?

Code: [Select]
objchara_link.x -4 then { sprite_index = sprdekubaba_attack_left }
Logged

~~Resources~~
~Minish Cap Style~

Minish Cap Beta:Firerod Icon, Majoras Mask:ChuChu, Ocarina of Time:Gossip Stone, Oracle Series:Link plays the "Herpes of Ages", Impa, Wand Maker: HUD
~GB-Zelda Style~
Ocarina of Time: Deku Caca
~Other~
Paper Mario Style Zelda&Link, Tetra Trackers HUD-Cleanups

Fox

Turnbeutelvergesser since 1988.
Re: deku baba [GM6]
« Reply #2 on: June 24, 2006, 12:53:20 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Female
  • Posts: 4062
More like...
Code: [Select]
if distance_to_object(objchara_link.x)<4
{
sprite_index="sprdekubaba_attack_left"
}
And under sprite_index-stuff you might want to add the function that calls the Baba to attack.
Logged
  • Me on deviantART
Re: deku baba [GM6]
« Reply #3 on: June 24, 2006, 02:03:12 pm »
  • ^This is my sprite comments char
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 226
i think it will be easier if you are using global.dir or gloabl.face variables this:
Code: [Select]
if if distance_to_object(objchara_link.x)<4
{
if gloabl.dir="left"{
sprite_index="sprdekubaba_attack_left"
}
}
and fot the others the same but changin the x value to engative and then for up and down y instead of x so you'll have 4 pices of code.

i think this would work, but no sure
Logged



i'm working on:

I support and i'm part of the team of:
Re: deku baba [GM6]
« Reply #4 on: June 29, 2006, 10:53:34 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1141
Code: [Select]
if (distance_to_object(objchara_link) < 4 && objchara_link.x - x < -2/*Or any value between -4 and 0*/)
{
//attack on the left
}



Code: [Select]
if if distance_to_object(objchara_link.x)<4
{
if gloabl.dir="left"{
sprite_index="sprdekubaba_attack_left"
}
}
sprdekubaba_attack_left should be without the "".
« Last Edit: June 29, 2006, 10:56:46 pm by sjegtp »
Logged

Goodnight

Once and future Captain
Re: deku baba [GM6]
« Reply #5 on: June 29, 2006, 11:07:04 pm »
  • With a Capital G
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 706
Code: [Select]
if distance_to_object(objchara_link.x)<4Nerp, that function calls for an object's name, not one of its variables.

Here's what I'd suggest:
Code: [Select]
var dir;
dir=point_direction(x,y,objLink.x,objLink.y)

if distance_to_object(objLink)<16 {
    if dir>=315 || dir<45 {
        sprite_index=(attacking right)
    } else if dir>=45 && dir<135 {
        sprite_index=(attacking up)
    } else if dir>=135 && dir<225 {
        sprite_index=(attacking left)
    } else {
        sprite_index=(attacking down)
    }
} else {
    sprite_index=(not attacking)
}

First that makes a new variable called dir, which is the angle from the Deku Baba to Link (0 to 360 degrees).

If the Link object is within 16 pixels (you might even want to make that higher, like around 40), then check which range the angle falls into, and set the corresponding sprite.
Logged
Re: deku baba [GM6]
« Reply #6 on: July 01, 2006, 01:20:40 pm »
  • ^This is my sprite comments char
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 226
prety cool
Logged



i'm working on:

I support and i'm part of the team of:

moree

Bizon-Ent.com
Re: deku baba [GM6]
« Reply #7 on: July 12, 2006, 02:40:44 pm »
  • N/A
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 309
Need help coding a deku baba. so far all I have is "if distance_to_object(objchara_link) < 4".
I need help with things like ,how you make the baba attack left if link is to the left of it.

O so manny thanx!!, I didn't know the code"if distance_to_object()"
It's realy helpfill thanx!
Logged
Pages: [1]   Go Up

 


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



Page created in 0.041 seconds with 54 queries.