Inside3D!
     

Check ground?!?!

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Stealth Kill



Joined: 29 Dec 2006
Posts: 83

PostPosted: Tue Aug 05, 2008 9:57 pm    Post subject: Check ground?!?! Reply with quote

I need heeeeelp

If the player is on the entity "func_bomb_target" you should be able to plant the bomb.

in W_Attack i changed W_FireBomb (); with CheckGround ();

and this is the checkground function.

Code:
void() CheckGround =
{
   if (other.classname == "func_bomb_target")
   {
         W_FireC4 ();
   }
           else
           {
          centerprint (self, "You can not plant bomb here\n");  }


};


i i try to plant a a bomb it centerprints always You can not plant bomb here. If i´m on func_bomb_target too.
Back to top
View user's profile Send private message
Entar



Joined: 05 Nov 2004
Posts: 422
Location: At my computer

PostPosted: Wed Aug 06, 2008 12:42 am    Post subject: Reply with quote

I'm not real good at QC, but my guess is that you need to put your check in the player's .touch function, and set a .variable for the player (or flag or something) in there if other.classname == "func_bomb_target" - then, when the player tries to use C4, check that variable.
_________________
woh... feelin woozy... too much cider...
http://entar.quakedev.com
games fascination - My Game Development Blog/Journal
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Electro



Joined: 29 Dec 2004
Posts: 241
Location: Brisbane, Australia

PostPosted: Wed Aug 06, 2008 5:33 am    Post subject: Reply with quote

It's because 'other' is 'world' every time when you're calling that code.

why not make a touch function for the func_bomb_target

then in that you can do stuff like
Code:

void() Func_BombTarget_Touch =
{
local entity oself;

if (other.classname != "player")
    return; // only allow players to register touchs

if (!other.hasbomb)
    return; // make sure they have the bomb

if (!other.flags & FL_ONGROUND)
    return; // don't plant bomb midair

other.hasbomb = FALSE; // take the bomb off them
// spawn the bomb in the world here etc...
oself = self;
self = other;
W_FireBomb ();
self = oself;
};


...well you get the idea.. or at least some ideas, hopefully.[/code]
_________________
Unit reporting!
http://www.bendarling.net/
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Stealth Kill



Joined: 29 Dec 2006
Posts: 83

PostPosted: Wed Aug 06, 2008 9:32 am    Post subject: Reply with quote

Thanks i try that Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
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