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 »Commands vs. Scripts

Author Topic: Commands vs. Scripts (33 messages, Page 1 of 1)
Moderators: Dennis

Mysterion
Joined: Aug 9, 2008

Nice shot, but too bad your @$$ just got SACKED!!!


Posted: Mar 20, 2009 01:34 PM    Msg. 1 of 33       
Having trouble with Elite jumping into their adjacent Banshee's. Initially I set commands for them to get into driver seat, but that didn't seem to work. I then set up scripts for the actor to to go to vehicle, and scripted the vehicle to be enterable which doesn't seem to work.

In Sapien, two out of three got into their Banshees, and flew to a battlefield, but when I compiled the scripts, saved, compiled and opened the map, they are just standing there. I shot one with a sniper rifle, and he respawned and got into the Banshee and attacked me. Could I possibly have conflicts between the script and command?

Last thing I tried late last night, was using load magic and one elite got into his Banshee_mp and flew to the battlefield and did everything he was supposed to do. Unfortunately, since the vehicle tag was a multiplayer, as soon as the elite died he magically reloaded into the undamaged Banshee and kept on flying...one reason I hate using load magic.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 20, 2009 06:52 PM    Msg. 2 of 33       
The alternative is unit_enter_vehicle. Attach a biped to the AI encounter, and it'll load magically into the vehicle. However, once the biped dies, it won't respawn, unless scripted to. Therefore, it won't load back in.

Syntax:


(unit_enter_vehicle [biped] [vehicle] [seat])


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 20, 2009 07:01 PM    Msg. 3 of 33       
Doesn't work, because even after they die, they'll still want to return to the vehicle. Even if it's a mile away, they'll walk there.


Mysterion
Joined: Aug 9, 2008

Nice shot, but too bad your @$$ just got SACKED!!!


Posted: Mar 20, 2009 08:45 PM    Msg. 4 of 33       
Ok, I want the AI to get into the Banshee, and when killed respawn at its start point, and then for the Banshee to respawn at its spawn point, and repeat again.

Banshees are named EB1, EB2 and EB3, and the Actors are named elitepilot1, elitepilot2 and elitepilot3.
Edited by Mysterion on Mar 20, 2009 at 08:47 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 20, 2009 08:56 PM    Msg. 5 of 33       
Oh. That's easy.


(script startup begin
(object_create [biped name])
(object_create [biped2 name])
(object_create [biped3 name])
)



(script continuous banshee_ai
(if
(and
(= (unit_get_health [biped name]) 0)
(= (unit_get_health [biped name2) 0)
(= (unit_get_health [biped name3) 0)
(begin
(object_create_anew [biped name])
(object_create_anew [biped name2])
(object_create_anew [biped name3])
(ai_attach [biped name] [ai encounter])
(ai_attach [biped name2] [ai encounter])
(ai_attach [biped name3] [ai encounter])
(unit_enter_vehicle [biped name] EB1 "B-driver")
(unit_enter_vehicle [biped name2] EB1 "B-driver")
(unit_enter_vehicle [biped name3] EB1 "B-driver")
)
)
)
)


What this does (or should do), is create 3 bipeds, attach them to an AI encounter, and load them into the banshee. When they die (all three of them die), they and the banshees respawn. To get this to work, replace [biped name], [biped name2], and [biped name3] with names of bipeds. Then, replace [ai encounter] with the name of the AI encounter. Set the AI encounter up with one squad, and set respawn min, max, and total to 0. Set the difficulty to 0 as well. All you have to set is the actor varient. The encounter doesn't even have to have respawn_enabled checked.

Edit: Missing parantheses.
Edited by Gamma927 on Mar 20, 2009 at 08:57 PM


Me KS
Joined: Feb 2, 2008

Desire is Reality. Xfire: jetmaster23


Posted: Mar 20, 2009 09:02 PM    Msg. 6 of 33       
Just change the (= (unit_get_health) ) tests to "<=", not "=". When bipeds don't exist, (unit_get_health) returns "-1", so the commands for that "if" statement wouldn't run at first if it was testing for just "0".
Edited by Me KS on Mar 20, 2009 at 09:02 PM


Mysterion
Joined: Aug 9, 2008

Nice shot, but too bad your @$$ just got SACKED!!!


Posted: Mar 20, 2009 09:26 PM    Msg. 7 of 33       
Should it not have EB1, EB2 and EB3 instead of three EB1s?
Edited by Mysterion on Mar 20, 2009 at 09:40 PM


MechWarrior001
Joined: Mar 13, 2007


Posted: Mar 20, 2009 10:24 PM    Msg. 8 of 33       
At the beginning of the Command list, add 'Set initiative: Disable", That will make them cooperate more, since they won't choose to disobey the CMD List after that's disabled.

After that, you can set a radius. After that, just add a vehicle command. Tell them to get in any seat and set their spawn points to use that CMD List. The "any seat" modifier will let them get in another seat in case the cockpit is occupied.

Also, there is a radius field in the vehicle command. Use it as a modifier for how close to the vehicle's they have to be before they can get in.
Edited by MechWarrior001 on Mar 20, 2009 at 10:30 PM


Mysterion
Joined: Aug 9, 2008

Nice shot, but too bad your @$$ just got SACKED!!!


Posted: Mar 20, 2009 10:58 PM    Msg. 9 of 33       
I had all these settings made under the command list, but selected allow targeting.

What do you mean by biped name, biped name2 and biped name3? Since I was using an elitemajor, they should all be elite.biped, correct?
Edited by Mysterion on Mar 20, 2009 at 11:50 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 21, 2009 01:31 AM    Msg. 10 of 33       
I'm sorry I couldn't explain fully. Yes, it should be EB1, EB2, EB3. Thanks for catching that. For bipeds, replace [biped name] with the name of the biped. When you place a vehicle, you can name it. Same with bipeds. [biped name2] is the name of the second biped, and so on so forth.


Mysterion
Joined: Aug 9, 2008

Nice shot, but too bad your @$$ just got SACKED!!!


Posted: Mar 21, 2009 02:06 AM    Msg. 11 of 33       
What if they are all the same type of biped I.E. elite.biped.


DarkZealot
Joined: Jan 1, 2008

Time management: 40% Xbox, 30% PC, 30% Skating


Posted: Mar 21, 2009 08:19 AM    Msg. 12 of 33       
Quote: --- Original message by: Mysterion
What if they are all the same type of biped I.E. elite.biped.


If you don't name them, you can't refer to them.

EDIT: Actually, you can, but it's a whole different story taking that path.
Edited by DarkZealot on Mar 21, 2009 at 08:19 AM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 21, 2009 10:35 AM    Msg. 13 of 33       
The type of biped doesn't matter. Think about it like dogs (wish I had one). Even if they're the same kind, you can call them by name. If you want one to come eat dinner, you can shout "Hey dog1, come eat dinner", and he might come, depending on how you treat him. Same with bipeds. Name the biped, refer to it.


Mysterion
Joined: Aug 9, 2008

Nice shot, but too bad your @$$ just got SACKED!!!


Posted: Mar 21, 2009 11:21 AM    Msg. 14 of 33       
Ok, where would you place each of the bipeds? next to the Banshee?


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 21, 2009 11:25 AM    Msg. 15 of 33       
Anywhere. They'll automatically load into the banshee.


Mysterion
Joined: Aug 9, 2008

Nice shot, but too bad your @$$ just got SACKED!!!


Posted: Mar 21, 2009 11:34 AM    Msg. 16 of 33       
Please forgive my ignorarance, but have never gone this route before using bipeds.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 21, 2009 11:36 AM    Msg. 17 of 33       
I can tell. It's perfectly normal. When I was learning, I asked a lot of questions as well.


Mysterion
Joined: Aug 9, 2008

Nice shot, but too bad your @$$ just got SACKED!!!


Posted: Mar 21, 2009 11:46 AM    Msg. 18 of 33       
I have stumbled through plenty of scripts while modding maps, but never worked with the bipeds like this.

Alright, I am getting an If Then Else problem when attempting to compile scripts...

(script startup begin
(object_create elitebiped1)
(object_create elitebiped2)
(object_create elitebiped3)
)
(script continuous banshee_ai
(if
(and
(<= (unit_get_health elitebiped1) 0)
(<= (unit_get_health elitebiped2) 0)
(<= (unit_get_health elitebiped3) 0)
(begin
(object_create_anew elitebiped1)
(object_create_anew elitebiped2)
(object_create_anew elitebiped3)
(ai_attach elitebiped1 elitepilot1)
(ai_attach elitebiped2 elitepilot2)
(ai_attach elitebiped3 elitepilot3)
(unit_enter_vehicle elitebiped1 EB1 "B-driver")
(unit_enter_vehicle elitebiped2 EB2 "B-driver")
(unit_enter_vehicle elitebiped3 EB3 "B-driver")
)
)
)
)
Edited by Mysterion on Mar 21, 2009 at 11:53 AM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 21, 2009 11:54 AM    Msg. 19 of 33       
Ok. Let me look at it. Try this:

(script continuous banshee_ai
(if
(and
(= (unit_get_health [biped name]) 0)
(= (unit_get_health [biped name2) 0)
(= (unit_get_health [biped name3) 0)
)
(begin
(object_create_anew [biped name])
(object_create_anew [biped name2])
(object_create_anew [biped name3])
(ai_attach [biped name] [ai encounter])
(ai_attach [biped name2] [ai encounter])
(ai_attach [biped name3] [ai encounter])
(unit_enter_vehicle [biped name] EB1 "B-driver")
(unit_enter_vehicle [biped name2] EB1 "B-driver")
(unit_enter_vehicle [biped name3] EB1 "B-driver")
)
)


Nicely formatted as well.


Mysterion
Joined: Aug 9, 2008

Nice shot, but too bad your @$$ just got SACKED!!!


Posted: Mar 21, 2009 12:08 PM    Msg. 20 of 33       
I had it indented, but after copying and pasting, it was all left-justified. How do you set the text box for scripts?


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 21, 2009 12:11 PM    Msg. 21 of 33       
On the forums? Or in Notepad? The formatting doesn't matter. It just helped me find out what's wrong. This script is correct. Replace the continuous script with it, but leave the startup alone.


Mysterion
Joined: Aug 9, 2008

Nice shot, but too bad your @$$ just got SACKED!!!


Posted: Mar 21, 2009 01:04 PM    Msg. 22 of 33       
Ok, it only works if you go and kill them first. They then load and fight, otherwise they just stand there like statues.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 21, 2009 01:06 PM    Msg. 23 of 33       
Oh right. The startup script. Replace the other startup script with this:

(script startup begin
(object_create [name of biped])
(object_create [name of biped 2])
(object_create [name of biped 3])
(ai_attach [name of biped] [AI encounter])
(ai_attach [name of biped 2] [AI encounter])
(ai_attach [name of biped 3] [AI encounter])
(ai_kill [AI encounter])
)

This should work...


Mysterion
Joined: Aug 9, 2008

Nice shot, but too bad your @$$ just got SACKED!!!


Posted: Mar 21, 2009 01:56 PM    Msg. 24 of 33       
We have success!









Thanks Gamma...Thanks to all you guys, I'm now making progress!


DarkZealot
Joined: Jan 1, 2008

Time management: 40% Xbox, 30% PC, 30% Skating


Posted: Mar 21, 2009 05:22 PM    Msg. 25 of 33       
:| That map is wayyyyyyy to open. I see no gameplay in it.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 21, 2009 06:17 PM    Msg. 26 of 33       
By the way, how did you get your scorpions to drive around?


Mysterion
Joined: Aug 9, 2008

Nice shot, but too bad your @$$ just got SACKED!!!


Posted: Mar 21, 2009 07:20 PM    Msg. 27 of 33       
So far its really fun! I just spawned the Spartans next to the tanks at their base, fixed seat names, changed some of the scorpion_mp.vehicle settings concerning AI. I set commands for the Spartans to get into driver seat, placed their move and firing points on the battlefield, and when I started the game, they joined the party!

My scripts include making the scorpion enterable, and for spartans to go to the vehicle. If one gets killed on the battlefield, and a Spartan happens to be on foot, he will climb in right there!
















DarkZealot
Joined: Jan 1, 2008

Time management: 40% Xbox, 30% PC, 30% Skating


Posted: Mar 21, 2009 07:22 PM    Msg. 28 of 33       
Mysterion, just advising you, if you want good AI that sync you should check out BF2... because making maps is done within the "Sapien" called BF2Editor.

And that map is open, I'll say it again. It's too open.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 21, 2009 07:27 PM    Msg. 29 of 33       
Add rocks. The ground alone is just fugly D= Maybe dead trees from Blood Gulch. Make it pretty.


Mysterion
Joined: Aug 9, 2008

Nice shot, but too bad your @$$ just got SACKED!!!


Posted: Mar 21, 2009 08:49 PM    Msg. 30 of 33       
I may do that...it supposed to be arid desert, but a few more rocks and maybe some dead trees here and there


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Mar 21, 2009 11:54 PM    Msg. 31 of 33       
No offense, but just a bland arid desert doesn't look very good. Looks almost as bad as MMT Sandtrap D= You should add some rocks and dead trees, to give it more of a "life used to exist here" feel. After all, there's a forerunner structure. Why would the forerunners want to build a building in the middle of a arid desert? Add some trees to make it prettier.


MechWarrior001
Joined: Mar 13, 2007


Posted: Mar 22, 2009 12:02 AM    Msg. 32 of 33       
You could also change some of the cubemaps and reflection properties used by the models & shaders to match the environment. For example:

Cyborg\shaders\armor.shader_model-

Reflection cube map: a50\bitmaps\reflection_desert_night

Perpindicular Color- R: 0.160784 G: 0.121569 B: 0.0862745

Parallel Color- R: 0.34902 G: 0.278431 B: 0.215686


This is just a example, but it can help to add to the map's theme. I'd definitely use it for the visor shader (visor.shader_model), since it's glass and (supposedly) reflects its surroundings, not just look yellowish-golden all the time.


Sandtrap had a good sand texture though. they used 2 detail maps, and a micro detail map, and I think lightmap was used for specular mask, not sure.
Edited by MechWarrior001 on Mar 22, 2009 at 12:15 AM


Mysterion
Joined: Aug 9, 2008

Nice shot, but too bad your @$$ just got SACKED!!!


Posted: Mar 22, 2009 01:13 AM    Msg. 33 of 33       
Awesome...I will try this!

I have done everything that you suggested, however I continue to get the same colors or the Spartan. Don't know what I am doing wrong here.
Edited by Mysterion on Mar 22, 2009 at 02:28 PM

 

 
Previous Older Thread    Next newer Thread







Time: Fri January 17, 2020 8:26 AM 485 ms.
A Halo Maps Website