Poison mine

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Executer94
Major
Major
Posts: 504
Joined: Fri May 01, 2009 7:45 am
Location: Chalmuns Cantina

Poison mine

Post by Executer94 »

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.
User avatar
[TFA]Padawan_Fighter
High General
High General
Posts: 806
Joined: Wed Mar 25, 2009 3:37 pm
Projects :: Ha - as if I will ever get back to them
Games I'm Playing :: SWBF2 ARK EliteDngrs
xbox live or psn: No gamertag set
Location: Lost at sea

Re: poison mine

Post by [TFA]Padawan_Fighter »

What exactly did you try?
Executer94
Major
Major
Posts: 504
Joined: Fri May 01, 2009 7:45 am
Location: Chalmuns Cantina

Re: poison mine

Post by Executer94 »

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).
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: poison mine

Post by Fiodis »

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.
User avatar
hammythepig
Master Sergeant
Master Sergeant
Posts: 175
Joined: Mon Nov 24, 2008 6:05 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Canada

Re: poison mine

Post by hammythepig »

Well, I can't help you, but I definatly want to know the answer to this, that would be so cool!
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: poison mine

Post by Fiodis »

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
:faint:
...well, that.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: poison mine

Post by DarthD.U.C.K. »

couldnt you make it an autoturret with 0.5 lockonrange and a selfdestructionweapon?
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: poison mine

Post by Fiodis »

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.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: poison mine

Post by DarthD.U.C.K. »

yes, but if you are not experienced in lua (like me), the selfdestruction is easyer :D
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: poison mine

Post by Fiodis »

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.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: poison mine

Post by DarthD.U.C.K. »

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
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: poison mine

Post by Fiodis »

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.
User avatar
Nylad
Second Lance Corporal
Second Lance Corporal
Posts: 108
Joined: Mon Jul 21, 2008 11:21 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: probably beating on an arrangement of cylindrical objects with two wooden sticks.

Re: poison mine

Post by Nylad »

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.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Poison mine

Post by DarthD.U.C.K. »

nylad, thats exactly what i allready suggested :roll:
User avatar
Nylad
Second Lance Corporal
Second Lance Corporal
Posts: 108
Joined: Mon Jul 21, 2008 11:21 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: probably beating on an arrangement of cylindrical objects with two wooden sticks.

Re: Poison mine

Post by Nylad »

DarthD.U.C.K. wrote:nylad, thats exactly what i allready suggested :roll:
it was? :faint: I feel silly now. I guess I was confused by fiodis mentioning scripts beyond that point like he still though it was necessary to use scripts. If anyone cares, I couldn't get it to work (crashes when it reaches unit selection screen), but that might not mean anything.
Executer94
Major
Major
Posts: 504
Joined: Fri May 01, 2009 7:45 am
Location: Chalmuns Cantina

Re: Poison mine

Post by Executer94 »

sorry i was in short holidays :)

but i'm trying to fix that in this moment :D
Executer94
Major
Major
Posts: 504
Joined: Fri May 01, 2009 7:45 am
Location: Chalmuns Cantina

Re: Poison mine

Post by Executer94 »

my computer had a fatal crash :(

so this topic can be locked.
Post Reply