Sunday, July 24, 2011

Scripting

I've been focusing on scripting for the "Hotel" level and found a good site that explains a lot: http://wiki.modsrepository.com/index.php/Call_of_Duty_4:_mapping_sp.

Initially, I had a lot of trouble with getting the level started with weapons. I took the killhouse level scripts and removed the killhouse references because I received a series of errors that occurred while trying to run the level with this script.

After that, I thought I declared all the weapons' xmodels and weapons, but everything started working after I added the "fx,shellejects" to the csv file. My biggest problem was with the mp5: COD4 SP starts with the mp5 as the default weapon. Even after declaring all the view models, I would receive the error "Unknown weapon mp5". It seems the fx solved this, but I was not completely sure.

Lastly, when the level is started in the compiler, it results in a SRE: Assert Fail. The solution is to begin the level in the COD4 SP executable.

Either way, the level would load and I would have a weapon. I added covernodes first and the enemies would take cover near the back of the hotel. When I added pathnodes, the enemies began to run around taking cover to my delight. My only complaint is that they begin this too early - I would love them to wait until the player takes out the first guard and then begin darting all over the place. Also, if the player decides to go up the fire escape, all the allies funnel into the second bedroom pretty stupidly.

Next, I added objectives in my script which worked really well and guided the player where I wanted them to go. I think some text only dialog would drive home the directions and the fact the player has two paths to the top.

My next steps are to try to get autosaving to work, to have my Widow ally to move to the roof with you, and keep the third floor allies in position until the player arrives at the third floor (probably by spawning them in).

No comments:

Post a Comment