Forum Topic: 2Questions

(247 views • 16 replies)

This topic is 1 page long.

<< < > >>
None

Re2deemer

Reply To Post Reply & Quote

Posted at: 6/22/06 02:49 PM

Re2deemer LIGHT LEVEL 10

Sign-Up: 11/03/05

Posts: 792

onClipEvent (enterFrame) {
if (this.hitTest(_root.Scorpion)) {
_root.victim.Play();
}
}

Thats the code on victim. If the Scorpion hits it then it stays idle instead of playing an animation of its second frame. How come?


None

Jonone

Reply To Post Reply & Quote

Posted at: 6/22/06 02:53 PM

Jonone EVIL LEVEL 02

Sign-Up: 06/21/06

Posts: 73

At 6/22/06 02:49 PM, Re2deemer wrote: onClipEvent (enterFrame) {
if (this.hitTest(_root.Scorpion)) {
_root.victim.Play();
}
}

Thats the code on victim. If the Scorpion hits it then it stays idle instead of playing an animation of its second frame. How come?

Wouldn't know, double-checked your instance names?

try changing _root.victim. to just this.

Also, it is obvious you can count well.


None

PBM

Reply To Post Reply & Quote

Posted at: 6/22/06 02:56 PM

PBM NEUTRAL LEVEL 20

Sign-Up: 03/24/00

Posts: 615

Like he said..try:
onClipEvent (enterFrame) {
if (this.hitTest(_root.Scorpion)) {
this.Play();
}
}

does that work?


None

Re2deemer

Reply To Post Reply & Quote

Posted at: 6/22/06 03:01 PM

Re2deemer LIGHT LEVEL 10

Sign-Up: 11/03/05

Posts: 792

nope...I'm getting confused already. There has to be a mistake, but I can't freakin find it...


None

reality-check7

Reply To Post Reply & Quote

Posted at: 6/22/06 03:02 PM

reality-check7 NEUTRAL LEVEL 01

Sign-Up: 11/30/05

Posts: 1,281

At 6/22/06 02:49 PM, Re2deemer wrote: onClipEvent (enterFrame) {
if (this.hitTest(_root.Scorpion)) {
_root.victim.Play();
}
}

Thats the code on victim. If the Scorpion hits it then it stays idle instead of playing an animation of its second frame. How come?

If the animation is on a movie clip on the second frame, change the play to a gotoAndStop(2).


None

Re2deemer

Reply To Post Reply & Quote

Posted at: 6/22/06 03:03 PM

Re2deemer LIGHT LEVEL 10

Sign-Up: 11/03/05

Posts: 792

Ok....I replaced the Play() with gotoAndStop() and it worked :D


None

Re2deemer

Reply To Post Reply & Quote

Posted at: 6/23/06 07:44 AM

Re2deemer LIGHT LEVEL 10

Sign-Up: 11/03/05

Posts: 792

Oh yeah...almost forgot hte second question...

Hoq can I make so, that on MC follows another, so that they have exactly same x and y all the time


None

reelbigcheese

Reply To Post Reply & Quote

Posted at: 6/23/06 07:47 AM

reelbigcheese LIGHT LEVEL 18

Sign-Up: 08/12/05

Posts: 2,160

At 6/23/06 07:44 AM, Re2deemer wrote: Oh yeah...almost forgot hte second question...

Hoq can I make so, that on MC follows another, so that they have exactly same x and y all the time

onClipEvent(enterFrame){
this._x=_root.thing._x
this._y=_root.thing._y;
}

exactly the same x and y.

yey?


None

Re2deemer

Reply To Post Reply & Quote

Posted at: 6/23/06 09:54 AM

Re2deemer LIGHT LEVEL 10

Sign-Up: 11/03/05

Posts: 792

no dice... I want camFrame to follow Manta
I don't know why but applying this code to camFrame and replaceing thing with Manta didnät work


None

FluffyKittens

Reply To Post Reply & Quote

Posted at: 6/23/06 09:56 AM

FluffyKittens LIGHT LEVEL 03

Sign-Up: 06/21/06

Posts: 57

The first code didn't work because AS is case sensitive. I'm suprised that none of these other pro scripters picked up on that. It's play(), not Play(). As for the second one, RBC's should work fine.


None

reelbigcheese

Reply To Post Reply & Quote

Posted at: 6/23/06 09:58 AM

reelbigcheese LIGHT LEVEL 18

Sign-Up: 08/12/05

Posts: 2,160

At 6/23/06 09:54 AM, Re2deemer wrote: no dice... I want camFrame to follow Manta
I don't know why but applying this code to camFrame and replaceing thing with Manta didnät work

dont know why?! you may be doing something wrong. put this on cam frame and see if it works. by the way does "Manta" have a capital letter? ill put it without but remember capitals matter. so change it if it does.

onClipEvent(enterFrame){
this._x=_root.manta._x
this._y=_root.manta._y;
}


None

Re2deemer

Reply To Post Reply & Quote

Posted at: 6/23/06 10:09 AM

Re2deemer LIGHT LEVEL 10

Sign-Up: 11/03/05

Posts: 792

yeah, it was my bad...I forgot to give the Manta an instance name. Worked perfectly, thx!!!

BTW, Manta is with a capital letter, because it is an hover vehicle from UT2004.


None

FluffyKittens

Reply To Post Reply & Quote

Posted at: 6/23/06 10:14 AM

FluffyKittens LIGHT LEVEL 03

Sign-Up: 06/21/06

Posts: 57

At 6/23/06 10:09 AM, Re2deemer wrote: yeah, it was my bad...I forgot to give the Manta an instance name. Worked perfectly, thx!!!

BTW, Manta is with a capital letter, because it is an hover vehicle from UT2004.

It's considered bad form to start names with capitals in scripting :P


None

MadGiraffe

Reply To Post Reply & Quote

Posted at: 6/23/06 10:15 AM

MadGiraffe NEUTRAL LEVEL 10

Sign-Up: 01/07/05

Posts: 1,350

At 6/23/06 10:09 AM, Re2deemer wrote: BTW, Manta is with a capital letter, because it is an hover vehicle from UT2004.

That's a bad reason, because script doesn't ammend by such reasons. It's easier to just do everything lowcase.


None

Re2deemer

Reply To Post Reply & Quote

Posted at: 6/23/06 10:46 AM

Re2deemer LIGHT LEVEL 10

Sign-Up: 11/03/05

Posts: 792

what the hell???
why does it matter to you if manta is written with a capital letter?


None

MadGiraffe

Reply To Post Reply & Quote

Posted at: 6/23/06 10:57 AM

MadGiraffe NEUTRAL LEVEL 10

Sign-Up: 01/07/05

Posts: 1,350

At 6/23/06 10:46 AM, Re2deemer wrote: what the hell???
why does it matter to you if manta is written with a capital letter?

Well not to me, I'm just trying to help here. In before you get a large flash with hundreds of lines of codes.
You'll thank me for having everything easily typable, because one mistake in the caps (which is very easily made), and you'll get confused big time and irritated to search trough all of the code.


None

Ruzhyo

Reply To Post Reply & Quote

Posted at: 6/23/06 10:58 AM

Ruzhyo LIGHT LEVEL 08

Sign-Up: 09/29/04

Posts: 157

Its not necessarily a bad thing, it's just not a generally good idea, since if you forget something is capitalized, you could end up wasting a long time trying to figure out what is wrong with your code. Experienced scriptors keep everything lowercase.


All times are Eastern Standard Time (GMT -5) | Current Time: 08:05 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!