lfnetwork.com mark read register faq members calendar

Thread: a noob questions :)
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 01-31-2004, 03:00 PM   #1
alexx860
Rookie
 
alexx860's Avatar
 
Join Date: Nov 2003
Location: France, Brittany
Posts: 79
another noob questions :)

hi all, i am begginer in JA Coding, so i have a question :
it's possible to make the disruptor fire bounce on wall, if yes, how ???

thx in advance
alexx860

Last edited by alexx860; 02-01-2004 at 03:37 PM.
alexx860 is offline   you may: quote & reply,
Old 01-31-2004, 06:26 PM   #2
MasterSidious
Junior Member
 
MasterSidious's Avatar
 
Join Date: Oct 2003
Location: in game getting flamed and banned
Posts: 412
You could check out bg_weapons.c and g_weapons.h, don't know about doing this with that gun though


FP>Sephious
67.15.20.187:29070 - FFA SO
67.15.21.115:29070 - CTF SO
67.15.18.232:29070 - Siege/FFA
Laming is tolerated
MasterSidious is offline   you may: quote & reply,
Old 02-01-2004, 09:57 AM   #3
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,176
You can't without doing some serious coding changes to the SDK code.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 02-01-2004, 10:02 AM   #4
alexx860
Rookie
 
alexx860's Avatar
 
Join Date: Nov 2003
Location: France, Brittany
Posts: 79
ok, thx for answers, but i have another question : how to remove an item from the player ? because i have made a command to give the jetpack to the player, but how remove it ??
alexx860 is offline   you may: quote & reply,
Old 02-02-2004, 02:35 PM   #5
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,176
Well, I beleive the jetpack disappears when the player dies.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 02-02-2004, 06:50 PM   #6
VSYoda1
Rookie
 
VSYoda1's Avatar
 
Join Date: Dec 2003
Posts: 18
if( ent->client->ps.stats[STAT_HOLDABLE_ITEM] & HI_JETPACK )
{
ent->client->ps.stats[STAT_HOLDABLE_ITEM] ^= HI_JETPACK ;
}

I think that will work.
VSYoda1 is offline   you may: quote & reply,
Old 02-11-2004, 10:17 AM   #7
alexx860
Rookie
 
alexx860's Avatar
 
Join Date: Nov 2003
Location: France, Brittany
Posts: 79
didn't work


150+ GMail invitations! PM me if you want one

alexx860 is offline   you may: quote & reply,
Old 02-12-2004, 08:27 AM   #8
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,176
Quote:
ent->client->ps.stats[STAT_HOLDABLE_ITEM] ^= HI_JETPACK;
What's the ^= operator? (x = x ^ y) = (x ^= y)?

The correct math operator to remove a flag like that is...

Quote:
ent->client->ps.stats[STAT_HOLDABLE_ITEM] &= ~HI_JETPACK;


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 02-12-2004, 08:55 AM   #9
RenegadeOfPhunk
 
RenegadeOfPhunk's Avatar
 
Join Date: Apr 2002
Location: UK
Posts: 731
The ^ operator is Exclusive OR (XOR) - with the following truth table:

A B R

0 0 0
0 1 1
1 0 1
1 1 0

This code:

Quote:
if( ent->client->ps.stats[STAT_HOLDABLE_ITEM] & HI_JETPACK )
{
ent->client->ps.stats[STAT_HOLDABLE_ITEM] ^= HI_JETPACK ;
}
...would toggle the HI_JETPACK bit to off, if it was on. So actually, even though it's a bit OTT (Razor's code is the more correct and easier way!), this code should actually succeed in turning off that bit.

I think the problem may lie in when you are running this code - I don't think you've specified this anywhere. Also, you probably need to clear the EF_JETPACK flag at the same time...

i.e.

ent->client->ps.stats[STAT_HOLDABLE_ITEM] &= ~HI_JETPACK;
ent->client->ps.eFlags &= ~EF_JETPACK;


/* RenegadeOfPhunk */

OJP forums
OJP website - WIP

Movie Battles!
RenegadeOfPhunk is offline   you may: quote & reply,
Old 02-13-2004, 09:25 PM   #10
Azymn
 
Azymn's Avatar
 
Join Date: Jul 2002
Location: ~(40.14, -111.40)
Posts: 544
If you wanna use the same command to give the jetpack as take it away then XORing is the way to go:

Code:
if( !strcmp(cmd, "givejetpack"))
{
ent->client->ps.stats[STAT_HOLDABLE_ITEM] ^= HI_JETPACK;
ent->client->ps.eFlags ^= EF_JETPACK;
}
That command will give them a jetpack if they don't have one, and take it away if they do. The only problem is if the HI_JETPACK and EF_JETPACK bits get out of sync with each other. =]
Azymn is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Coding > a noob questions :)

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:52 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.