Inside3D!
     

invulnerability

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



Joined: 29 Oct 2004
Posts: 295
Location: Swindon, UK

PostPosted: Thu Jun 02, 2005 9:10 pm    Post subject: invulnerability Reply with quote

Is it possible within quakec to call the screen colour effect thing when you pick up the invulnerability item - without picking up the invulnerability item or being invulnerable.

Yes, I have structured that question so I could write invulnerability as much as possible
_________________
my site
Back to top
View user's profile Send private message MSN Messenger
Dr. Shadowborg
Inside3D Staff


Joined: 16 Oct 2004
Posts: 726

PostPosted: Thu Jun 02, 2005 10:26 pm    Post subject: Re: invulnerability Reply with quote

ajay wrote:
Is it possible within quakec to call the screen colour effect thing when you pick up the invulnerability item - without picking up the invulnerability item or being invulnerable.

Yes, I have structured that question so I could write invulnerability as much as possible


Well, your best bet would be to use v_cshift. You'll have to either stuffcmd or localcmd it though.

Syntax:
v_cshift red green blue intensity

red green and blue indicate the amounts of each color used to create your screen color. Use varying amounts of each to "blend" the color you want. Intensity determines how strong the effect is.

For QC usage example:
per player:

stuffcmd(self, "v_cshift 0 0 0 0\n");

The above will reset your screen color effect to normal.
_________________
"Roboto suggests Plasma Bazooka."
Back to top
View user's profile Send private message
Wazat



Joined: 15 Oct 2004
Posts: 732
Location: Middle 'o the desert, USA

PostPosted: Fri Jun 03, 2005 12:33 am    Post subject: Reply with quote

Shadow is correct, but after reviewing your wording a second time, I have concluded that this solution could also be considered technically viable (what a weasel I am):

self.items = self.items | IT_INVULNERABILITY;

This should set your screen color, as well as set the invulnerability icon on the console (that hex symbol). You shouldn't be invulnerable, however (the code actually checks self.invulnerable_time or invulnerable_finished), but your screen color will be changed. The only problem is that the hex symbol that indicates you have the invulnerability powerup will still be visible, and you may not want that.

The good Dr. Shadowborg's method is probably the most useful for you. You can also put this in PutClientInServer to make sure that the screen doesn't stay red by accident when the player respawns or changes maps, etc:

stuffcmd(self, "v_cshift 0 0 0 0\n"); // reset view color

Good luck, ajay!
_________________
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Back to top
View user's profile Send private message MSN Messenger
Dr. Shadowborg
Inside3D Staff


Joined: 16 Oct 2004
Posts: 726

PostPosted: Fri Jun 03, 2005 12:40 am    Post subject: Reply with quote

Wazat wrote:
This should set your screen color, as well as set the invulnerability icon on the console (that hex symbol). You shouldn't be invulnerable, however (the code actually checks self.invulnerable_time or invulnerable_finished), but your screen color will be changed. The only problem is that the hex symbol that indicates you have the invulnerability powerup will still be visible, and you may not want that.


It should also be noted that not only does the hex symbol appear, it also sets your armorvalue to 666, armor icon to the pentagram, generates a "glow" somewhat akin to EF_DIMLIGHT, and changes your "face" shot to the "Infused with evile" pic. Razz
_________________
"Roboto suggests Plasma Bazooka."
Back to top
View user's profile Send private message
Wazat



Joined: 15 Oct 2004
Posts: 732
Location: Middle 'o the desert, USA

PostPosted: Fri Jun 03, 2005 1:31 am    Post subject: Reply with quote

That's true. I just wanted to be silly. Wink
_________________
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Back to top
View user's profile Send private message MSN Messenger
ajay



Joined: 29 Oct 2004
Posts: 295
Location: Swindon, UK

PostPosted: Fri Jun 03, 2005 6:19 am    Post subject: Reply with quote

Thanks chaps, you are gentlemen and scholars Very Happy

Much appreciated.

ajay
_________________
my site
Back to top
View user's profile Send private message MSN Messenger
ajay



Joined: 29 Oct 2004
Posts: 295
Location: Swindon, UK

PostPosted: Fri Jun 03, 2005 4:28 pm    Post subject: Reply with quote

Ok, it works from the console, but form within qc I get a crash and this error:

CALL 2 470(STUFFCMD)STUFFCMD()
TARGET.QC: SURPRISE_TOUCH
(NO FUNCTION)
PARM 0 NOT A CLIENT
HOST ERROR


Using localcmd just does nothing....

Help again please you wonderful people Smile
_________________
my site
Back to top
View user's profile Send private message MSN Messenger
Wazat



Joined: 15 Oct 2004
Posts: 732
Location: Middle 'o the desert, USA

PostPosted: Fri Jun 03, 2005 5:33 pm    Post subject: Reply with quote

in:
stuffcmd(self, "v_cshift 0 0 0 0\n");

Make sure self is the player. If it's an item or something the player is touching, you'll need to use 'other'.
_________________
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Back to top
View user's profile Send private message MSN Messenger
ajay



Joined: 29 Oct 2004
Posts: 295
Location: Swindon, UK

PostPosted: Fri Jun 03, 2005 6:41 pm    Post subject: Reply with quote

ta, i tried other, but no dice, then tried activator which worked, cheers
_________________
my site
Back to top
View user's profile Send private message MSN Messenger
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