Jump to content

can someone help me with scriping


hero4682

Recommended Posts

hi guys,.

 

i made 2 models, a "lantern", and a "ring"... and id like to make "lantern" recharge the "ring" in a specific way....

 

id like to make is so that the "ring" is the ONLY item the "lantern" can recharge, and it has to be able to do it an unlimited amount of times.

 

can this be done??? please say it can...

 

 

Link to comment
Share on other sites

again, thanks for the help... i hope i can get this working the way id like it to....

 

i couldnt get the script to work... actually i didnt even get to try it out....

whenever id try and save the script in the script edit, id get this script error;

 

Script 'ringscript', line 7:

Invalid object reference 'lantern' for parameter ObjectReferenceID.

Compiled script not saved!

 

help please..

next to my problem here ive got another quick question.

what is "lantern"? what i mean is, is that the Editor ID, the Form ID, the Name of the item, or something else out there?

 

oh, sorry about this but i forgot to mention it the first time.

in order to recharge the "ring" it has to be equiped. then once its equiped, you can activate the "lantern" (click on it) to recharge the "ring"

 

again, i hope this isnt too crazy of an idea?

 

 

Link to comment
Share on other sites

When I used "lantern", I meant you're supposed to put in the reference ID of your lantern... But anyway, that script would not behave like you describe. To get what you want, use this:

 

scriptname lanternscript


array_var equipped
ref tempref
short max
short tempshort


Begin OnActivate

if (Player.GetEquipped "object ID of your ring")
	set max to (GetObjectCharge "object ID of your ring")
	let equipped := Player.GetEquippedItems
	while (tempshort < ar_size equipped)
		let tempref := equipped[tempshort]
		if (tempref.GetBaseObject == "object ID of your ring")
			tempref.SetCurrentCharge max
			let tempshort := 0
			MessageBox ""object ID of your ring" has been recharged."
			Break
		endif
		let tempshort := (tempshort + 1)
	loop
else
	MessageBox "You do not have "object ID of your ring" equipped."
endif

End

 

I didn't mention it before, but you need OBSE to get it to work.

Edited by fg109
Link to comment
Share on other sites

i just bearly realized that my idea is broken....

 

i wanted to so that, whenever you equip this ring, you get this spell that basically fortifys your willpower all day, but eventually goes away.

but you would need to activate it first with a spell, just like when casting a spell with a staff (mainly because it uses a charge,... that was the key)...

 

i wanted to give the ring only one charge, that way you could only cast the spell once, making you have to return to the lantern to recharge your ring...

 

but the whole "charge" thing seems like its for weapons and staffs only, and id like to use it for apparel... untill i can figure out how pass this part, my projects grounded...

 

thanks for all the help again

Link to comment
Share on other sites

i just bearly realized that my idea is broken....

 

i wanted to so that, whenever you equip this ring, you get this spell that basically fortifys your willpower all day, but eventually goes away.

but you would need to activate it first with a spell, just like when casting a spell with a staff (mainly because it uses a charge,... that was the key)...

 

i wanted to give the ring only one charge, that way you could only cast the spell once, making you have to return to the lantern to recharge your ring...

 

but the whole "charge" thing seems like its for weapons and staffs only, and id like to use it for apparel... untill i can figure out how pass this part, my projects grounded...

 

thanks for all the help again

 

I should have thought of that first thing, but I didn't realize it either...

Link to comment
Share on other sites

  • Recently Browsing   0 members

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