Nifty camera trick ;)
Displaying 1-6 of 6 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
ashground

Just thought I'd share a nifty little trick that I learnt back in the days of V2.01...

PsychoCamera=Entity(55*16,39*16, 'Melf.chr')
PsychoCamera.visible=0
PsychoCamera.Chase(player, 50)
AttachCamera(PsychoCamera)

There are, however, three problems with this right now--

1) AttachCamera doesn't work.

2) The camera is an obstruction. Which means you can run into an invisible wall. Which is a bad thing, I guess.

3) The camera is obstructable. Meaning it can get stuck on other entities or the other side of walls, letting the player run offscreen.

Any solutions?



Posted on 2001-08-17 03:59:07

ShadowDrak

You could control the camera manually.
increment xwin and ywin in a similar way based on chr.x and chr.y
It would take a bit of expirimenting to look good.
Youd make it increment/decrement faster if it was farther away.
it would be like a rubber band with a floating camera attached to it.

-ShadowDrak



Posted on 2001-08-17 10:04:02

invicticide

I have no experience in Python, but I'll give my two cents anyway cuz that's all I'm worth right now :)

Doesn't the entity class (or whatever the hell it is) have the 'isob' and 'canob' options, in some form or another? i.e....

PsychoCamera.isob=0
PsychoCamera.canob=0

If so, that takes care of the camera situation. Or you could create an entity in MapEd that's unobstructed/unobstructable, and assign PsychoCamera that entity's index (if you can do _that_ in v2.7 yet... I hate not having a computer!)

As for AttachCamera, the only way I can think to fix that is a complicated and processor-hogging workaround:

Create a 'camera handler' function and hook it to the retrace. Assign PsychoCamera to an entity and set that entity to chase the player as you have. Then, in the handler, you set 'player' to 'PsychoCamera' and then process entities, then reset 'player' to the original entity.

Over many iterations of hookretrace I _think_ this might achieve the effect, unless resetting the player clears the chase data :/ Of course, I can't test it since my comp is fried.

Whew, that's my thought. Cool idea, BTW!

That is all.

--Invicticide




We don't need better engines, we need better creation tools!

Posted on 2001-08-17 11:07:10

invicticide

If you set the player to the PsychoCamera entity, the entity won't _necessarily_ move according to the chase, but rather, the player controls. Say the player is moving left... then all of a sudden in the hookretrace he's not moving _his_ entity left, he's moving the _camera_ left, and back and forth.

That seems like it might be a little jittery, though... But the camera would follow the player even at a diagonal angle, rather than chasing him on tiles!

Let me know what you find out... now I'm curious!

That is all. (For real this time!)

--Invicticide




We don't need better engines, we need better creation tools!

Posted on 2001-08-17 11:10:29

-zaril-

It becomes messy. Firstly, if you can walk close to the borders of the map you get the lovely SMUDGE(tm) where no map exists. Also, you have to place the character in the middle of the map all the time in order to keep a reasonable camera targeting, unless you make it reset to the character by script or the like. Why attach the camera to a chasing entity and not the player? o_o .. For the effect that the camera is moving afterwards?



zaril@hellven.org - ICQ 7698022

Posted on 2001-08-20 10:09:39

ShadowDrak

Actually it could be done by a couple of commands in a hook.
here's some pseudo c to show you

void PsychoCamera()
{
xwin+=(entity.x-xwin)/4
ywin+=(entity.y-ywin)/4
}

the only thing it could use is some tweaking and some timing code. You could also at a limiter so that it would only get a certain distance away and then stay there. if you don't add that, the camera will always be in perpetual motion(theoretically speaking).
and if you do it thins way you won't run into nasty entity problems like obstructions. I don't know what you're refferring to when you say smudge but i assume this can be solved by making bigger maps and not letting your characters reach the edge.
I don't see why placement in the middle of the map would be neccesary... but that may be because i haven't actually tested this.

-ShadowDrak




Posted on 2001-08-21 17:06:49


Displaying 1-6 of 6 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.