Inside3D!
     

How do I have the engine know when I do something in qc?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming
View previous topic :: View next topic  
Author Message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Fri Jul 09, 2010 10:54 pm    Post subject: Reply with quote

Mexicouger wrote:
Well I couldn't find an inbetween size. It was either 3 is greater than 0, or player hull was less than 32. That means:

0 hull: 0-2

player: 3-32

Monsters: 32^

So there is no spot for a flipping ball size... So I was stuck....


No what I mean is the way you are trying to do this is so not close to what you need to be doing that the word "wrong" doesn't even adequately describe it.

You started asking about drawing an sbar item. And doing a stuffcmd from the server to the client would work just fine.

And now you are trying to apply it to the server. And you can't.

Quake has a client side and a server side. There can up to 16 clients connected so consider for a moment that there are 2 clients connected, when you are trying to have cl_mball pick the hull is that going to be for player 1 or player 2 or player 16?

I suggested the name of "cl_mball" where the "cl_" stands for client.

Ok, first of all ... have you added a field called something like .mball in defs.qc? In QuakeC you will need a field like that keep track of what state each of the 16 potential clients is in.

This "cl_mball" picking the hull thing ... you need to have that kind of thing in QuakeC. Don't think engine at all for game logic, hull selection ... QuakeC handles the game logic.

You can have sbar.c read a stuffcmd to know what it is supposed to display on the HUD. But maybe even better, when you are ball you can't fire right (I don't recall in Metroid prime being able to fire as a ball)? A more proper way to do this is having the "ball" state be a specific weapon, like 0. Then you won't need to even stuffcmd a cvar (nor add a field to defs.qc).

The next time I have time, which might be a day or 2 I'll give you some more specifics of how you might achieve this.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Fri Jul 09, 2010 11:14 pm    Post subject: Reply with quote

For starters, list all the weapons a player is going to have available (and describe them).

I'll show you how you can set this up in the QuakeC and in sbar.c in the engine.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
Mexicouger



Joined: 01 May 2010
Posts: 129

PostPosted: Fri Jul 09, 2010 11:23 pm    Post subject: Reply with quote

Erm.. Why do you want me to list the weapons... That has nothing to do with making the game know when I am in ball form. I just want to know what size to spesify in world.c. That is all. And I think Coding the ball in as a weapon would be better too. I have been pondering it for a while now. The current ball system is completely rigged. In almost every function there is this line of code:

if (self.mballtoggle == 1)
return;

It would just be easier to code it in otherwise... But I will explain each weapon for whatever benefit you have in mind.

Code:
Blaster: Normal,casual weapon. Start out with this. It can charge.

Rocket launcher: A rocket is shot that explodes on contact.

Splaser: Purple beam that bounces off anything that can take damage.

sniper: Long range weapon. Can get headshots.

Magma beam: Shoots a molten lava rock that Bounces off walls and explodes. If charged, it burns the other player.

Lazer beam: it shoots a long lazer beam. low ammo.

Hyperbeam: A super weapon. Has to be charged

Morphball: The ball form of the player.


Some of these weapons haven't been coded yet. But they will. I have others in mind that Are iffy. So now go on with your purpose?
_________________
Gosh... debby ryan Is hot. I swear I will mary her...

My project Prime for psp:

http://www.moddb.com/games/primepsp1

We have a website, But are getting a new one.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Sat Jul 10, 2010 12:38 am    Post subject: Reply with quote

Modify this in defs.qc

Code:
// items
float   IT_AXE               = 4096;
float   IT_SHOTGUN            = 1;
float   IT_SUPER_SHOTGUN      = 2;
float   IT_NAILGUN            = 4;
float   IT_SUPER_NAILGUN      = 8;
float   IT_GRENADE_LAUNCHER      = 16;
float   IT_ROCKET_LAUNCHER      = 32;
float   IT_LIGHTNING         = 64;
float   IT_EXTRA_WEAPON         = 128;


To something like this ...

Code:

float   IT_MBALL               = 4096;
float   IT_BLASTER            = 1;
float   IT_ROCKET_LAUNCHER      = 2;
float   IT_SPLASER            = 4;
float   IT_SNIPER      = 8;
float   IT_MAGNABEAM      = 16;
float   IT_LASER      = 32;
float   IT_HYPERBEAM         = 64;
float   IT_EXTRA_WEAPON         = 128;


You can remove the mball field from defs.qc, from this point forward in the QuakeC you can test to see if the player is the morphball by seeing if what was formerly the axe is the currently selected weapon.

Likewise, change the weapon constants in the engine in quakedef.h

Now in cl_sbar.c you can simply check what the current weapon is an if it is IT_MBALL then you draw the sbar however you have you want it. There is no longer a need for a stuffcmd, your engine will handle this "naturally".

As for the hull stuff, when you are switching to the morphball you will need to use QuakeC to set the current hull. I don't have the QuakeC (in particular the Quake-Life) source conveniently available to see what it does when you crouch, but it is about the same thing.

Follow those and all your above issues should be solved or near solved.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
Mexicouger



Joined: 01 May 2010
Posts: 129

PostPosted: Sat Jul 10, 2010 1:21 am    Post subject: Reply with quote

Well that Wouldn't work because I would have to go and change every flipping thing.... Not worth it at this point in time.

So in the HULL thing, Would I put

if (cl.stats[ACTIVE_WEAPON] == IT_MBALL)
HULL stuffs.

Or would that change it for all players..
_________________
Gosh... debby ryan Is hot. I swear I will mary her...

My project Prime for psp:

http://www.moddb.com/games/primepsp1

We have a website, But are getting a new one.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Sat Jul 10, 2010 2:46 am    Post subject: Reply with quote

Mexicouger wrote:
Well that Wouldn't work because I would have to go and change every flipping thing.... Not worth it at this point in time.


It shouldn't take that long. Get something like TextPad5 and do "open all" and do a search and replace.

Quote:
So in the HULL thing, Would I put

if (cl.stats[ACTIVE_WEAPON] == IT_MBALL)
HULL stuffs.

Or would that change it for all players..


The only thing you do in the engine is define the 3 hull sizes.

In QuakeC you'd want to do that in ...

Code:
/*
============
W_ChangeWeapon

============
*/
void() W_ChangeWeapon =


in weapon.qc

If someone switches to the morphball, you'd change the model and all the related stuff and set the hull. I'd have to look through the Quake-Life source to see what Avirox did there as I don't actively code QuakeC on a regular basis like I do engine stuffs.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
Mexicouger



Joined: 01 May 2010
Posts: 129

PostPosted: Sat Jul 10, 2010 3:14 am    Post subject: Reply with quote

No....

How do I determine the HULL size of the ball... I know what to do in the quakec.

What Number do I put for HULL 2? Like hull0 is determined by 0>3. What number do I put for the ball.
_________________
Gosh... debby ryan Is hot. I swear I will mary her...

My project Prime for psp:

http://www.moddb.com/games/primepsp1

We have a website, But are getting a new one.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Sat Jul 10, 2010 3:34 am    Post subject: Reply with quote

Mexicouger wrote:
No....

How do I determine the HULL size of the ball... I know what to do in the quakec.

What Number do I put for HULL 2? Like hull0 is determined by 0>3. What number do I put for the ball.


There are 3 hulls: hull 0, hull 1, hull 2. hull 0 is point entity; it cannot be changed.

Your options are hull1 or hull2.

hull1 in Quake is player sized. hull2 is Shambler-sized. For your game, I'd recommend using hull1 for the regular player and all enemies and resize hull2 for the ball.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
Mexicouger



Joined: 01 May 2010
Posts: 129

PostPosted: Sat Jul 10, 2010 4:14 am    Post subject: Reply with quote

You aren't gettting my point/ I have resized the HULL in video_hardware_model, and brush.c

It's all been changed. I want to know HOW to tell the game when to use HULL 2. I was told to change it in world.c. But I don't have a value for the ball.

its size is '-12 -12 -24', '12 12 10'

How do I add that to the world.c thing
_________________
Gosh... debby ryan Is hot. I swear I will mary her...

My project Prime for psp:

http://www.moddb.com/games/primepsp1

We have a website, But are getting a new one.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Sat Jul 10, 2010 4:59 am    Post subject: Reply with quote

Mexicouger wrote:
I want to know HOW to tell the game when to use HULL 2.


Open up the Quake-Life QuakeC source codes. Search for the word "crouch".

I'm not using a computer where I can download source codes so I can't answer the above because I don't have sources available.
_________________
Tomorrow Never Dies. I feel this Tomorrow knocking on the door ...
Back to top
View user's profile Send private message
frag.machine



Joined: 25 Nov 2006
Posts: 728

PostPosted: Sat Jul 10, 2010 3:14 pm    Post subject: Reply with quote

Huh... using setsize() in QuakeC ?
_________________
frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group