Forum

Model position in relation to player

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Model position in relation to player

Postby vicious1988 » Sun Oct 12, 2008 10:30 pm

I'm having a slight problem. For my mod I'm wanting to have a model which stays in front of the player in the same position on screen at all times (similar to a weapon model). The code works right for the most part, but when I go to look up the model will move behind the player and when I look down it moves away.

This is my code:
Code: Select all
local   entity onscreen1

onscreen1 = find (world, classname, "h1");
setorigin (onscreen1, self.origin+v_forward*20-v_right*18.5+v_up*30);

onscreen1.angles=self.angles;
onscreen1.angles_x=self.v_angle_x-self.v_angle_x*2;

setmodel (onscreen1, "progs/test.mdl");


It also likes to bob the opposite direction the camera does. Any solutions?
User avatar
vicious1988
 
Posts: 16
Joined: Sun Oct 12, 2008 10:14 pm

Postby ceriux » Sun Oct 12, 2008 11:06 pm

you might be able to use something out of a thread i started a bit ago.

read thru this a bit, im not sure but i was being told how to do something similar in it.

viewtopic.php?t=1175
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby vicious1988 » Mon Oct 13, 2008 12:16 am

Thanks for the help, I figured it out from your thread. I forgot to add the view offset. I knew it would be something painfully obvious. Just not that painful.

Works great:
ImageImageImageImage
User avatar
vicious1988
 
Posts: 16
Joined: Sun Oct 12, 2008 10:14 pm

Postby MeTcHsteekle » Mon Oct 13, 2008 12:28 am

a health bar?

a Zelda mod :D?

/ HA HA i kicked your ass Firefox look at me post at i3d with you bwahahahahaha
bah
MeTcHsteekle
 
Posts: 399
Joined: Thu May 15, 2008 10:46 pm
Location: its a secret

Postby ceriux » Mon Oct 13, 2008 12:53 am

is that a zelda mod? i might be tempted to help you with that... i usually stray away from fan based games like that... (halo portable is my first) but just for experience sake it might be fun.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby vicious1988 » Mon Oct 13, 2008 1:06 am

I love how you can put 10 red dots in the top left corner of the screen, add a sword, and everyone instantly says "That's Zelda!"

Help's always welcome. I've already added in the sword, hookshot, bombs (need to fix the timing), heart system, and an early C-slot system w/ equip menu. It still has all the original Quake weapons too.

Only reason I'm using vanilla Quake is so it will work with Eluan's Wii port. I'm planning on probably switching from models to sprites for the display since its a little more cost effective and takes less time to modify.
User avatar
vicious1988
 
Posts: 16
Joined: Sun Oct 12, 2008 10:14 pm

Postby ceriux » Mon Oct 13, 2008 1:28 am

is it an rpg mod? ill definantly help with that!
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby MeTcHsteekle » Mon Oct 13, 2008 2:08 am

heh add gyro, a wand thing, a big map with a lot of water and BOOM "the wind waker"

oh i forgot, a red boat that talks
bah
MeTcHsteekle
 
Posts: 399
Joined: Thu May 15, 2008 10:46 pm
Location: its a secret

Postby vicious1988 » Mon Oct 13, 2008 3:27 am

Right now I'm just getting the basic systems in and operating, although Gyro does sound appealing. I'm aiming to make this very similar to the actual Zelda games, but there's that Quake element I'm oh so tempted to keep, I've already decided to keep it first person since I really don't want to make major modifications to the player model.

Wednesday I'll probably convert the heart system to sprites and work on changing the equip menu to graphical instead of centerprint. Feel free to post any ideas you have, be it weapons, items, plot, etc.
User avatar
vicious1988
 
Posts: 16
Joined: Sun Oct 12, 2008 10:14 pm

Postby Spike » Mon Oct 13, 2008 9:09 am

Its an old unfixable legacy bug in quake's sw renderer.
Alias models (that is, blah.mdl files) are drawn with their pitch inverted.
Of course, because mods use it, GL mimics it and noone can break it now.

v_angles is the 'proper' way around, but angles is upside down.

Just invert angles_x. Subtract it from 0, or multiply with -1, or something.
This also applies to the makevectors builtin. angles needs to be flipped.

Yeah, you already do that.
Mneh.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby vicious1988 » Mon Oct 13, 2008 11:20 pm

Well, I experimented earlier with switching to sprites. No success. Always too pixelated. Guess I'm stuck with models for the time being.

Anyways, I switched the item equip menu from centerprint to models.
ImageImage
Needs some texture tweaking and it will look pretty good.

By the way, is there any way to make a model have fullbright? That would make the ghetto model hud look better...hopefully.
User avatar
vicious1988
 
Posts: 16
Joined: Sun Oct 12, 2008 10:14 pm

Postby ceriux » Tue Oct 14, 2008 12:54 am

couldnt you just make a large sprite and resize it with in the engine?

also for full bright models couldnt you just apply full bright textures? use full bright colors from the pallet.)
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby vicious1988 » Tue Oct 14, 2008 1:21 am

I was looking for a function to resize sprites and/or models. Only thing I noticed was setsize which is for bounding boxes.

As for changing texture colors, the models would still be affected by lights, wouldn't they?
User avatar
vicious1988
 
Posts: 16
Joined: Sun Oct 12, 2008 10:14 pm

Postby ceriux » Tue Oct 14, 2008 1:41 am

err, i think they would cast a shadow... but what iv seen at least is if it uses a full bright color from the pallet then that color is always full bright dark or day .

actually i know it will work

wazat's conquest mod has a model with full bright colors and it looks awsome the tips of some spikes look like they have lava oozing over them and the colors that arnt full bright look black in the shadows u can barely see the weapon but the spikes glow almost. awsome effect :d
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby MeTcHsteekle » Tue Oct 14, 2008 1:52 am

.. but i think not all engines can see full brights, like the original glquake, and im pretty sure that glpro does not see them either,

but winquake, dosquake, glqrack, and darkplaces can have full brights, at least those are the ones i know have them :D
bah
MeTcHsteekle
 
Posts: 399
Joined: Thu May 15, 2008 10:46 pm
Location: its a secret

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest