Poison mine
Moderator: Moderators
-
Executer94
- Major

- Posts: 504
- Joined: Fri May 01, 2009 7:45 am
- Location: Chalmuns Cantina
Poison mine
How can i do that. A mine which doesn't damage so heavy but poison you like the debuff poison from the magna guard.
I try something out but the player didn't get poison.
I try something out but the player didn't get poison.
- [TFA]Padawan_Fighter
- High General

- Posts: 806
- Joined: Wed Mar 25, 2009 3:37 pm
- Projects :: Ha - as if I will ever get back to them
- xbox live or psn: No gamertag set
- Location: Lost at sea
Re: poison mine
What exactly did you try?
-
Executer94
- Major

- Posts: 504
- Joined: Fri May 01, 2009 7:45 am
- Location: Chalmuns Cantina
Re: poison mine
I want to have a mine for my new upcoming map which has the same effect as the secound weapon of the magna guard (debuff_posion).
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: poison mine
I can think of a way to do this via a short bit of hectic LUA coding, but I'd rather see first if there's any ODF solution. I know Mav's rigged poison grenades, which I think activate a low-altitude orbital strike somehow? You might want to fool around with that and see what you get.
When you say effect, did you mean the explosion visual effect? That' won't change any damage; visual effects do not determine damage.
When you say effect, did you mean the explosion visual effect? That' won't change any damage; visual effects do not determine damage.
- hammythepig
- Master Sergeant

- Posts: 175
- Joined: Mon Nov 24, 2008 6:05 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Canada
Re: poison mine
Well, I can't help you, but I definatly want to know the answer to this, that would be so cool!
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: poison mine
Right.
I can't think offhand of any ODF solution, though there may be one. I'll post the general code outline now; I haven't the time to type the whole thing out right at the moment since I have roughly three days of sleep to chase after.
0. Set up a Poison Mine ODF that works same way as normal mine, but has an extremely small amount of damage (say, 1 damage). It will work with any amount of damage,so you can set it higher if you want poison and a small explosion or two.
1. On player dispense mine, check if dispensed mine's ODF matches "Poison Mine" weapon ODF. If yes, store player's name as a variable.
2. On character damage, check via GetObjectLastHitWeaponClass if the character was damaged by the "Poison Mine". If yes, apply negative health regen to simulate poison, and attach an effect to the unit if you want to, though how you'd get the effect on just that unit I can't imagine. Also, start a certain timer.
3. On timer elapse, remove the negative health regen. Also, check to see if the unit that the negative health regen was applied to is dead. If yes, grant a certain amount of points to the player who dropped the mine (calling him up through the variable mentioned in step 1). And reset timer. If it's necessary to reset timer.
Of course, this has a number of bugs that would take more code to iron out or work around, if possible. At its current state it would work best in a singleplayer situation with only the human having the weapon.
If no LUA expert sees fault with this (at least any more-than-moderate, un-workaroundable fault), I'll go ahead and take a rough stab at the actual code tomorrow. In the meantime, it's time for me to
...well, that.
I can't think offhand of any ODF solution, though there may be one. I'll post the general code outline now; I haven't the time to type the whole thing out right at the moment since I have roughly three days of sleep to chase after.
0. Set up a Poison Mine ODF that works same way as normal mine, but has an extremely small amount of damage (say, 1 damage). It will work with any amount of damage,so you can set it higher if you want poison and a small explosion or two.
1. On player dispense mine, check if dispensed mine's ODF matches "Poison Mine" weapon ODF. If yes, store player's name as a variable.
2. On character damage, check via GetObjectLastHitWeaponClass if the character was damaged by the "Poison Mine". If yes, apply negative health regen to simulate poison, and attach an effect to the unit if you want to, though how you'd get the effect on just that unit I can't imagine. Also, start a certain timer.
3. On timer elapse, remove the negative health regen. Also, check to see if the unit that the negative health regen was applied to is dead. If yes, grant a certain amount of points to the player who dropped the mine (calling him up through the variable mentioned in step 1). And reset timer. If it's necessary to reset timer.
Of course, this has a number of bugs that would take more code to iron out or work around, if possible. At its current state it would work best in a singleplayer situation with only the human having the weapon.
If no LUA expert sees fault with this (at least any more-than-moderate, un-workaroundable fault), I'll go ahead and take a rough stab at the actual code tomorrow. In the meantime, it's time for me to
...well, that.
- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: poison mine
couldnt you make it an autoturret with 0.5 lockonrange and a selfdestructionweapon?
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: poison mine
That would work just as well; though you would have to make it have a mine's mesh. In fact, that might work better. I'm not so certain you can detect a player dropping a mine, but you can for sure get him dropping a turret.
You don't even need the self-destruct, just a low-damage explosion (again, 1? Set higher for more bang) and kill the object via LUA.
You don't even need the self-destruct, just a low-damage explosion (again, 1? Set higher for more bang) and kill the object via LUA.
- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: poison mine
yes, but if you are not experienced in lua (like me), the selfdestruction is easyer 
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: poison mine
Woah boy, hold it. If we use a turret how do we get it to detonate when the target approaches?
Perhaps a self-destruct, as you mentioned earlier, would be the better path around that problem.
Perhaps a self-destruct, as you mentioned earlier, would be the better path around that problem.
- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: poison mine
we get it to detonate when the target approaches through the lockonrange= "extremelysmallnumber"
which will him make only fiering the selfdestructing weapon when an enemy reaches that radius
which will him make only fiering the selfdestructing weapon when an enemy reaches that radius
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: poison mine
The the GetObjectLastHitWeaponClass equalling the turret's self-destruct weapon's ODF triggering the negative health regen. Excellent! I'll get to work on it.
Just the script, mind you; you'll have to set up the ODFs yourself.
Just the script, mind you; you'll have to set up the ODFs yourself.
- Nylad
- Second Lance Corporal

- Posts: 108
- Joined: Mon Jul 21, 2008 11:21 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: probably beating on an arrangement of cylindrical objects with two wooden sticks.
Re: poison mine
Or you could just give the turret a poison weapon with tiny range and ApplyOnOwnerIfOnOthers set to 1 and set the damage scale for buildings pretty high. This way, the turret would kill itself and poison all those around, providing the desired effect. This solution wouldn't require any LUA coding, if it worked.
EDIT: hmm... I want to test this now. I'll get back to you on this.
EDIT: hmm... I want to test this now. I'll get back to you on this.
- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: Poison mine
nylad, thats exactly what i allready suggested 
- Nylad
- Second Lance Corporal

- Posts: 108
- Joined: Mon Jul 21, 2008 11:21 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: probably beating on an arrangement of cylindrical objects with two wooden sticks.
Re: Poison mine
it was?DarthD.U.C.K. wrote:nylad, thats exactly what i allready suggested
-
Executer94
- Major

- Posts: 504
- Joined: Fri May 01, 2009 7:45 am
- Location: Chalmuns Cantina
Re: Poison mine
sorry i was in short holidays 
but i'm trying to fix that in this moment
but i'm trying to fix that in this moment
-
Executer94
- Major

- Posts: 504
- Joined: Fri May 01, 2009 7:45 am
- Location: Chalmuns Cantina
Re: Poison mine
my computer had a fatal crash
so this topic can be locked.
so this topic can be locked.
