View Full Version : duel wieldable plasma rifles
HCS09
July 29th, 2009, 09:10 PM
I'm working on the Silent Cartographer map, trying to rewrite some elements in the script (mostly extending the gameplay in that level) and by adding more variation (like more enemy types to fight).
I've seen a few dual-wieldable weapons, but no plasma rifle-plasma rifle combos. It's pretty important if I want to make my elite ultras formidable (swords just won't do). Has anyone done, either made their tags available or have chosen not to protect their map, a plasma rifle-plasma rifle combo? Better yet, a Halo 3 version? I've tried modeling before and regardless of the simplicity, it is definitely not my strong point.
By the way, I'm going to see if I can make a script that will cause a high-ranking elite to berserk and switch to their sword when their health approaches a certain value...possible?
Inferno
July 29th, 2009, 09:12 PM
1. It's not that hard to make a 3rd person only dual wieldable plasma rifle that disappears on drop.
2. No. Ai's can't change weapons. You could possibly do it if you REALLY wanted to script every single elite but I doubt you want to.
teh lag
July 29th, 2009, 09:14 PM
I'm working on the Silent Cartographer map, trying to rewrite some elements in the script (mostly extending the gameplay in that level) and by adding more variation (like more enemy types to fight).
I've seen a few dual-wieldable weapons, but no plasma rifle-plasma rifle combos. It's pretty important if I want to make my elite ultras formidable (swords just won't do). Has anyone done, either made their tags available or have chosen not to protect their map, a plasma rifle-plasma rifle combo? Better yet, a Halo 3 version? I've tried modeling before and regardless of the simplicity, it is definitely not my strong point.
By the way, I'm going to see if I can make a script that will cause a high-ranking elite to berserk and switch to their sword when their health approaches a certain value...possible?
1) I have my old (2006) crappy tags for dual PRs that CMT was using for a while (though they ONLY work on elites). I'll gladly upload them for you tomorrow when I have time to track them down on my HDD, but you may be better off making your own as mine are... well... crappy since they're 3 years old by now.
2) I do not believe you can change the weapon an actor_variant is holding mid-game via script or otherwise.
Inferno
July 29th, 2009, 09:20 PM
Actually lag. If you scripted the elite into its own in encounter and had a SECOND elite off to the side holding the sword you could continually check the health of the PR elite and when his health got low enough you would object attach the sword elite to the PR elite then detach them then object_destroy the pr elite leaving the sword elite in its place.
Theoretically.
HCS09
July 29th, 2009, 09:32 PM
Now... if there was a command that took away the current weapon of an elite, then it might work pretty well.
This is what I've come up with so far...it's got a few flaws I need to correct though.
(if (= 0 (unit_get_shield (ai_actors test/angry ))) (begin (ai_berserk test/angry 1 )(objects_attach (ai actors ai_berserk test/angry 1 ) "right hand" angry_sword "" )))
I think this needs a global to keep this script from running infinitely when the elite loses his shield...
Also, I doubt attaching a sword to him makes it wieldable.
Also, I think it will show him wielding the plasma rifle in his hand at the same time.
1) I have my old (2006) crappy tags for dual PRs that CMT was using for a while (though they ONLY work on elites). I'll gladly upload them for you tomorrow when I have time to track them down on my HDD, but you may be better off making your own as mine are... well... crappy since they're 3 years old by now.
2) I do not believe you can change the weapon an actor_variant is holding mid-game via script or otherwise.
Sure, I'm far from getting this map finished, so I would like something to help guide the gameplay-style decisions I need to make along the way.
Edit: accidentally pressed the reply button for this edit.
So... my best guess to converting an AI reference is...
w00t! got a small issue solved: converting an AI reference to a unit:
unit_get_health (unit (list_get (ai_actors test/angry ) 0))
Edit: player_add_equipment doesn't seem to work for non-players... even though the slot is for a "unit"
English Mobster
July 30th, 2009, 06:22 AM
You don't attach the SWORD, you attach the OTHER ELITE.
Since it's a new actor, you won't have to worry about the sword not being weldable.
Masterz1337
July 30th, 2009, 12:15 PM
There's a much ebtter and easier way to go about doing this. I havent tried it myself but I see now reason why it wouldn't work.
(player_add_equipment <unit> <starting_profile> <boolean>)
I see no reason why this wouldn't work instead.
teh lag
July 30th, 2009, 12:20 PM
There's a much ebtter and easier way to go about doing this. I havent tried it myself but I see now reason why it wouldn't work.
(player_add_equipment <unit> <starting_profile> <boolean>)
I see no reason why this wouldn't work instead.
Edit: player_add_equipment doesn't seem to work for non-players... even though the slot is for a "unit"
I believe the unit must be a player.
HCS09
July 30th, 2009, 02:47 PM
I tried it in two ways:
First, I made an elite biped with no weapons, "lol"
I made two different elite encounters (with a squad and starting point for both) called "test1" and "test2"
I made two starting profiles: one with a sword and one with a plasma rifle, called "swap1" and "swap2"
Using Sapien's devmode feature, I took lol and attached the test1 encounter. I used the player_add_equipment command on lol (assuming that the elite biped is a unit). I tried the "true" and "false" for the third parameters, but neither worked. I then tried to apply the command on the test1 encounter (using the correct commands to convert the encounter to a unit), but this, too, failed.
I assumed it must be that the elite must switch weapons for them to show up, but when I used the command on myself (giving myself no weapons), I didn't need to swap!
So close!
*************
It works on the player as expected, even if I become the biped I'm trying to script. Is there anything I can check off, or any trick I can do to trick the game into thinking the biped is a player?
Epsilon927
August 1st, 2009, 10:32 AM
You want to do something like this, assuming the AI encounter only has one person.
(sleep_until (= (unit_get_shield (ai_actors [AI ENCOUNTER])) 0) 15)
(object_attach "lol" "" (unit (list_get (ai_actors [AI]) 0)) "")
(object_detach "lol" (unit (list_get (ai_actors [AI]) 0))))
(ai_attach "lol" [AI])
(unit_kill (unit (list_get (ai_actors [AI]) 0)))
Then something that makes "lol" have no shields.
Inferno
August 1st, 2009, 01:57 PM
That's what I said except make it destroy the ai not kill it. It'll look more clean when it switches.
Also you will have to use (unit_set_maximum_vitality <unit> <short> <shot>) for the health. Just set the shields to 0 and the health to like 200 or something.
HCS09
August 1st, 2009, 07:02 PM
Oh great, I'll try that out. Thanks! I have to finished scripting another part, then I'll post a video of it.
teh lag
August 1st, 2009, 07:15 PM
In case you're still interested :
http://tehlag.modacity.net/one/notpix/dual_plasma_rifles.rar
There's probably a few references to CMT tags in there... and like I said, they're pretty crappy, even for AI-only applications. You will need to do some editing to the elite's animation tag and add another weapon block that attaches the left hand to the "left hand elite" marker and takes the "dw" weapon label. But you seem smart enough to figure that out yourself :p
HCS09
August 1st, 2009, 08:56 PM
I'll try that, thanks!
By the way, I've written the script for the berserking elite. I haven't tested the script as a whole out yet, but it worked line-by-line in sapien. To improve game performance, the berserking script will be dormant until the ultra elite is placed. It will be dormant again after the mission script is finished, or when the elite is killed.
The script I'm using doesn't require a biped, so there won't be a need of a special biped or a unit_set_current_vitality command. After I get the elite's armor color fixed, I'll do a few more adjustments to the scenario, compile it, and record it for you all to see.
Edit: It works!
Video:
ujkwgGCSNlU
Script: (sleep_until (>= 0 (unit_get_shield (unit (list_get (ai_actors ultra/beach_norm ) 0)))) 15)
(ai_place ultra/beach_rage )
(objects_attach (list_get (ai_actors ultra/beach_norm ) 0) "left foot elite" (list_get (ai_actors ultra/beach_rage ) 0) "left foot elite" )
(objects_detach (list_get (ai_actors ultra/beach_norm ) 0) (list_get (ai_actors ultra/beach_rage ) 0))
(ai_erase ultra/beach_norm )
(sound_impulse_start sound\dialog\elite\conditional\combat2\exclamation s\berserk none 3 )
(ai_command_list ultra/beach_rage ultra_berserk )
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.