PDA

View Full Version : AI and Animated Scenery



English Mobster
June 16th, 2009, 05:08 PM
OK, here was my idea:
I was going to have a piece of animated scenery fly above my "Domain" map, a Phantom, to be exact. Now, in place of the Phantom's turret, I was going to attach an AI which controls a large dynamic spotlight. I have the Phantom's animations done, now all I need is the spotlight. My question is: how do I get the spotlight to work? Can I use object_attach, or what would I do?
I was going to make a spotlight vehicle, then magically put the AI inside, then attach the vehicle to the Phantom where the turret should be. Would that work? If not, how would I go about it?
Thanks.

Heathen
June 16th, 2009, 05:29 PM
no idea, but pretty cool idea if you can get it to work.

klange
June 16th, 2009, 05:32 PM
Replace the weapon on the gun turret with the flashlight and keep it in there as the builtin gunner. Should work fine.

e: Rather, a copy of the flashlight and increase the brightness and what not \/

Advancebo
June 16th, 2009, 05:37 PM
You could probably increase the effects of the flashlight.

Masterz1337
June 16th, 2009, 06:04 PM
PM me your contact info, I got a couple of ideas that we were going to use on the sparrowhawk.

Heathen
June 16th, 2009, 06:33 PM
do it. This "masters" guy sounds legit.

117
June 16th, 2009, 07:42 PM
If I were you, I would just set up a phantom dropship vehicle with a modified flashlight that looks like a spotlight replacing the main weapon. (You might want to come up with something to make the rays of light in it...) Then you can script it to move about as an AI or just set migration points and it should do the job just fine. (You should be able to make the AI's position sync for this method by using this little trick Adolif came up with here (http://halomods.com/forums/viewtopic.php?f=89&t=66956).)

English Mobster
June 17th, 2009, 12:55 AM
Alright, I'm a noob at scripting, yadda yadda yadda.

(script startup "phantom"
(objects_attach fleshlight "body" phantom "gunseat")
(unit_set_desired_flashlight_state fleshlight TRUE)
)
I set up the Phantom ingame. Since I found out that whoever made my Phantom made the Turret a detached AI itself, I had to reconfigure the turret's biped tag. I forgot to make the Actor_variant the first time around, and I accidentally attached just the turret's biped to the Phantom and not the AI itself.
So once I realized that's what I did wrong, I went and set up the actor variant. I named the squad and the encounter itself "fleshlight" and tried to compile the script again.
However, now Sapien is saying that "fleshlight" is not a valid object name. Everything is spelled correctly, so that isn't the issue.
The Searchlight AI never respawns, has 1 spawn point and that's about it. The encounter, squad, and spawn point all are set to "Plasma_Turret"... So why isn't it attaching? Obviously, if someone were able to get this Phantom ingame, then it must be possible to attach the AI to the Phantom, but no one left a manual explaining how they did it.
Can anyone explain what, if anything, I am doing wrong?

CodeBrain
June 17th, 2009, 12:07 PM
I am guessing your talking about my Phantom, are you not?

Considering I made the turret biped's name "Plasma_Turret" that could confirm it.

Masterz1337
June 17th, 2009, 01:12 PM
I think I added you on Xfire English. AS far as your problem, I'd do a test with integrated AI gunners, make sure you can get your ai to look around and target objects, then work on the actual light.

CodeBrain
June 17th, 2009, 03:01 PM
I am going to assume you are using my Phantom anyway, sorry if it isnt :B


Anyway, my Phantom automatically spawns the turret ai inside it's "turret seats", which are gunseat, gunseat2, and gunseat3.

If you want a specific turret to be a "fleshlight" you need to remove the turret that is in the front.

English Mobster
June 17th, 2009, 03:17 PM
I am going to assume you are using my Phantom anyway, sorry if it isnt :B


Anyway, my Phantom automatically spawns the turret ai inside it's "turret seats", which are gunseat, gunseat2, and gunseat3.

If you want a specific turret to be a "fleshlight" you need to remove the turret that is in the front.
I'd imagine it is your Phantom, but I'll go download your Phantom tags and overwrite mine just to be sure (gotta know who to give credit to).

How does it automatically spawn the turrets? I see nothing in the .vehicle tag that says it would spawn the AI, though it is probable I missed something.

Worst comes to worst, I'll just make the Searchlight itself animated scenery, though having it AI would be nice.

CodeBrain
June 17th, 2009, 03:43 PM
The phantom automatically spawns them in the same matter as the c_dropship does.

http://i19.photobucket.com/albums/b152/ShadowFireMario/engrish101.png

Where that red box is, is where you put your AI in.

Now, for the AI itself, you can either use an AI that has a Biped, or you can do this:

Make a "dummy" biped (Which means no model, no animations, and no collision.) Give it a weapon that is invisible, but has a light on the "primary_trigger" marker.

That should work.

English Mobster
June 17th, 2009, 05:52 PM
Ah, alright.

Thanks.