Anthony Xiii Posted November 3, 2007 Share Posted November 3, 2007 Please I want to Script my objects in my 1st mod i am newbie using script editor.Can someone who is advanced of scripting, give me some help. :excl: Can some1 help me to finish my mod "Albert Einstein's Home"! :unsure: I have lots of work to do with it. I just want to script "WineMaker01" Object (mesh: "BlackwoodPump01") I tried to Script it making wine easily (when I activate it, it should remove 5 grapes from my inventory and give me Cheap Wine) I tried to script like this: ________________________________________________________________scriptname WineMachine01Script short activated Begin onActivate if IsActionRef player == 1 if player.GetItemCount Grapes, 5 > 1 && ( activated == 1 ) Player.RemoveItem Grapes, 5 set activated to 1 player.additem DrinkWine0Cheap, 1 endif endifend_________________________________________________________________ If you think what is "Scpipting", sorry I mean Scripting. Please tell me what I've do right and wrong.Thank you for reading my problem. :happy: if someone wants to give me report via mail: [email protected] Anthony Link to comment Share on other sites More sharing options...
Abramul Posted November 3, 2007 Share Posted November 3, 2007 The following should be sufficient:scriptname WineMachine01Script Begin onActivate if IsActionRef player == 1 if player.GetItemCount Grapes >= 5 Player.RemoveItem Grapes 5 player.additem DrinkWine0Cheap 1 endif endif endThe check for whether the player is activating it probably isn't necessary, but can't hurt. As for why it didn't work, you were using a variable in a condition which could only be true if the condition were true first. I have no idea what the "5 > 1" bit was supposed to be. Link to comment Share on other sites More sharing options...
Anthony Xiii Posted November 4, 2007 Author Share Posted November 4, 2007 The "if player.GetItemCount Grapes >= 5" should mean that the machine works when I have 5 grapes? I don't understand what the "if IsActionRef player == 1" means. I'm just trying that the machine removes from my inventory 5 grapes and I get bottle of Cheap Wine. How would you do this same machine script? You can feel free to copy my ideas from my messages. But the problem would be in the activator, "BlackwoodPump01". Do you know does this machine work without the "if IsActionRef player == 1"? Link to comment Share on other sites More sharing options...
Anthony Xiii Posted November 4, 2007 Author Share Posted November 4, 2007 PS. I add your name to the Albert Einstein's Home.txt Like this ___________________======Thanks:======Abramul ___________________ Can I? ;) Link to comment Share on other sites More sharing options...
Abramul Posted November 4, 2007 Share Posted November 4, 2007 The "if player.GetItemCount Grapes >= 5" should mean that the machine works when I have 5 grapes?It'll operate if you have five or more.I don't understand what the "if IsActionRef player == 1" means.It will be false if anyone other than the player attempts to operate the machine, preventing it from being operated by anyone except for the player. I don't believe NPCs can use activators without being told to, but as I said, it doesn't hurt to include it.I'm just trying that the machine removes from my inventory 5 grapes and I get bottle of Cheap Wine. How would you do this same machine script? You can feel free to copy my ideas from my messages.That's what the code box in my previous post was...But the problem would be in the activator, "BlackwoodPump01".If you haven't already created a new activator with the same mesh, the simplest way is to change the EditorID, hit OK, and when it asks you if you want to create a new form, select Yes.Do you know does this machine work without the "if IsActionRef player == 1"?It would probably work perfectly well, although if an NPC were to activate it for some reason it would act as if the player had activated it. PS. I add your name to the Albert Einstein's Home.txt Like this ___________________======Thanks:======Abramul ___________________ Can I? ;)Fine by me! Link to comment Share on other sites More sharing options...
Anthony Xiii Posted November 9, 2007 Author Share Posted November 9, 2007 WoW!! Fially it works!All thanks belongs to you! :D Thanks VERY MUCH! It looks now like this:scriptname WineMachine01Script Begin onActivate if player.GetItemCount Grapes >= 5 Player.RemoveItem Grapes 5 player.additem DrinkWine0Cheap 1 endif end Anthony Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.