|
Post by Spirithawke on Dec 20, 2012 16:56:45 GMT
I know it has been awhile since I last did any scripting and that there have been lots of changes, however most of those changes appear to be well documented in MWSfD (Morrowind Scripting for Dummies v9). So far I have run across 2 variables in companion scripts that puzzle me and are NOT documented in MWSfD or the CS. set noGreet to 0 AIFollow Player 0 0 0 0
set noGreet to 1 AIWander 300 0 0 0 0 set noSay to 1 StartCombat aa_comp_constance set noSay to 0 noSay is a global short created by the scriptor noGreet is not declared anywhere Making educated guesses as I can find nothing documented anywhere about either one of these: noSay is an undocumented way to prevent the actor from saying one of it's combat speeches. noGreet is an undocumented way to prevent the actor from using a greeting when the player gets within greeting distance. Am I correct? Edit: Geez yer fast Jac I was not done with the second post yet. noGreet and noSay are both used by Beryl, Constance uses just noSay.
|
|
|
Post by Jac on Dec 20, 2012 17:01:42 GMT
I've never heard of either of those variables, so I'm assuming that they were declared specifically for whatever mod they appear in. There is no filter for a noGreet variable in NPC greetings that I've seen so I don't think it's an original variable like noLore.
[edit]: I would have to look at the mod(s) in question to be absolutely sure though.
|
|
|
Post by Spirithawke on Dec 20, 2012 17:11:20 GMT
if ( GetCurrentAIPackage == 3 ) if ( flyCheck == 1 ) if ( GetWeaponDrawn == 0 ) set z_fly to ( Player->GetPos z ) SetPos z z_fly elseif ( flyCheck == 1 ) if ( GetCurrentAIPackage != 3 ) if ( GetWeaponDrawn == 0 ) set z_fly to ( GetPos z ) SetPos z z_fly endif endif endif endif endif The above code fragment really kills me. Everything ABOVE the elseif is logical...everything below the elseif can never happen as to even get checked you would have to be following the NPC and yet there is that if ( GetCurrentAIPackage != 3 ) nested inside the if ( GetCurrentAIPackage == 3 ) statement. The two statements are mutaully exclusive, so why is one inside the other? Heck...everything that is part of the elseif bothers me from a logic standpoint. Can someone explain to me what is going on here?
NOTE: This is out of Beryl's script as I downloaded her from this site.
|
|
|
Post by Jac on Dec 20, 2012 21:44:23 GMT
Beryl is a very old companion, so I'm not surprised that some of the scripting doesn't make much logical sense. I believe that second flyCheck should be looking for it to be zero and not one. Looks kind of strange, though, because it's getting the Z postion, then putting the NPC at that same position. I would look at more modern companions like Julan and Jasmine for scripting though, because companion scripting has come a ways since Grumpy released his 3.1 kit.
|
|
|
Post by Spirithawke on Dec 21, 2012 20:07:45 GMT
Thanks Jac for the suggestions. I have looked at Julan's main script and it is almost identical to Beryl's for the main stuff (even has that annoying code fragment I posted about earlier), so that one is a wash (note I am ONLY commenting on the main scripts and NOT the rest of the mod before someone takes umbrage), Jasmin's main script on the other hand has given me a couple things to think about. I was hoping that Constance's script would be useful as well, as Constance, Julan, and Jasmin appear to be the most recent of the companion mods. But let us say I have issues with that script too and leave it at that. Are there any other companion scripts out there more recent (and well written) than those three?
|
|
|
Post by Jac on Dec 22, 2012 14:53:11 GMT
I'm not sure what problems you're referring to, but Julan was built using Grumpy's companion template and Jasmine's script was based on that, but with changes. Unfortunately I don't know of any other companion scripts that would be very different because there's only so much the engine can handle. That and scripting isn't like dialog: there's only a few ways to go about accomplishing the same thing. The other problem is that there really haven't been many companions that have been released outside of what Kateri and I have done that I've seen. I've seen a few WIPs, but nothing that really came out of them. I was working with someone on a Breton alchemist, but I don't think he ever finished it. Still, I think he was mainly working on giving her the ability to create throwing potion-bombs and not changing the follow script.
|
|