petreehammer Posted September 7, 2007 Share Posted September 7, 2007 I have been desparately trying to add a script for a new pet into the Cheydinhall Pet Shop Mod. This program was Coded/created by Lady Eternity with Tester Proudfoot. It has worked great for me and I give all the credit to them in writing this enjoyable mod. My son wanted to have a "hunger" as a pet. I am new to scripting and naively thought I could just take one of the scripts for an existing pet, like the "red imp", and change all the "imp"s and "Mork"s to "hunger"s.I worked out many of the error messages by trial and error, but one particular error message keepscoming up repetitively. The first example of this error occurs when the following line: PSPImpRef.MoveTo Player 28 0 0 is changed to: PSPHungerRef.MoveTo Player 28 0 0 This results in the error message: Syntax error. Invalid Reference 'PSPHungerRef' (only object references and reference variables are allowed in this context). Another error that occurs with my modification of the original script reads: Item 'PSPHungerTeleport' not found for parameter Object ID. This message appears when I change the following lines to contain "PSPHungerTeleport" instead of "PSPMorkTeleport" : elseif ( HungerButton == 3 ) if ( Player.GetItemCount PSPMorkTeleport <= 0 ) Message "A toy? You are kidding right? Haha. Just so happens I DO have a momento from a past Master. Maybe you can play fetch with yourself or something." Player.AddItem PSPMorkTeleport 1 Set HungerButton to -1 Set HungerChoice to 0 Activate Return Another probably similar error reads: Item 'PSPHungerMS5' not found for parameter Object ID. It occurs when change the following lines to contain "Player.AddItem PSPHungerMS5 1" instead of"Player.AddItem PSPMorkMS5 1": if ( SleepToggle == 1 ) if ( Player.GetLevel >= 5 ) if ( HGrowsmall == 0 ) Message "Master! I think I got a bit bigger! Maybe soon I will learn new spells." SetSize 0.50 Set HGrowsmall to 1 Player.AddItem PSPMorkMS5 1 Set SleepToggle to 0 endif endifendif I could be wrong, but feel that these could all be fixed by an easy entry somewhere else in the program that I am missing. Any help will be greatly appreciated. Link to comment Share on other sites More sharing options...
Vagrant0 Posted September 7, 2007 Share Posted September 7, 2007 First, this is all done with the petshop mod loaded as the active mod in the CS right? If not, you'll have to redo some work since mods can't reference things in other mods (normally) only things in .esm files can be referenced by mods. Second, anywhere it's asking for a reference, it requires something placed in the world and named with that reference, unless that reference is named somewhere within the script. 'PSPHungerRef' would be a placed creature with the appropiate AI placed in the world (somewhere) that is a persistant reference and named. Mork appears to be an itemtype (as in inventory), not the placed creature, probably used to control the placing of the creature, or something else (check out the item for any additional scripting). Without seeing more of the script, there really isn't much else to say as far as fixing the problem. However, creating any sort of pet mod can be rather complicated, even when you're using someone else's scripts. You might want to learn more about how scripts are put together and what things are in the CS before doing something like this. Also, since you are using someone else's work as a basis, you shouldn't plan on uploading the mod anywhere without first getting permission to do so. Link to comment Share on other sites More sharing options...
petreehammer Posted September 8, 2007 Author Share Posted September 8, 2007 First, this is all done with the petshop mod loaded as the active mod in the CS right? If not, you'll have to redo some work since mods can't reference things in other mods (normally) only things in .esm files can be referenced by mods. Second, anywhere it's asking for a reference, it requires something placed in the world and named with that reference, unless that reference is named somewhere within the script. 'PSPHungerRef' would be a placed creature with the appropiate AI placed in the world (somewhere) that is a persistant reference and named. Mork appears to be an itemtype (as in inventory), not the placed creature, probably used to control the placing of the creature, or something else (check out the item for any additional scripting). Without seeing more of the script, there really isn't much else to say as far as fixing the problem. However, creating any sort of pet mod can be rather complicated, even when you're using someone else's scripts. You might want to learn more about how scripts are put together and what things are in the CS before doing something like this. Also, since you are using someone else's work as a basis, you shouldn't plan on uploading the mod anywhere without first getting permission to do so. Thanks Vagrant0 for the info about references. To fix the PSPHungerRef problem, I just had to go the the one Hunger that I was placing in the game and give it the Reference Editor ID 'PSPHungerRef'. As for the PSPHungerTeleport problem, I found an item under Items\MiscItems\Dungeons\Misc that had been created for each of the pets. Took the PSPImpTeleport and copied it into a new script where changed all the Imps and Morks to Hunger. Finally, the PSPHungerMS problem was solved when I found the original pet files in the 'Books' section.Then just took PSPMorkMS5 and changed all Imps and Morks to Hungers. Ditto PSPMorkMS10,15,20,25,30. Went through all other scripts in the mod and made sure there was something for Hungers whereever applicable. And finally, finally, as I mentioned in my original post, I give all the credit to the original creators of this cool mod and would never upload it without permission. Thanks again for helping me get through this. Maybe I can put off that OCD medicine a little while longer. Link to comment Share on other sites More sharing options...
PanzerOfGod Posted September 8, 2007 Share Posted September 8, 2007 You say you changed them? You made new forms, correct? Link to comment Share on other sites More sharing options...
petreehammer Posted September 10, 2007 Author Share Posted September 10, 2007 You say you changed them? You made new forms, correct? No new forms except the new hunger form that I called 'PSPHunger' so that thehunger that I inserted in the game would not change any other hungers in the game. What I changed was the words within the script. Since I don't know how to writea script, I just picked the existing pet from the mod that had spells that I liked. I took the 'Imp' script and copied it to a new script that I named for my 'Hunger'.Not only did I change the word 'Imp' to 'Hunger' in every instance within the script, but I also changed the word 'Mork' to 'Hunger' in each instance also. That is because there was an item for the 'Imp' which had been named with 'Mork' (instead of 'Imp'). Link to comment Share on other sites More sharing options...
Vagrant0 Posted September 10, 2007 Share Posted September 10, 2007 You say you changed them? You made new forms, correct? No new forms except the new hunger form that I called 'PSPHunger' so that thehunger that I inserted in the game would not change any other hungers in the game. What I changed was the words within the script. Since I don't know how to writea script, I just picked the existing pet from the mod that had spells that I liked. I took the 'Imp' script and copied it to a new script that I named for my 'Hunger'.Not only did I change the word 'Imp' to 'Hunger' in every instance within the script, but I also changed the word 'Mork' to 'Hunger' in each instance also. That is because there was an item for the 'Imp' which had been named with 'Mork' (instead of 'Imp').I believe Panzer's concern is that changing the properties of a reference or the arrangement of an existing script, rather than making duplicates of those things and then changing the duplicates can lead to some issues with certain mods. In this case it isn't so much an issue since you wanted to replace the imp with the hunger. But if you wanted to just add the hunger to the list of pets, and not change any of the existing ones, you would have to use new formsand scripts, not change existing ones. You would probably still have to make adjustments to one of the major scripts either way. It's nothing major, it's just one of those mistakes people tend to make, and it ends up screwing over their games. Sometimes you want to edit existing things, sometimes you don't. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.