Be a Supporter!

sword trail

  • 2,211 Views
  • 11 Replies
New Topic Respond to this Topic
funbie
funbie
  • Member since: Feb. 3, 2008
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
sword trail 2009-05-09 18:52:38 Reply

ok so, im making a movie, and i have this sword in it. in yoyo vs FLLFFL in the credits it says sword trail script by such n such. does anyone know that script?

Slipstreamer
Slipstreamer
  • Member since: Dec. 5, 2006
  • Offline.
Forum Stats
Member
Level 21
Audiophile
Response to sword trail 2009-05-09 18:53:30 Reply

Stupid question, make stuff yourself, don't rip off other people.
I'd answer you if you were asking how to make a sword trail.


Certified audiophreak, lv 60.

BBS Signature
funbie
funbie
  • Member since: Feb. 3, 2008
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to sword trail 2009-05-09 18:58:13 Reply

i tried to make a sword trail script. i also tried making a sword trail. both failed. i'm sorry but this is all i've got left. please i need that script. im not asking you personally just anyone who knows it or knows how to make a script that would work.

Doomsday-One
Doomsday-One
  • Member since: Oct. 28, 2005
  • Offline.
Forum Stats
Member
Level 10
Programmer
Response to sword trail 2009-05-09 19:55:29 Reply

Specify what you're after. What exactly does the trail look like?

Anyway, I made this in a few minutes:

Since you're not a programmer, I won't insist on explaining it to you
if (_parent.stopper != true) {
	var numofoldobjects:Number = 2;
	var alphabits:Number = 100/(numofoldobjects+1);
	var oldarray:Array = new Array();
	for (i=0; i<numofoldobjects; i++) {
		oldarray.push(i);
	}
	_parent.stopper = true;
	onEnterFrame = function () {
		this.duplicateMovieClip("oldsword"+oldarray[0], oldarray[0]);
		with (_parent["oldsword"+oldarray[0]]) {
			_x = oldx;
			_y = oldy;
			_rotation = oldrotation;
		}
		oldx = this._x;
		oldy = this._y;
		oldrotation = this._rotation;
		for (i=0; i<oldarray.length; i++) {
			_parent["oldsword"+oldarray[i]]._alpha = 100-alphabits*(i+1);
		}
		nextnum = oldarray.pop();
		oldarray.unshift(nextnum);
	};
}

Put that on the ONLY frame in the timeline of whatever you want to create a trail for.
You can change the numofoldobjects value if you want to; that will increase or decrease the number of trail things you'll have.


Doomsday-One, working on stuff better than preloaders. Marginally.

funbie
funbie
  • Member since: Feb. 3, 2008
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Response to sword trail 2009-05-09 20:28:02 Reply

sweet, thanks soo much! basicy what i was after was whenever i moved this one simbol it would leave a trail, kinda how like in video games when you swing a sword it leaves a little trail. so with this code what do i do exactly?

Doomsday-One
Doomsday-One
  • Member since: Oct. 28, 2005
  • Offline.
Forum Stats
Member
Level 10
Programmer
Response to sword trail 2009-05-09 22:23:57 Reply

Examples:
Normal
At 1fps
.fla file

I've made some changes to the code (it now works on multiple objects, and the alpha is better).
Oh, and set your AS language to 2.0 to make it work (In Publish Settings).
The code should be placed on the timeline of the object you want to have this effect for. Double click on one of my movieclips, and you'll see an 'a' on the keyframe I put the code on. Then open the actions panel (F9), and put the code there.

// Code by Doomsday-One, because I'm awesome =]
if (this.getDepth()<0) {
	var numofoldobjects:Number = 5;
	// You can change the above number to change how much the object trails
	if (_root.depth == undefined) {
		_root.depth = 0;
	}
	mindepth = _root.depth;
	_root.depth += numofoldobjects;
	var alphabits:Number = 50/(numofoldobjects+1);
	var oldarray:Array = new Array();
	for (i=0; i<numofoldobjects; i++) {
		oldarray.push(i);
	}
	oldx = this._x;
	oldy = this._y;
	oldrotation = this._rotation;
	onEnterFrame = function () {
		this.duplicateMovieClip("oldsword"+oldarray[0]+mindepth, oldarray[0]+mindepth);
		with (_parent["oldsword"+oldarray[0]+mindepth]) {
			_x = oldx;
			_y = oldy;
			_rotation = oldrotation;
		}
		oldx = this._x;
		oldy = this._y;
		oldrotation = this._rotation;
		for (i=0; i<oldarray.length; i++) {
			_parent["oldsword"+oldarray[i]+mindepth]._alpha = 50-alphabits*(i+1);
		}
		nextnum = oldarray.pop();
		oldarray.unshift(nextnum);
	};
}

Have fun with it!

And I hope that's what you're after

Oh, and you can change the '50's too (between 0 and 100), and that will effect how see-through the objects are.


Doomsday-One, working on stuff better than preloaders. Marginally.

matthewrobo
matthewrobo
  • Member since: May. 26, 2009
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to sword trail 2009-06-10 04:38:09 Reply

I have a flash file here! I can't give u the script, only the flash file.
(P.S.: it only works on actionscript 1.)
http://up2share.com/file/33mqufznm2r632_
Sword_and_Yoyo_test.fla

Bum-Secks
Bum-Secks
  • Member since: Oct. 12, 2005
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to sword trail 2009-06-10 09:48:18 Reply

did you mean something like this? http://spamtheweb.com/ul/upload/3808/539 07_sword.php

vml
vml
  • Member since: Dec. 29, 2011
  • Offline.
Forum Stats
Member
Level 05
Artist
Response to sword trail 2012-02-13 08:33:17 Reply

hey when I put the animation it says: Error: Unable to perform action 'with' because the object does not exist. what can I do?


Grey Must Die (Join Now!)

BBS Signature
RubberSocks
RubberSocks
  • Member since: Feb. 15, 2012
  • Offline.
Forum Stats
Member
Level 03
Animator
Response to sword trail 2012-02-15 22:14:35 Reply

At 2 days ago, vml wrote: hey when I put the animation it says: Error: Unable to perform action 'with' because the object does not exist. what can I do?

you dont


BBS Signature
Sam
Sam
  • Member since: Oct. 1, 2005
  • Offline.
Forum Stats
Moderator
Level 19
Programmer
Response to sword trail 2012-02-16 03:35:41 Reply

At 2 days ago, vml wrote: hey when I put the animation it says: Error: Unable to perform action 'with' because the object does not exist. what can I do?

You managed to bring a thread back from the dead - surely you can manage to use this script.

Wolfos
Wolfos
  • Member since: Jan. 19, 2008
  • Offline.
Forum Stats
Member
Level 25
Game Developer
Response to sword trail 2012-02-16 06:53:47 Reply

At 2 days ago, vml wrote: hey when I put the animation it says: Error: Unable to perform action 'with' because the object does not exist. what can I do?

Learn to program instead of just copying code. It will not teach you anything.