Frustration, Then a Partial Rebound
Of the things I hate, one of them is not knowing how to do something I need to do, and another is not being able to figure out why something isn't working, especially when it looks like it should. That pretty much defined the first part of working on the module today. I wanted to write a single script that would destroy some of the items on the starting PC, then give him new items, and then finally equip those items. I didn't think it would be two hard; I already had one script to handle the item creation and another to handle the equiping of said items (albeit in seperate places), and they both worked, and the DestroyObject command looked pretty simple. Plus, the module I'm currently playing does the same thing, so I went in and copied the script the author used.
It turned out to be not easy ast all. The script from the module destroyed all the items, and I didn't want to destroy the PC's healing potions, so I added some code to create them along with the other items, but it didn't work. Also, I couldn't figure out how to combine the scripts - no matter what I tried, the PC wouldn't equip the items. So I had to split them again, and this time, since all the items were being destroyed in the first area, and the PC doesn't equip until the next area, there's a moment where he appears in his underwear, which was not what I wanted. And I still couldn't create the potions either. This put me in a very bad mood.
After taking a break for a while, I decided to try Lilac Soul's script generator. It couldn't write the full script, but I did have it write me a script to destroy a specific item. Then I replaced the destroy everything code with those lines, and it worked. In one stroke that solved both the potion and the nudity problem. I still have two scripts instead of one, and there's also a weird fluke where it looks like the PC hasn't equiped his armor even though he has, but at least it all works.
The next step was to put in a command to return to camera to top-down mode after the cutscene, since sometimes it would start the next scene in chase mode, with the camera right up against the PC's back. I don't know for sure if it worked, but so far, the camera has started in top-down mode every time, so I consider it a success. Next, I started tinkering with the first area (after the cutscene), in which a band of goblins and orcs attacks a group of peasants. I figured out how to make the peasants randomly say things when they're hit only 25% of the time (though in retrospect that's unnecessary, since they generally die after one hit). I also figured out how to fire a specific animation when they fall under attack. In the process I learned how to set multiple user-defined events and something about how the switch command works, though I ended up not needing it, since I decided to have both the speaking and the animation happen when the PC gets attacked. However, I couldn't figure out how to make some of the peasants not fight back. They're supposed to cower, but instead, I've got children and old people beating up goblins. I already asked about this on the forums, and I don't know why this won't work.
Finally, I did a lot of tweaking and fine tuning, and generally put in all the peasants and bad guys that I want in the scene. It's tough balancing it out though: presuming the PC acts, I want most of the peasants to survive. However, with too few monsters, they win too easily, and the PC doesn't have to help. Too many monsters, and most of the villagers get slaugtered, even when the PC does help. Also, while the peasant leader should die if the PC doesn't intervene, I do want to keep him alive as much as possible, since he gives a reward to the PC, and, in theory, other stuff will trigger off of him. Come to think of it, I should probably just make him unkillable, since I also need him to have a conversation that will trigger a journal update.
I checked the forum when I was done, and SirElric had written up a script that handled my problem. Unfortunately, although I'm sure it works, the scripting is too advanced for me to understand, which bums me out. However, I saw how he combined item creation with item equiping, so I can probably use that to turn my two scripts into one. Also, he explained why the potions weren't being created, although again, I don't entirely get it.
Looks like CEP 2.0 won't be out for a few more weeks. That's a bummer, because I basically have to use placeholder creatures until it does. I can't change the appearance of the Uruk-Hai, and I don't want to use the regular orcs, and there's no point trying to merge the hobgoblins hak now, since it might not work with CEP 2.0 (or the CEP might have something I can use, which would make importing something else a waste of time).
It turned out to be not easy ast all. The script from the module destroyed all the items, and I didn't want to destroy the PC's healing potions, so I added some code to create them along with the other items, but it didn't work. Also, I couldn't figure out how to combine the scripts - no matter what I tried, the PC wouldn't equip the items. So I had to split them again, and this time, since all the items were being destroyed in the first area, and the PC doesn't equip until the next area, there's a moment where he appears in his underwear, which was not what I wanted. And I still couldn't create the potions either. This put me in a very bad mood.
After taking a break for a while, I decided to try Lilac Soul's script generator. It couldn't write the full script, but I did have it write me a script to destroy a specific item. Then I replaced the destroy everything code with those lines, and it worked. In one stroke that solved both the potion and the nudity problem. I still have two scripts instead of one, and there's also a weird fluke where it looks like the PC hasn't equiped his armor even though he has, but at least it all works.
The next step was to put in a command to return to camera to top-down mode after the cutscene, since sometimes it would start the next scene in chase mode, with the camera right up against the PC's back. I don't know for sure if it worked, but so far, the camera has started in top-down mode every time, so I consider it a success. Next, I started tinkering with the first area (after the cutscene), in which a band of goblins and orcs attacks a group of peasants. I figured out how to make the peasants randomly say things when they're hit only 25% of the time (though in retrospect that's unnecessary, since they generally die after one hit). I also figured out how to fire a specific animation when they fall under attack. In the process I learned how to set multiple user-defined events and something about how the switch command works, though I ended up not needing it, since I decided to have both the speaking and the animation happen when the PC gets attacked. However, I couldn't figure out how to make some of the peasants not fight back. They're supposed to cower, but instead, I've got children and old people beating up goblins. I already asked about this on the forums, and I don't know why this won't work.
Finally, I did a lot of tweaking and fine tuning, and generally put in all the peasants and bad guys that I want in the scene. It's tough balancing it out though: presuming the PC acts, I want most of the peasants to survive. However, with too few monsters, they win too easily, and the PC doesn't have to help. Too many monsters, and most of the villagers get slaugtered, even when the PC does help. Also, while the peasant leader should die if the PC doesn't intervene, I do want to keep him alive as much as possible, since he gives a reward to the PC, and, in theory, other stuff will trigger off of him. Come to think of it, I should probably just make him unkillable, since I also need him to have a conversation that will trigger a journal update.
I checked the forum when I was done, and SirElric had written up a script that handled my problem. Unfortunately, although I'm sure it works, the scripting is too advanced for me to understand, which bums me out. However, I saw how he combined item creation with item equiping, so I can probably use that to turn my two scripts into one. Also, he explained why the potions weren't being created, although again, I don't entirely get it.
Looks like CEP 2.0 won't be out for a few more weeks. That's a bummer, because I basically have to use placeholder creatures until it does. I can't change the appearance of the Uruk-Hai, and I don't want to use the regular orcs, and there's no point trying to merge the hobgoblins hak now, since it might not work with CEP 2.0 (or the CEP might have something I can use, which would make importing something else a waste of time).
0 Comments:
Post a Comment
<< Home