Jump to content

Help me With Scpipting in Tes CS


Anthony Xiii

Recommended Posts

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

endif

end

_________________________________________________________________

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

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
end

The 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

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

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

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...