A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE Technical / Map Design »Switching weapons with AI

Author Topic: Switching weapons with AI (5 messages, Page 1 of 1)
Moderators: Dennis

er449
Joined: Mar 28, 2007


Posted: Feb 6, 2010 07:00 PM    Msg. 1 of 5       
One of the reasons we would often betray our allies in the campaign levels for Halo 1 was because unlike the second or third game, players could not switch weapons with allies.

Let's say you finished clearing out a mess of grunts with fuel rods. Instead of hoarding the, say 4 fuelrods, for yourself, you decide to ration them out to your four surviving marines and ODSTs.

So you set out in your troop transport hog with your allies, and because they've been upgraded from AR's and Br's, you have no reason to worry. Why? Now you've got four cannons firing, blasting the enemy to oblivion in all directions! The game is grossly unbalanced in your favor.

So was the case for me in Halo 3. I want to do that in Halo 1.

I believe that a script might be possible for this, but I'm not quite sure.
I think you could enable the script for particular trigger volumes, but not in general cases.

Command lines that might help are:
(player_action_test_action)
(player_action_test_zoom)
(player_add_equipment )
(objects_attach )
(player_action_test_reset) (for when the script repeats)

Of course, attaching a weapon to the AI doesn't give it the ability to wield it, as I found out with my elite friend a while back...


However, the object swap for the AI would only occur while the player was in the trigger volume, still deciding if he liked what weapon he swapped for or not. As soon as the player leaves it, the AI would be swapped and replaced with the AI that really does hold the weapon (kind of similar to the berserking sword elite script I did a while back).

So...player clears area of all enemies. Optional objective flashes up on the screen: "go to the waypoint/marker to switch a weapon with a marine. Several markers pop up and all surviving marines approach his assigned trigger volume, which are where each of the markers are. The player picks up a fuel rod, walks over to one of the markers, presses the action button "e" to swap a weapon.

The game checks to see what weapons the player has before he switches. If he has a fuel rod as a primary and a pistol as a secondary, it will assign him an equipment profile of a battle rifle for a primary and a pistol for his secondary. I'll check how the duel-wielding weapons script works later to see how to do this part right. The marine will have a fuel rod weapon "attached" to his right hand. When the player leaves the trigger volume, the marine will wait there until the player starts leaving the room.

When the player starts leaving the room, the optional objective disappears. The marines are then swapped with marines that actually carry the given weapons, and then the marines follow the player-- the script is now turned off.

---------
Now, assuming this is all possible, the fact remains that a lot of one-time, single use encounters, trigger volumes, objects will have to be created, taking up a lot of space that could be used for something else. Does anyone have a logical solution to this that is more efficient (requires less scripting and single-use content) and effective?

---------
One last thing, not related to the above question: is it possible for a map to retrieve data from a previous mission that the player played? Like in Halo 2 when you ended the level with a sniper rifle, you might be able to carry it on into the next one, with the same ammunition level.

I'm thinking about this because my SP maps may be too big to put into one map file and I might need to split it up into several.
Edited by er449 on Feb 6, 2010 at 07:33 PM


SlappyThePirate
Joined: Aug 24, 2009

You are irritating, I'll release nothing


Posted: Feb 7, 2010 02:37 PM    Msg. 2 of 5       
There is a command, (objects_can_see_object -object -object -degrees) that I would use. The thing is, I can't find a script command for distance from an object. You would use this relative to the AI, like (objects_can_see_object (the player) (ai_actors AI) 2).


er449
Joined: Mar 28, 2007


Posted: Feb 7, 2010 03:51 PM    Msg. 3 of 5       
That sounds like a good idea. I know, there doesn't seem to be anything in the halo scripts that relates two object's distances from each other, well that is, not when it comes to true and false statements.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Feb 7, 2010 04:13 PM    Msg. 4 of 5       
Quote: --- Original message by: kirby_422
yes, donut is basicly on the right track of what I told you. you script setup every AI, 2 bipeds to monitor area around him, the starting equipment script using unit_get_health and sheild and set vitality to sync those numberz, and you can acleast make the ammo numbers closer, but a waste of time.

^
http://www.youtube.com/watch?v=himSOWVxzWI

Though after you do it, it doesn't seem worth it to try for everyone. In your post, you're looking for a method to do it for every AI in the cleanest way possible. However, it's not worth the time and effort to just be able to swap weapons with AI. It could be for a small test map, but in the end, it's not worth it. Though, don't let that discourage you from looking for a way.


er449
Joined: Mar 28, 2007


Posted: Feb 7, 2010 04:44 PM    Msg. 5 of 5       
Now how exactly did you set that script up?

Same method as I outlined above or different?

As for whether or not it's worth the time doing: I'm going to be scripting new events into my level, so it's likely to take hundreds, if not thousands, of hours to get through it all. That is, very few things will not be considered worth my time scripting.
Edited by er449 on Feb 8, 2010 at 01:17 PM

 

 
Previous Older Thread    Next newer Thread







Time: Fri January 20, 2023 4:04 AM 141 ms.
A Halo Maps Website