Force Fields
Moderator: Moderators
- Tourny
- Command Sergeant Major

- Posts: 289
- Joined: Sat Sep 27, 2008 5:58 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Crifton
- Contact:
Force Fields
I know this was probably already asked somewhere, but I searched everything I could think of and nothing came up for what I wanted.
I'm trying to make a shield that goes down when I blow up a panel. Like the prison cells on Battle Of The Titans. I followed Boeing's advice and looked at the Mustafar script, but it talked about bridges and that just confused me.
EDIT: Does anybody know how to do it?
I'm trying to make a shield that goes down when I blow up a panel. Like the prison cells on Battle Of The Titans. I followed Boeing's advice and looked at the Mustafar script, but it talked about bridges and that just confused me.
EDIT: Does anybody know how to do it?
- Silas
- Captain

- Posts: 481
- Joined: Thu Oct 11, 2007 5:30 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Contact:
Re: Force Fields
that involves lua stuff that always crashes my map when i try to do it. There's some tuts in the modding FAQ section, but they seem to be somewhat confusing to me.
You could just give the force field health, if you want an easy solution
You could just give the force field health, if you want an easy solution
-
Master_Ben
- Lieutenant General

- Posts: 675
- Joined: Wed Nov 12, 2008 9:50 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Watching your PC over your shoulder. No, the other sholder....
Re: Force Fields
For the LUA stuff, check the Mygeeto shipped campaign. That happens in the level. It'll show you what you need.
EDIT: I think this is it: (I didn't put much effort into the search, though so it seems unlikely to be it.)
EDIT: I think this is it: (I didn't put much effort into the search, though so it seems unlikely to be it.)
Hidden/Spoiler:
- Tourny
- Command Sergeant Major

- Posts: 289
- Joined: Sat Sep 27, 2008 5:58 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Crifton
- Contact:
Re: Force Fields
I checked Mygeeto Campaign, it didn't make much sense at all.
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Force Fields
This is why we have an FAQ and documentation. The doc "scripting_system" is a great doc with a lot of information (when combined with the stock .luas as a reference). We also have this exact same issue prewritten out for you in tutorial form in the FAQ:
How to trigger an animation on destruction of an object
How to trigger an animation on destruction of an object
- Tourny
- Command Sergeant Major

- Posts: 289
- Joined: Sat Sep 27, 2008 5:58 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Crifton
- Contact:
Re: Force Fields
...since when is that in the FAQ?....
Thank you anyway...
Thank you anyway...
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Force Fields
It's been in there with all the other helpful information about scripting in the "Lua" section of the FAQ. There are a few other simple scripting examples as well.Tourny wrote:...since when is that in the FAQ?....
- Tourny
- Command Sergeant Major

- Posts: 289
- Joined: Sat Sep 27, 2008 5:58 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Crifton
- Contact:
Re: Force Fields
I'm still confused...
animateobja = OnObjectKill(
function(object, killer)
if GetEntityName(object) == "objectBnameinZeroEditor" then
PlayAnimation("whateveranimationgroup")
end
end
)
What do I replace with what? I have an idea but I don't understand the specifics.
animateobja = OnObjectKill(
function(object, killer)
if GetEntityName(object) == "objectBnameinZeroEditor" then
PlayAnimation("whateveranimationgroup")
end
end
)
What do I replace with what? I have an idea but I don't understand the specifics.
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Force Fields
"animatedobja" is whatever you want - it's just a random variable assigned to the function
"objectBnameinZeroEditor" is the name of the object you're planning on killing to trigger the animation (the name assigned in Zero Editor)
"whateveranimationgroup" is the name of the animation group (not the animation) that you'll want to start playing.
"objectBnameinZeroEditor" is the name of the object you're planning on killing to trigger the animation (the name assigned in Zero Editor)
"whateveranimationgroup" is the name of the animation group (not the animation) that you'll want to start playing.
- Tourny
- Command Sergeant Major

- Posts: 289
- Joined: Sat Sep 27, 2008 5:58 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Crifton
- Contact:
Re: Force Fields
Um, Mav? It isn't working... I smash the panel and the Field ain't moving.
All I did was copy and paste from the FAQ, and replace the stuff. Why isn't it working?
Code: Select all
PrisonField = OnObjectKill(
function(object, killer)
if GetEntityName(object) == "Container" then
PlayAnimation("FieldOn")
end
end
)
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Force Fields
Good question. Show me your .lua, a screenshot of the object (to be destroyed) in ZE, and a screenshot of your anim mode in ZE.
- Tourny
- Command Sergeant Major

- Posts: 289
- Joined: Sat Sep 27, 2008 5:58 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Crifton
- Contact:
Re: Force Fields
Here is my .Lua:
Screenshot underway...
EDIT: How do I get a screen shot of the object in ZE? EDIT EDIT: Scratch that, I found the tut. But I don't think I can get away with uploading them...
EDIT EDIT EDIT: My Object is a dea1_prop_panel and I named it "Container". In anims mode, I have the group name as "FieldOn" and then under "Animation/Object Pairs" I have "Open" as the anim and "PrisonField" as the object. (I named the Force Field "PrisonField") And then under the animations section I have that animation "Open" and it has two steps. Phase 1 it doesn't move and for phase2 I have the transition as "Pop" and the field moves approximately -10 along the Y axis. The run time is 1.
Hidden/Spoiler:
EDIT: How do I get a screen shot of the object in ZE? EDIT EDIT: Scratch that, I found the tut. But I don't think I can get away with uploading them...
EDIT EDIT EDIT: My Object is a dea1_prop_panel and I named it "Container". In anims mode, I have the group name as "FieldOn" and then under "Animation/Object Pairs" I have "Open" as the anim and "PrisonField" as the object. (I named the Force Field "PrisonField") And then under the animations section I have that animation "Open" and it has two steps. Phase 1 it doesn't move and for phase2 I have the transition as "Pop" and the field moves approximately -10 along the Y axis. The run time is 1.
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Force Fields
Did you check "disable hierarchies" for your animation group?
- Tourny
- Command Sergeant Major

- Posts: 289
- Joined: Sat Sep 27, 2008 5:58 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Crifton
- Contact:
Re: Force Fields
No XD. I think I forgot to save the animations too.
EDIT: It still won't budge.
EDIT: It still won't budge.
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Force Fields
First make sure you can get your animation to work at all. The setup you're telling me you have should work, so there's no way for me to tell the mistake. Test to see if your animation works by setting it to "play at level start" in the animation editor.
- Tourny
- Command Sergeant Major

- Posts: 289
- Joined: Sat Sep 27, 2008 5:58 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Crifton
- Contact:
Re: Force Fields
When I click "Play" in the amins menu it works. I'll try what you saud though...
EDIT: Yes, my animation does work.
EDIT: Yes, my animation does work.
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Force Fields
I've got nothing to say, then. If everything is as you've said it, then that will work. You could try changing the variable for the callback (don't call it "PrisonField," call it something else like "shieldanim"), you could try making sure your capitalization is the same for everything, and you can try a clean and remunge, but frankly there's nothing wrong there and if it doesn't work there must be some error I can't see.
- Tourny
- Command Sergeant Major

- Posts: 289
- Joined: Sat Sep 27, 2008 5:58 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Crifton
- Contact:
Re: Force Fields
Has anybody ever tried this and made it work before?
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Force Fields
...
Yes.
Yes.
- Tourny
- Command Sergeant Major

- Posts: 289
- Joined: Sat Sep 27, 2008 5:58 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: Crifton
- Contact:
Re: Force Fields
This particular code from that particular tutorial?
EDIT: I made it work with something different, case closed.
EDIT: I made it work with something different, case closed.
