Gamestudio Links
Zorro Links
Newest Posts
Max Number of Strategies in /Strategy folder
by Martin_HH. 06/17/26 07:16
Z9 getting Error 058
by jcl. 06/16/26 09:51
How to select between IB accounts by script?
by AndrewAMD. 06/13/26 15:44
Zorro tutorial ideas?
by AndrewAMD. 06/13/26 15:01
Zorro 3.01 recoded MMI function issue
by 11honza11. 06/13/26 11:40
Stooq now requires an API key
by AndrewAMD. 06/11/26 17:55
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (vince, Grant), 3,724 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Student_64151, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: [REQ[ How to smoothly turn a camera to a target? [Re: exile] #394346
02/12/12 10:17
02/12/12 10:17
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Hmmm, not sure, and too busy to test ATM, and I know it sounds odd,
but try adding the following lines to both functions BEFORE the 'vec_lerp(camera.pan...)'s.
Code:
...
camera.pan  = ang(camera.pan +360);
camera.tilt = ang(camera.tilt+360);
camera.roll = ang(camera.roll+360);
//
target_ang.pan  = ang(target_ang.pan +360);
target_ang.tilt = ang(target_ang.tilt+360);
target_ang.roll = ang(target_ang.roll+360);
...
vec_lerp(camera.pan, ...



BTW, not sure if the '+360' is necessary for you...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: [REQ[ How to smoothly turn a camera to a target? [Re: EvilSOB] #394391
02/12/12 19:48
02/12/12 19:48
Joined: Apr 2005
Posts: 796
U.S.A. Michigan
exile Offline OP
User
exile  Offline OP
User

Joined: Apr 2005
Posts: 796
U.S.A. Michigan
Figured it out EvilSOB, thanks again for all of your help. I have one more small problem and I promise I'll go away. I figured I may as well ask here least I open up another thread lol.

In short, I want to use an HLSL Multitexturing shader along with my cel shader. How can I combine the two? I am still kind of new to shaders, so please speak slow hahaha.

Re: [REQ[ How to smoothly turn a camera to a target? [Re: exile] #394419
02/13/12 01:23
02/13/12 01:23
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Well, I aint much of a shader-guru, and Ive never played with cel-shaders,

but to my understanding when combining shaders you need to combine the two

into a single FX file as a single 'multi-stage' shader.


If you post both shaders (and any lite-c code needed) here (or PM me), I will take a look...

But I cant guarantee I'll succeed...



(the line spacing of this post is me speaking slow... laugh )


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: [REQ[ How to smoothly turn a camera to a target? [Re: EvilSOB] #394430
02/13/12 09:07
02/13/12 09:07
Joined: Apr 2005
Posts: 796
U.S.A. Michigan
exile Offline OP
User
exile  Offline OP
User

Joined: Apr 2005
Posts: 796
U.S.A. Michigan
Ok, thanks again Evil, I'll give it a try first to see what I can do, then I'll let you know how it turns out.

EDIT: Got it working, but now I have yet another problem. And I swear I'll go away for sure this time wink

My question is, are there any other ways of decreasing a health bar without having to scale it? I tried making it in a window as well but what the system does is just move the health bar panel itself. Thats not what im trying to achieve. What I am trying to achieve is having the health bar stay stationary while having the overall picture clipped away as the assigned variable changes. The best way to explain this is with a picture lol.



Essentially, this is what im trying to do. Is there any way to do this? If so how would one go about doing it? I dont need a fully functioning code or anything, just somewhere to start laugh

Last edited by exile; 02/13/12 12:51.
Re: [REQ[ How to smoothly turn a camera to a target? [Re: exile] #394466
02/13/12 15:27
02/13/12 15:27
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
window should be the correct approach here, maybe you have changed the wrong parameters? Alternatively, you can make the health bar a separate panel and reduce size_x to clip the panel.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: [REQ[ How to smoothly turn a camera to a target? [Re: Superku] #394505
02/13/12 21:56
02/13/12 21:56
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
I think I see what you want, and SuperKu's idea is valid,
but it is 'another' panel, if your health panel contains multiple elements already.

But if it is the only element in the health-panel it should work well.
But REMEMBER ... adjust the size_x value of the panel AFTER assigning the bmap.
And change the 'size_x' property of the panel, and NOT 'scale_x'.
Then it should work as you wish...


But if the health-bar is just one element of many on the same panel, try this.
You could (in theory) 'bastardize' the window element to do what you want.
Lets assume the parameter names as follows.
"pan_setwindow(pan,idx, X,Y, size_x,size_y, bmap, val_x, val_y);"

Instead of adjusting the value of 'val_x' as you normally would with a window,
we will give val_x and val_y fixed values ... somehow. Not sure of the syntax.
(you may need to create dummy variables for this, or NULL may work, depending on 'bmap' design)

Then to get the healthbar to 'shorten' as you require, we call pan_setwindow
and reduce its 'size_x' parameter. All other parameters stay fixed as are.


Ive never tried this, but I think the theory is sound...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: [REQ[ How to smoothly turn a camera to a target? [Re: EvilSOB] #394510
02/13/12 23:31
02/13/12 23:31
Joined: Apr 2005
Posts: 796
U.S.A. Michigan
exile Offline OP
User
exile  Offline OP
User

Joined: Apr 2005
Posts: 796
U.S.A. Michigan
Ok I think I get what youre talking about, so just adjust the panels size_x during runtime. Right now, I have the health panel as an element in another panel. My health bar would have to decrease from left to right, so I assume i'll have to do something like...

healthBar.size_x = barSizeVar*((player.currentHp/player.maxHp)*100)/-100;

Re: [REQ[ How to smoothly turn a camera to a target? [Re: exile] #394516
02/14/12 00:17
02/14/12 00:17
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Err ... I dunno...

Your maths looks right but maybe more complex than it needs...


Firstly, the maths...
I would say it this way...

healthBar.size_x = healthBar.bmap.width/player.maxHp*player.currentHp;


Secondly, the positioning...
Is it left-to-right or right-to-left? You SAY left-to-right but your image
suggests different. Or it could just be the way Im interpreting what you say...

If the LEFT end of the bar is fixed in place regardless of health, then all is cool.
(I call this left-to-right... but thats MY way of thinking)

But if the RIGHT end is fixed, them you will also need to move the whole bar across
to make the bar appear fixed at the right.
If this is the case, follow the 'size_x = ' code with something like this...

healthBar.pos_x = ??? + (healthBar.bmap.width - healthBar.size_x);
(where ??? is the pos_x value when bar is full... ie: its left-most end)


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: [REQ[ How to smoothly turn a camera to a target? [Re: EvilSOB] #394528
02/14/12 02:21
02/14/12 02:21
Joined: Apr 2005
Posts: 796
U.S.A. Michigan
exile Offline OP
User
exile  Offline OP
User

Joined: Apr 2005
Posts: 796
U.S.A. Michigan
Oh no...

Yea the image I had posted was just an example. I would be doing it like your second statement (health bar being positioned on the right). That sounds a lot harder, and changing the gui around would mess up my overall design...



Note, the game in the background isnt mine, but mine has the exact same art style. Im pretty much using it for placeholder. The gui is mine though.

Last edited by exile; 02/14/12 02:22.
Re: [REQ[ How to smoothly turn a camera to a target? [Re: exile] #394533
02/14/12 03:37
02/14/12 03:37
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
OK then, you want to be ... difficult ... laugh

Ive got a couple of ideas.

Idea #1> See the 'background' that gets exposed as the health dwindles?
Make that the 'animated' panel at a higher layer value than the blue.
So when your health is 100%, the panel is at "size_x=0;".
And as you lose health, the bar gets bigger (from the left)
covering up the blue with the background. Making it APPEAR the blue is shrinking.
This I feel is the best of the two ideas.

Idea #2> Keep the blue-health permanently displayed at full size, but as
your health goes down, update the pixels of the blue bmap and set the
'lost' health pixels to "alpha=1;". (not to zero as you would expect, cause
now we can turn them back on later by only re-generating pixels with alpha=1)
This idea is ugly and slow, with some wicked maths involved. But possible.


Other than that, I cant think of anything 'reasonable' that can achieve the look you want.
By NOT reasonable I mean something like making the healthbar blue on a hidden panel,
capturing its render target, and 'flipping' it left-to-right, and bit_blit'ing
it into the status panel... THATS un-reasonable, but would work...

But who knows.... someone else may have an idea I havent thought of...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 2 of 3 1 2 3

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1