Page 1 of 1

Is it possible to create a "use" action?

Posted: Tue Mar 03, 2009 11:05 pm
by jedimoose32
Well, I'm back to modding Battlefront 2 again, it seems to happen every time.

Quick question with probably a pretty long answer. :wink:

I want to make a control panel that performs a certain function (retracting a bridge into a wall, similar to the falling catwalks on Mustafar), but I am really against the whole idea of shooting the control panel to do this, and then repairing it to reverse the function.
I know BF2 doesn't come with a "use" action (like 'e' or 'enter' or 'f', to list some common ones), but could I script such a thing with lua, or edit ingame, or what?

Thanks in advance.
Time to wait... :sleep:

Re: Is it possible to create a "use" action?

Posted: Tue Mar 03, 2009 11:23 pm
by Maveritchell
jedimoose32 wrote:Quick question with probably a pretty long answer. :wink:
Yes.



Oh, did you want a longer answer?

Yes, you can do it a number of ways, not the least of which is just making your fusioncutter look like a hand instead of a fusioncutter. The principles are the same.

Re: Is it possible to create a "use" action?

Posted: Tue Mar 03, 2009 11:57 pm
by RogueKnight
Yeah, Mav did it on Rebel ops 1, and possibly Abraxis?

Re: Is it possible to create a "use" action?

Posted: Wed Mar 04, 2009 4:48 pm
by Fiodis
Meh, you could do still destroy it but make it look like it's something else that's happening. For instance, (take the Mustafar example) have a light-switch-type thing, except bigger, pointing up, when the bridge is up. Then, to get the bridge down, you destroy it in one shot, maybe using grenade anims for a melee weapon with no geometry (to make it look like flipping a switch, kinda. Hey, better than using a rifle). Then you just set the switch's destroyed geometry as the same switch except pointing down.

Re: Is it possible to create a "use" action?

Posted: Thu Mar 05, 2009 12:04 am
by jedimoose32
Maveritchell wrote:
jedimoose32 wrote:Quick question with probably a pretty long answer. :wink:
Yes.

Oh, did you want a longer answer?
Well, that's good news. So, let me get this straight:

1. create destructible object that is linked through script to the bridge action (i've done this sort of thing before)
2. destroyed model just looks like a flipped switch instead of a broken hunk of slag
3. create a new weapon?? this is where i'm stuck with what you guys have said

So should I have an invisible lightsaber that does it? What I thought would look cool is Force lightning animations for that. Again a problem, though: I want this to be WeaponChannel, if that's possible. But if I do use the lightsaber, I don't want it to be a weapon, just an invisible tool for flippin' the switch.

**sighs with self-frustration**
Thanks for the help :bowdown: . I'm still open to more ideas.

Re: Is it possible to create a "use" action?

Posted: Thu Mar 05, 2009 12:30 am
by Maveritchell
All you really want is a fusioncutter, not a lightsaber or anything goofy like that. Make your fusioncutter have force animations. It really depends on what you want to do. The tougher part is setting up the scripting to work, making it look one way or another is just an aesthetics thing and you shouldn't worry about that until you've already successfully set up your switch ingame.

Re: Is it possible to create a "use" action?

Posted: Thu Mar 05, 2009 12:57 am
by jedimoose32
Maveritchell wrote:All you really want is a fusioncutter
But you'd still have to shoot it? Or is there a method of making the fusion cutter do 1 damage, and scripting the switch so that it will alternate on or off each time it takes 1 damage, and then giving it like 10,000 health?

Re: Is it possible to create a "use" action?

Posted: Thu Mar 05, 2009 1:32 am
by Maveritchell
jedimoose32 wrote:
Maveritchell wrote:All you really want is a fusioncutter
But you'd still have to shoot it? Or is there a method of making the fusion cutter do 1 damage, and scripting the switch so that it will alternate on or off each time it takes 1 damage, and then giving it like 10,000 health?
Shooting, healing, using... whatever you want to call it it's all the same, you're just clicking "primary" or "secondary" fire. Yes, you can make the switch trigger the opposite of what it currently is. You can just make the switch die and respawn itself every time it's hit, or yes, you can make it take a very small amount of damage and just regenerate.

Either way, you're probably going to be using the "GetObjectLastHitWeaponClass" callback. You can see how this is used in the Geonosis campaign lua.