Inside3D!
     

poison

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Tutorial Help
View previous topic :: View next topic  
Author Message
ijed



Joined: 26 Jul 2008
Posts: 46
Location: Chile, SA

PostPosted: Mon Aug 25, 2008 12:15 am    Post subject: poison Reply with quote

Ok, I'm trying to implement an enemy that poisons the player using the tutorial:

http://www.inside3d.com/showtutorial.php?id=65

Which is for a player's poison axe. I copied it into the enemy's attack in question and nothing happens. It looks like there's something missing somewhere - do I need to put reference the poison_think somehwhere else or something?

Thanks for your time.
Back to top
View user's profile Send private message
Dr. Shadowborg
Inside3D Staff


Joined: 16 Oct 2004
Posts: 726

PostPosted: Mon Aug 25, 2008 3:16 pm    Post subject: Reply with quote

GetPoisoned is what makes the magic happen, but unless your monster is doing a traceline, it won't work as is.

Try changing GetPoisoned(trace_ent); to GetPoisoned(self.enemy);
_________________
"Roboto suggests Plasma Bazooka."
Back to top
View user's profile Send private message
ijed



Joined: 26 Jul 2008
Posts: 46
Location: Chile, SA

PostPosted: Mon Aug 25, 2008 3:19 pm    Post subject: Damn Reply with quote

I tried this, but it didn't work, looks like I got the syntax wrong Razz

Thanks, I'll try it tonight.
Back to top
View user's profile Send private message
ijed



Joined: 26 Jul 2008
Posts: 46
Location: Chile, SA

PostPosted: Tue Aug 26, 2008 2:05 am    Post subject: Reply with quote

Like a charm. But.

How do I stop it with a health pack?

I'm almost completely new to qc.

AFAIK I can't check if the player is healed within OnPoisonThink, so I have to make a variable? eg. Poisoned - but then I write an if poisoned statement and how will it remove the poison from the player?

I know there's a simple way of doing this.
Back to top
View user's profile Send private message
Dr. Shadowborg
Inside3D Staff


Joined: 16 Oct 2004
Posts: 726

PostPosted: Tue Aug 26, 2008 3:24 pm    Post subject: Reply with quote

It is now that I notice that this tutorial has a small bug in that it may not quit doing damage to the player when he hits water. Razz (Should be self.owner.waterlevel)

Anyway in response to your question, just create a .poisoned variable, then in GetPoisoned() add a ent.poisoned = TRUE; and somewhere in health_touch, add a other / self.poisoned = FALSE;. (whatever the context is that points to the player)
_________________
"Roboto suggests Plasma Bazooka."


Last edited by Dr. Shadowborg on Tue Aug 26, 2008 3:30 pm; edited 1 time in total
Back to top
View user's profile Send private message
ijed



Joined: 26 Jul 2008
Posts: 46
Location: Chile, SA

PostPosted: Tue Aug 26, 2008 3:26 pm    Post subject: Nice Reply with quote

Thanks alot. Seems like I was nearly there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Tutorial Help 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