Is it possible to create a "use" action?

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
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

Is it possible to create a "use" action?

Post 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:
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

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

Post 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.
RogueKnight
Space Ranger
Posts: 2512
Joined: Sat Nov 22, 2008 1:50 pm
Projects :: Life. Work.
Games I'm Playing :: League of Legends
xbox live or psn: No gamertag set
Location: Washington, US

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

Post by RogueKnight »

Yeah, Mav did it on Rebel ops 1, and possibly Abraxis?
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: Is it possible to create a "use" action?

Post 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.
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

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

Post 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.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

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

Post 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.
jedimoose32
Field Commander
Field Commander
Posts: 938
Joined: Thu Jan 24, 2008 12:41 am
Projects :: Engineering Degree
Location: The Flatlands of Canada

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

Post 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?
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

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

Post 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.
Post Reply