Be a Supporter!

more than 1 vcam

  • 430 Views
  • 10 Replies
New Topic Respond to this Topic
kris008
kris008
  • Member since: May. 11, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
more than 1 vcam 2009-01-28 15:52:26 Reply

is it possible to have more than 1 vcam on at once? im trying to get 2 vcams to follow 2 diff people...each cam taking half the screen....but i cant figure it out only 1 vcam works at a time.

kris008
kris008
  • Member since: May. 11, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to more than 1 vcam 2009-01-28 15:53:59 Reply

sorry, heres the vcam im using. this is for the 2nd player.

onClipEvent (enterFrame)
{
function camControl()
{
parentColor.setTransform(camColor.getTra nsform());
var _loc4 = sX / this._width;
var _loc3 = sY / this._height;
_parent._x = cX - this._x * _loc4;
_parent._y = cY - this._y * _loc3;
_parent._xscale = 100 * _loc4;
_parent._yscale = 100 * _loc3;
} // End of the function
function resetStage()
{
var _loc2 = {ra: 100, rb: 0, ga: 100, gb: 0, ba: 100, bb: 0, aa: 100, ab: 0};
parentColor.setTransform(_loc2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
} // End of the function
this._x = (_root.player2._x)
this._y = (_root.player2._y)
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = Stage.width / 2;
var cY = Stage.height / 2;
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
camControl();
this.onUnload = resetStage;
}

kris008
kris008
  • Member since: May. 11, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to more than 1 vcam 2009-01-28 17:17:41 Reply

its been over an hour and not a single reply :l
ive tried playing with the numbers but to no success

Hoeloe
Hoeloe
  • Member since: Apr. 29, 2004
  • Offline.
Forum Stats
Member
Level 37
Game Developer
Response to more than 1 vcam 2009-01-28 17:18:44 Reply

Only one works because V-Cams effectively move _root. around. You are trying to move _root. twice and thus breaking the laws of physics and all logic.


Song of the Firefly is on Steam Greenlight and Kickstarter. Give them a look and support the project!
------------------------------

BBS Signature
kris008
kris008
  • Member since: May. 11, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to more than 1 vcam 2009-01-28 17:22:40 Reply

At 1/28/09 05:19 PM, Greth-of-destruction wrote:
At 1/28/09 05:17 PM, kris008 wrote: its been over an hour and not a single reply :l
ive tried playing with the numbers but to no success
Do you have two vcam movieclips?

-GOD

yes 2 vcam movie clips on 2 different layers 1 called vcam 1 called vcam2

kris008
kris008
  • Member since: May. 11, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to more than 1 vcam 2009-01-28 17:24:16 Reply

At 1/28/09 05:18 PM, Hoeloe wrote: Only one works because V-Cams effectively move _root. around. You are trying to move _root. twice and thus breaking the laws of physics and all logic.

oh :( is there any other way to do it?

Rudy
Rudy
  • Member since: Jan. 1, 2005
  • Offline.
Forum Stats
Member
Level 18
Blank Slate
Response to more than 1 vcam 2009-01-28 17:26:30 Reply

At 1/28/09 05:22 PM, kris008 wrote: yes 2 vcam movie clips on 2 different layers 1 called vcam 1 called vcam2

That's not possible to do your task. You COULD do it probably if you put it in two seperate movie clips and mask it. That's what I did, and the V-Cam worked within the masked movie clip, and move areas in that only -- but you'll have to put your one guy in one movie clip with the v-cam, and mask that -- and than do the same with the other dude, and place them both on the screen at the same time. It's really hard to do, because when you have a V-cam it moves around the whole SCREEN, the whole screens dimensions are zoomed in with that cam. When you mask it and movie clip it, it'll just move around that little area, and you can have two dimensions.

I did it once before.. I just forget how I did it. So if I didn't help... Meh, I apologize.


BBS Signature
kris008
kris008
  • Member since: May. 11, 2007
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to more than 1 vcam 2009-01-28 17:31:22 Reply

At 1/28/09 05:26 PM, Rudy wrote:
At 1/28/09 05:22 PM, kris008 wrote: yes 2 vcam movie clips on 2 different layers 1 called vcam 1 called vcam2
That's not possible to do your task. You COULD do it probably if you put it in two seperate movie clips and mask it. That's what I did, and the V-Cam worked within the masked movie clip, and move areas in that only -- but you'll have to put your one guy in one movie clip with the v-cam, and mask that -- and than do the same with the other dude, and place them both on the screen at the same time. It's really hard to do, because when you have a V-cam it moves around the whole SCREEN, the whole screens dimensions are zoomed in with that cam. When you mask it and movie clip it, it'll just move around that little area, and you can have two dimensions.

I did it once before.. I just forget how I did it. So if I didn't help... Meh, I apologize.

well that would be a BIG problem concidering i also have a 4 player mode..i'll just have to stick to the way i already have it :l which isnt the best as its 1 cam which finds the centre point of all 4 players.

echeese
echeese
  • Member since: Mar. 17, 2005
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to more than 1 vcam 2009-01-29 09:49:12 Reply

What you could do is instead of using a vcam, draw the game onto half of a bitmapdata and then draw the other half on.


This is my new site: ryanspeets.com

Madnessdude67
Madnessdude67
  • Member since: Oct. 28, 2007
  • Offline.
Forum Stats
Member
Level 06
Blank Slate
Response to more than 1 vcam 2009-01-29 10:10:34 Reply

I know nothing about AS but is it possible that you could actually put two drawings of two cameras into one movieclip and then AS each to follow one guy?
If not then the only thing I can say is make it an online game.

echeese
echeese
  • Member since: Mar. 17, 2005
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to more than 1 vcam 2009-01-29 10:14:26 Reply

At 1/29/09 10:10 AM, Madnessdude67 wrote: If not then the only thing I can say is make it an online game.

You realize that would be much more difficult, right?


This is my new site: ryanspeets.com