thebigba Posted January 4, 2009 Share Posted January 4, 2009 Lets begin with the noobiest of questions... I am in the process of learning how to script...using variables how and when they should be used is a guessing game for me at this point... I have read the wiki but I seem to not be getting it or they seem to not be going into enough detail for me... so here is my noob script to help me learn about messagebox scn mytest short buttonshort why begin onactivate if why == -1Messagebox "whatever" "yes" "no"set why to 1set button to getbuttonpressed im going to stop here right now because I just realized that I should have added to this script a gamemode block .... okay lets try this again scn testcrap short whyshort buttonref me begin onactivate set why to 1if why == 1messagebox " whatever" "yes" "no"set why to -1endifend begin gamemodeset button to get button pressed if button == 0me.advlevel 2elseif button == 2endif end okay and this works great... I click the ring i added the script to and the message shows up i click yes and then i advance a level... i then chosee all my three upgrades and click exit... then the game freezes for a minute or 2. I know my script is causing it somehow , and that is must have something to do with frame rate.some advice please? Link to comment Share on other sites More sharing options...
thebigba Posted January 4, 2009 Author Share Posted January 4, 2009 I have a new problem , and I cannot for the life of me figure out why this is happening.This is pertaining to my companion riding a horse and following me on said horse. I have placed a horse in her dummy cell, I gave the horse the reference name of lynhorserefI have placed a marker heading in the room and gave it the reference name of lynhorsemovetoref well this is no problem she summons the horses just fine , and send them back to the dummy cell just fine. The problem is she cannot follow me, she tries... I can see her trying to follow me but her horse just moves in place and doesn't follow me. When I get near her the horse stops moving, that is expected it doesn't need to follow me if I am right there. If I move away a few feet it starts walking in place like it is trying to follow me but it can't. Here is an example of what I am doing to make her follow me while she is on her horse. I made a script for a command ringit brings up a messagebox with 4 simple commands mount horse, dismount horse, follow me on horse and nevermind everything works as intended , besides the fact that she just sits in place while the horse is steadily walking in place not going anywhere. the scripted part for the button pertaining to the follow me on horse command looks like this elseif button == 2lyndairef.addscriptpackage baaafollowMeOnHorselyndairef.evp now this I am sure is working as it is intended to, when I click the button it applies the package the package is set up as sothe boxes for ride horse, defensive combat, skip fallout behavior and must complete are all checked, I have also tried it with the must complete box unchecked. in the target tab of the package I have it set to point to a specific reference , the player reference. and set at a distance of 200. Knowing all this I see no reason for the behavior she is showing when i give the command to follow me on the horse. Suggestions are very welcome at this point. :-) Link to comment Share on other sites More sharing options...
thebigba Posted January 4, 2009 Author Share Posted January 4, 2009 I have a new problem , and I cannot for the life of me figure out why this is happening.This is pertaining to my companion riding a horse and following me on said horse. I have placed a horse in her dummy cell, I gave the horse the reference name of lynhorserefI have placed a marker heading in the room and gave it the reference name of lynhorsemovetoref well this is no problem she summons the horses just fine , and send them back to the dummy cell just fine. The problem is she cannot follow me, she tries... I can see her trying to follow me but her horse just moves in place and doesn't follow me. When I get near her the horse stops moving, that is expected it doesn't need to follow me if I am right there. If I move away a few feet it starts walking in place like it is trying to follow me but it can't. Here is an example of what I am doing to make her follow me while she is on her horse. I made a script for a command ringit brings up a messagebox with 4 simple commands mount horse, dismount horse, follow me on horse and nevermind everything works as intended , besides the fact that she just sits in place while the horse is steadily walking in place not going anywhere. the scripted part for the button pertaining to the follow me on horse command looks like this elseif button == 2lyndairef.addscriptpackage baaafollowMeOnHorselyndairef.evp now this I am sure is working as it is intended to, when I click the button it applies the package the package is set up as sothe boxes for ride horse, defensive combat, skip fallout behavior and must complete are all checked, I have also tried it with the must complete box unchecked. in the target tab of the package I have it set to point to a specific reference , the player reference. and set at a distance of 200. Knowing all this I see no reason for the behavior she is showing when i give the command to follow me on the horse. Suggestions are very welcome at this point. :-) problem solved it appears that my companion is picky about what horse she rides... maybe she didnt like the name? I chenged from the shadow mere form to a regular blck horse form and now she is a ok to follow .... weird how this game works sometimes. Link to comment Share on other sites More sharing options...
thebigba Posted January 4, 2009 Author Share Posted January 4, 2009 next order of business, how do i script my companion to share thier inventory with me? I look on the wiki for their companion making mod of which I use no information from in the making of my companion... but I was interested in reading about the companion share function but all they do is suggest that i download a mod .... I mo not interested in using someone elses script so where do i begin? menumode 1008 refers to container or barter menumode 1002 pertains to inventory... I am lost already so i can set up a chest for my companion she has 2 now one for inventory and one for i dont even know just for storage i guess. but I cannot access her direct inventory well I can while sneaking... how do i get her to share? this will be a problem when I need her to change clother/armour. Link to comment Share on other sites More sharing options...
thebigba Posted January 4, 2009 Author Share Posted January 4, 2009 next order of business, how do i script my companion to share thier inventory with me? I look on the wiki for their companion making mod of which I use no information from in the making of my companion... but I was interested in reading about the companion share function but all they do is suggest that i download a mod .... I mo not interested in using someone elses script so where do i begin? menumode 1008 refers to container or barter menumode 1002 pertains to inventory... I am lost already so i can set up a chest for my companion she has 2 now one for inventory and one for i dont even know just for storage i guess. but I cannot access her direct inventory well I can while sneaking... how do i get her to share? this will be a problem when I need her to change clother/armour. no more problems at the moment, currently working on her repair item script she can now share her inventory with me just fine, although I will have to likely use wyre bashs's clean bloated save games feature alot :-) soon it will be time to rewrite her script to allow for flying I especially look forward to completing that as then I can lay my modding hat up for a while and just enjoy playing the game again. Well, until i download another mod that has nice features but are missing things i think they should have anyway. Link to comment Share on other sites More sharing options...
LoginToDownload Posted January 4, 2009 Share Posted January 4, 2009 Concerning messageboxes in your first post: I don't get why you have those "Why" variables at the beginning, since it gets set to 1 right before checking if it's 1. GetButtonPressed shouldn't have spaces, and since GetButtonPressed starts at 0 and counts up, selecting "no" it 1 and it would never be 2. I think it crashes because AdvancePCLevel isn't supposed to take a number, just level them up by one. Link to comment Share on other sites More sharing options...
thebigba Posted January 4, 2009 Author Share Posted January 4, 2009 Concerning messageboxes in your first post: I don't get why you have those "Why" variables at the beginning, since it gets set to 1 right before checking if it's 1. GetButtonPressed shouldn't have spaces, and since GetButtonPressed starts at 0 and counts up, selecting "no" it 1 and it would never be 2. I think it crashes because AdvancePCLevel isn't supposed to take a number, just level them up by one.yeah I know but the 2 after advlevel just seemed to look good :-)and when it crashes it doesnt exactly crash but it freezes for like a minute then resumes and your probably right that could be why. can i ask your help, I just recently got my share inventory function working, and between getting that done and then getting the repair function the game now freezes ultimately when i try to exit out of the share menu... the script for the repair process and the script for the umm shar process i wouldnt think , should conflict with each other in any way... but it was only after applying the repair script that the share started acting up. Link to comment Share on other sites More sharing options...
thebigba Posted January 4, 2009 Author Share Posted January 4, 2009 Ok i just removed the script from my token item and saved, started up the game and share works perfectly... So i know the problem lies in the script for repair, i'll show you the script ScriptName baitemRepair ref refnnpcref itemref arrowshort slotfloat repairfloat charge Begin GameMode set refnnpc to getContainerPrintToConsole "Repairing..." SaveIP ; Starts Loop operation by designating beginning point.set item to refnnpc.GetEquippedObject slot if ( item ) if refnnpc.GetEquippedCurrentHealth slot < refnnpc.GetObjectHealth item set repair to ( refnnpc.GetObjectHealth item - refnnpc.GetEquippedCurrentHealth slot ) refnnpc.ModEquippedCurrentHealth repair slot PrintToConsole "Repaired slot %f by %f" slot repair RestoreIP ; Returns to the beginning of the loop. else if slot == 5 set slot to 13 RestoreIP elseif slot == 13 set slot to 16 RestoreIP elseif slot == 16 if refnnpc.GetObjectCharge item > 0 set charge to ( refnnpc.GetObjectCharge item - refnnpc.GetEquippedCurrentCharge slot ) refnnpc.ModEquippedCurrentCharge charge slot PrintToConsole "Recharged slot %f by %f" slot charge endif PrintToConsole "Repairs complete" else set slot to ( slot + 1 ) RestoreIP endif endifelse set slot to ( slot + 1 ) RestoreIPendif set slot to 0set arrow to refnnpc.GetEquippedObject 17 if ( arrow ) if ( refnnpc.GetItemCount arrow < 40 ) refnnpc.AddItem arrow 50 PrintToConsole "Fletched 50 arrows." endifendif RemoveMe End :-( I was almost done, the repair items was the last thing i wanted to add to her before starting on the dragon :-( I have OOO, and all the other emersian mods ready to be installed but now I halt on them to make sure this is running smoothly first Link to comment Share on other sites More sharing options...
thebigba Posted January 4, 2009 Author Share Posted January 4, 2009 nevermind problem solved :-) Now to add new armor and items to the repair list O.O well I would rather use the above script but I have a different script to run without obse... the above script as you can see uses function for obse but for some odd reason it freezes my ability to share up :-(so if you can see anything that could be a cause that would be cool. I will try to uninstall obse and install it again. Link to comment Share on other sites More sharing options...
thebigba Posted January 4, 2009 Author Share Posted January 4, 2009 nevermind :-) amazing what a nobb canm do when he puts his mind to it :-) I have the obse script working. And now I dont have to add more armour and weapon types to the other script thank gopd... the obse one seems to repair and recharge all so far. I can start to work on the dragon :-) after I get OOO,MMM,fran,warcry,and bobs armory to all work that is. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.