Can this be done through script?

Post » Tue May 17, 2011 2:58 pm

No, it's an assignment, not equality check, so it should be ":="


That just gives me an "invalid operands" error. And you're right the double= just gives me that same assignment error message.
User avatar
Andrew Perry
 
Posts: 3505
Joined: Sat Jul 07, 2007 5:40 am

Post » Tue May 17, 2011 11:34 am

The variable "type " hasn't been defined, so neither assignment nor comparison would be valid.
User avatar
Bad News Rogers
 
Posts: 3356
Joined: Fri Sep 08, 2006 8:37 am

Post » Tue May 17, 2011 6:27 am

The variable "type " hasn't been defined, so neither assignment nor comparison would be valid.


So how would I do that? Sorry for the noob question but scripting is not my thing.
User avatar
Marcin Tomkow
 
Posts: 3399
Joined: Sun Aug 05, 2007 12:31 pm

Post » Tue May 17, 2011 1:40 pm

So I've encountered a minor wrinkle. I've included "isscripted" as an exception but I'm using the Bone Grind mod, which places a script on all the bone clutter in the game. I'd rather turn those off along with all the other useless clutter. Would having the reference ID after the "if crosshairref." line be enough, or is there something else I'd need? So I would end up with this:

if crosshairref.skelbigbone01 == 1

Well that answers my question, it doesn't work. So how would I go about making an exception to an exception for an individual base item?
User avatar
jessica Villacis
 
Posts: 3385
Joined: Tue Jan 23, 2007 2:03 pm

Post » Tue May 17, 2011 5:37 am

So how would I do that? Sorry for the noob question but scripting is not my thing.

Underneath your "ref crosshairref" line, stick a line in that says:
short type

For the bone thing, try:
if crosshairref.getbaseobject == skelbigbone01
User avatar
JR Cash
 
Posts: 3441
Joined: Tue Oct 02, 2007 12:59 pm

Post » Tue May 17, 2011 1:01 pm

Underneath your "ref crosshairref" line, stick a line in that says:
short type


OK, that works, but so did your original "int". I now have the type as only Misc Items, nothing else is affected. Which simplifies the script a great deal, I only need to have 3 exceptions, getgoldvalue, isquestitem and isscripted. Thanks TNO.

if crosshairref.getbaseobject == skelbigbone01


This doesn't work, in fact it breaks the script if I put it in. The crosshairref no longer gets destroyed.
User avatar
Lexy Corpsey
 
Posts: 3448
Joined: Tue Jun 27, 2006 12:39 am

Post » Tue May 17, 2011 8:17 am

OK, that works, but so did your original "int". I now have the type as only Misc Items, nothing else is affected. Which simplifies the script a great deal, I only need to have 3 exceptions, getgoldvalue, isquestitem and isscripted. Thanks TNO.
Note that I added the type variable to make it very easy to check for more than one type, see below:

This doesn't work, in fact it breaks the script if I put it in. The crosshairref no longer gets destroyed.
You probably put it in wrong, maybe you put in in so that only items of that type gets destroyed?

Below is a version that's untested, but should work. I've re-written it a bit, to make it simpler to read. The script now returns immediately after each condition where it concludes that it should not set the item to destroyed.


scn a2zWorthlessJunkQuestScriptfloat fquestdelaytime  ;set it to 0.01 to make sure this script runs every frameref CrosshairRef       ;what you're looking atshort typeBegin gamemode	set fquestdelaytime to 0.01	set CrosshairRef to getcrosshairref				if CrosshairRef					if crosshairref.isactivatable                        let type := crosshairref.GetObjectType			if type != 27 ; To also ignore zero-valued clothes, replace with: if type != 27 && type != 22				return			endif						if crosshairref.isquestitem				return			endif						if crosshairref.isscripted				if crosshairref.getbaseobject != skelbigbone01					return				endif			endif						if crosshairref.getgoldvalue =http://forums.bethsoft.com/index.php?/topic/1120466-can-this-be-done-through-script/= 0 				crosshairref.setdestroyed 1			endif		endif	endifEnd

User avatar
Inol Wakhid
 
Posts: 3403
Joined: Wed Jun 27, 2007 5:47 am

Post » Tue May 17, 2011 5:29 am


Below is a version that's untested, but should work. I've re-written it a bit, to make it simpler to read. The script now returns immediately after each condition where it concludes that it should not set the item to destroyed.


OK, that works. Thanks again. So here's what I have now. I'm also thinking about adding armour to make the Blades armour in Cloud Ruler Temple non-interactive. No point in being able to grab something that's not worth anything, and you can get most of what you need from the chest there. I'll just toss in a shield and helmet to make it complete.

=scn a2zWorthlessJunkQuestScriptfloat fquestdelaytime  ;set it to 0.01 to make sure this script runs every frameref CrosshairRef       ;what you're looking atshort typeBegin gamemode	set fquestdelaytime to 0.01	set CrosshairRef to getcrosshairref				if CrosshairRef					if crosshairref.isactivatable          let type := crosshairref.GetObjectType						if type != 27 ; To also ignore zero-valued clothes, replace with: if type != 27 && type != 22				return			endif						if crosshairref.isquestitem				return			endif						if crosshairref.isscripted				if crosshairref.getbaseobject != skull01 && crosshairref.getbaseobject != skelBigBone01 && crosshairref.getbaseobject != skelBoneThin01 && crosshairref.getbaseobject != skelClavicle01 && crosshairref.getbaseobject != skelPelvis01 && crosshairref.getbaseobject != skelRibcage01					return				endif			endif						if crosshairref.getgoldvalue =http://forums.bethsoft.com/index.php?/topic/1120466-can-this-be-done-through-script/= 0 				crosshairref.setdestroyed 1			endif		endif	endifEnd


So what exactly does that return command do? I guess if I'm going to start tinkering with scripts, I may as well learn something about them.

I sure like the way this script is working, it's so nice to be able to turn off all the worthless junk in the game. I don't know how many times I've tried to get some item that's in a bowl etc. and ended up with the bowl instead. Then I have to fiddle around trying to put it back into place since I don't want to see a bunch of Strawberries floating in mid-air if I come back to the area later on. I get the name of the item appearing onscreen for maybe a second or two, then after that it's just like any Static item. Yet they still end up in the loot lists.
User avatar
Big mike
 
Posts: 3423
Joined: Fri Sep 21, 2007 6:38 pm

Post » Tue May 17, 2011 10:19 am

So what exactly does that return command do? I guess if I'm going to start tinkering with scripts, I may as well learn something about them.


If you have any questions about particular command, just look at http://cs.elderscrolls.com/constwiki/index.php/Return. Everything is explained there.
User avatar
Ana Torrecilla Cabeza
 
Posts: 3427
Joined: Wed Jun 28, 2006 6:15 pm

Post » Tue May 17, 2011 3:32 am

If you have any questions about particular command, just look at http://cs.elderscrolls.com/constwiki/index.php/Return. Everything is explained there.


Thanks. I do try to use the Wiki whenever possible but it's not always easy finding the information I'm looking for. And quite often when I do the explanation is so vague that I haven't a clue what it's trying to say. That entry explains the Return command quite well though. That would probably also explain why the script seems to be working faster in the game now. I barely have time to see the item name before it flashes out.
User avatar
teeny
 
Posts: 3423
Joined: Sun Feb 25, 2007 1:51 am

Previous

Return to IV - Oblivion