OneTrueForky Posted April 18, 2012 Share Posted April 18, 2012 So I'm trying to make a companion, using in part my knowledge of the system (It's not the best in the world, but I can get around), and Foxtrot Zulu's tutorial. Now, towards the bottom, there's some code. First code worked fine, no syntax errors or anything of that nature. However, when I'm trying to make the End Result Script, I keep getting an annoying error. A very, very annoying error that says mean things about my heritage and well-being. Anyways, the scripts are: TOP: The tutorial's script. BOTTOM: My script. Following me? Okay, good. set MyCompanionQuest.Status to 1 OldAndyRef.evpset 00MURPHYDIALOGUE.Status to 1 00NPCMURPHY.evp Now, the quest I.D. "00MURPHYDIALOGUE" is correct. As is the code for the NPC it's supposed to affect. No spelling errors, nothing. Everything is exactly as it should be. Yet, it doesn't work. At all. I can answer any questions you may have about the mod I'm working on, as well as any information you may need to help me, should you choose to. Because apparently 15+ pages of Google can't seem to tell me anything. Thank you, -OneTrueForky Link to comment Share on other sites More sharing options...
rickerhk Posted April 18, 2012 Share Posted April 18, 2012 00MURPHYDIALOGUE Never use numerics to prefix a reference. The script compiler will mistake it for a FormId. It's good practice to just not prefix anything at all with numerics. Link to comment Share on other sites More sharing options...
OneTrueForky Posted April 18, 2012 Author Share Posted April 18, 2012 (edited) I usually just use numbers to make it so I can find them right at the top of the lists. D'oh! Thanks, though! Much obliged. Now to get used to another naming convention. Yay. -OneTrueForky EDIT: After some tinkering, I fixed the script. Please ignore this post. Unless you wish to make fun of my poor script skillz. In which case, that's just not nice and you make pandas sad. Edited April 18, 2012 by OneTrueForky Link to comment Share on other sites More sharing options...
OneTrueForky Posted April 18, 2012 Author Share Posted April 18, 2012 So, I changed "00" to "AA", and now it's saying that: "SCRIPTS: Script 'Default Compiler', line 2:Syntax error. Invalid reference 'AANPCMURPHY' (only object references and reference variables are allowed in this context). So what did I muck up now? -OneTrueForky Link to comment Share on other sites More sharing options...
vforvic Posted April 19, 2012 Share Posted April 19, 2012 ...Unless you wish to make fun of my poor script skillz. In which case, that's just not nice and you make pandas sad.Well I don't like Pandas so I'm just going to make fun of your script....seriously before anyone has a stroke I really do like Pandas....I even have 3 stuffed ones in my Den. I'm kidding people. Seriously though. The most likely reason for the error, and I say most likely because with the Geck you never know, is because when you changed the name from "00" to "AA" in the script you did not change the NPC's Reference Name that it points to and it still has the old name. Instead of giving you an obvious error of no such Reference found it just gives you that generic Reference error. The other reason could be you are not actually using the References name, but instead are using the NPC's ID which is a no no. I always put REF after References so I can keep the NPC ID's and NPC References more or less only slightly messed up. :) Link to comment Share on other sites More sharing options...
OneTrueForky Posted April 20, 2012 Author Share Posted April 20, 2012 ...Unless you wish to make fun of my poor script skillz. In which case, that's just not nice and you make pandas sad.Well I don't like Pandas so I'm just going to make fun of your script....seriously before anyone has a stroke I really do like Pandas....I even have 3 stuffed ones in my Den. I'm kidding people. Seriously though. The most likely reason for the error, and I say most likely because with the Geck you never know, is because when you changed the name from "00" to "AA" in the script you did not change the NPC's Reference Name that it points to and it still has the old name. Instead of giving you an obvious error of no such Reference found it just gives you that generic Reference error. The other reason could be you are not actually using the References name, but instead are using the NPC's ID which is a no no. I always put REF after References so I can keep the NPC ID's and NPC References more or less only slightly messed up. :)I found that one out on my own. I actually smacked myself in the forehead for not thinking of that first. Although I'm not entirely sure why it wouldn't just use the NPC's ID, I understand the 00 part, though. Don't worry, everything is fixed and well on it's way to being completed. :) -OneTrueForky Link to comment Share on other sites More sharing options...
vforvic Posted April 20, 2012 Share Posted April 20, 2012 Glad you got it worked out. Just for the sake of making sure making this thread is more or less complete when others view it at a later date I will try to explain why you can't use the NPC's ID. The NPC ID itself can point to many "References" of that NPC in the game world. Raiders are a good example of this. When you make a new NPC, or any Item, in the GECK you give it a ID. At this point that NPC or Item is not in the game world. So lets say you made a Ninja that you want to Ambush the Player at various locations the Player visits and you gave it an ID of Ninja. And you also made a new type of Ninja Landmine to use at these locations and called it Mine. Say you want this ambush to happen at 12 places so you drag and drop this Ninja into the 12 spots in the game world and add 3 new Landmines per location. Now to be able to control all these 12 Ninjas and now 36 Landmines with Scripts you have to be able to tell them apart and that is where Reference Names come into play. You could not just use a script to tell the Landmines and Ninjas to enable and attack at a certain Marker or some other Variable via the NPC and Item ID because that would effect all 12 Ninjas and 36 Landmines at the same time. You have to be able to say something like NinjaREF01 enable and attack when the Player enters Trigger Area A and MineREF01, MineREF02, MineREF03 enable when Player kills NinjaREF01. That is not real scripting by the way, but a general example. Then later at another location you can say something like NinjaREF02 enable and attack when the Player enters Trigger Area B and MineREF04, MineREF05, MineREF06 enable when Player kills NinjaREF02. This way you can better control when things happen in the game world. Now I know what your thinking. Why won't the GECK let me just make 12 duplicate Ninjas and 36 Landmines which would then have unique NPC and Item ID's and then I could use those in Scripts as well as Reference Names. Trust me the GECK is doing you a favor by not letting you go down that long road. So lets say the GECK did let you use both REF Names and NPC - Item ID's in scripts. It would be total chaos. Imagine having a large mod with lots of Scripts and Custom NPC's and New Items and Quests and your looking through all that code in all the locations you can use Scripts to try to figure out why something is not working. Did I use the Ref Name here or was that the NPC ID? Does this Script that refers to this Quest use the same ID type? What if I have another mod I am using as a Master? Then I have to look through all that code to see what that Author did so I can point to the correct Names or ID's. On no I want to make a tiny change in my Ninja Landmine and I have to do it in all 36 Landmines. This is one of the rare cases where the GECK is doing us a favor by not letting us do something. Link to comment Share on other sites More sharing options...
OneTrueForky Posted April 20, 2012 Author Share Posted April 20, 2012 You know what? That actually makes a lot of sense. Never thought of it like that. Your post alone should be stickied or something. Not knowing that could cause a lot of headaches (it certainly did for me!). -OneTrueForky Link to comment Share on other sites More sharing options...
Recommended Posts