Page 1 of 1

Moving and deleting statics

PostPosted: Mon Aug 10, 2009 4:16 pm
by Monika Krzyzak
I've been working on a tent mod, and I have an issue that I just can't can't seem to get around.

MCP fixes rain/snow collision so that rain and snow doesn't pass through statics, and you can shelter beneath them. Unfortunately, activators won't be getting the same treatment. this forms the base of the issue.

I can use placeItem or PlaceAtPC to put a static tent at the player's position, but one it's there, I can't manipulate it, as in lowering it's Z pos so it rests on the ground, and I can't use a script to disable or delete the static when the PC is done with it, because the static placed by those functions creates a new reference and instance of the static. The script can't recognize a reference that didn't yet exist when it was written, eh?

Alternatively, I can create a unique instance of the static, and put it in the game world so the engine can find it. this allows me to disable the tent by script, but it doesn't move when setpos X,Y, Z is used. Position and positionCell would work, but they don't accept variables, and of course there is no way to know the coordinates when writing the script, since the tent is portable.

I'm trying very hard to avoid using a script extender, because it really is a simple mod other than the apparent impossibility.

If nobody has any ideas, I suppose I'll just release it with rain and snow passing through the tent, but that kind of defeats the original idea. I'm desperate, here... Does any kind knowledge-filled soul have a tidbit of wisdom to impart?

Moving and deleting statics

PostPosted: Mon Aug 10, 2009 9:02 am
by kitten maciver
Yea, if something like MWSE can fix your problem i would look into that. Maybe you can even email someone who helped with MCP and ask them for your mod how you could make that works for activators as well or if it's even possible. What if you attached a door to your tent and made it a seperate cell so you don't have to worry about the weather thing? It's not that far fetched you might have to create your own door to resemble that of a tent like a door that maybe looks like one of those Ashlander tribes' hut doors. Something like that.

I would try to stay away from using statics. I know you used it as a work around for the MCP 1.7 b/c they fixed the weather bug where rain or snow passes through statics if you stand underneath them.

Moving and deleting statics

PostPosted: Mon Aug 10, 2009 9:57 pm
by Joey Bel
Yeah, Hrnchamd was kind enough to explain to me why the weather fix wouldn't work for activators, so that part is out. Two of the tents are as you said, activators used as doors that lead to different interior cells, and they aren't the problem.

The problem is these three tents which are open... that is they are retextures of the standard Mournhold Bazaar tent. I made them first, actually... the original idea was a simple mod for my own use that had a tent I could stand in and watch the weather fall outside. I'm still trying to stay with that notion, and keep it more or less simple. That seems to be easier said than done though...

Moving and deleting statics

PostPosted: Mon Aug 10, 2009 7:04 pm
by Nicholas
Alternatively, I can create a unique instance of the static, and put it in the game world so the engine can find it. this allows me to disable the tent by script, but it doesn't move when setpos X,Y, Z is used.
This is strange, did you set the "References Persist" flag on the unique static?

Moving and deleting statics

PostPosted: Mon Aug 10, 2009 6:08 am
by Marguerite Dabrin
This is strange, did you set the "References Persist" flag on the unique static?

Yes, but let me rephrase that... If I want to, I can use setpos to move the tent from say one side of Seyda Neen to the other, and it works just fine. If I travel to vos from Seyda Neen where the original static is placed, it does not appear in vos, ans will no longer appear in seyda Neen, either.

Unless I'm mistaken, setpos only works on items loaded in the active cells. At any rate, that's the way it's working for me.

Moving and deleting statics

PostPosted: Mon Aug 10, 2009 1:52 pm
by Kelly John
Yes, but let me rephrase that... If I want to, I can use setpos to move the tent from say one side of Seyda Neen to the other, and it works just fine. If I travel to vos from Seyda Neen where the original static is placed, it does not appear in vos, ans will no longer appear in seyda Neen, either.

Have you tried disabling and enabling it?

Moving and deleting statics

PostPosted: Mon Aug 10, 2009 2:41 pm
by Charlie Ramsden
Have you tried disabling and enabling it?


Yes, and aside from gaining collision when it actually appears during local moves, there doesn't seem to be any effect.
Here's the code:
Begin testTentScriptAshort controlvarshort controlvar2short OnPCDropfloat currXfloat currYfloat currZ;'globals: [Not Used- 1testTent  1testPosX  1testPosY  1testPosZ]  TestCtrlVarIf ( OnPCDrop == 1 )	If ( TestCtrlVar == 0 )			set controlvar to 1			set OnPCDrop to 0	ElseIf ( TestCtrlVar == 1 )			set controlvar2 to 1			set OnPCDrop to 0	endIfendIfIf ( controlvar == 1 )	If ( "GD_TentTest"->GetDisabled  == 1 )			enable	endIf		Set currX to ( GetPos, X )		Set currY to ( GetPos, Y )		Set currZ to ( GetPos, Z )		set controlvar to 2endIfIf ( controlvar == 2 )		"GD_TentTest"->setPos, X, currX		"GD_TentTest"->setPos, Y, currY		"GD_TentTest"->setPos, Z, currZ		set controlvar to 3endIfIf ( controlvar == 3 )		set currZ to ( currZ - 15 )		"GD_TentTest"->setPos Z, currZ		"GD_TentTest"->disable		"GD_TentTest"->enable		set  controlvar to 0		set testCtrlVar to 1endIf;'*******************************************************************************;'Following section for packing tent up;'*******************************************************************************If ( controlvar2 == 1 )		"GD_TentTest"->disable		set controlvar2 to 0		set TestCtrlVar to 0endIfEnd testTentScriptA


Moving and deleting statics

PostPosted: Mon Aug 10, 2009 5:57 am
by Alex [AK]
Yes, but let me rephrase that... If I want to, I can use setpos to move the tent from say one side of Seyda Neen to the other, and it works just fine. If I travel to vos from Seyda Neen where the original static is placed, it does not appear in vos, ans will no longer appear in seyda Neen, either.

Unless I'm mistaken, setpos only works on items loaded in the active cells. At any rate, that's the way it's working for me.
Before developing mainly for the script enhancer, CD Cooley made a a very interesting proof of concept mod, http://www.divshare.com/download/11485485-544,
that should be useable as base for your needs. As I can't find it on line anymore, I have taken the liberty to reupload it and create a http://www.divshare.com/download/11485486-b89.

Moving and deleting statics

PostPosted: Mon Aug 10, 2009 10:04 am
by Melanie Steinberg
Before developing mainly for the script enhancer, CD Cooley made a a very interesting proof of concept mod, http://www.divshare.com/download/11485485-544,
that should be useable as base for your needs. As I can't find it on line anymore, I have taken the liberty to reupload it and create a http://www.divshare.com/download/11485486-b89.

Wow! You've given me a lot to chew on here! I've read through your example and the thuum_move_script, and I think I have a fairly clear idea of what's goin on there.

I do have a couple of questions for you, if you don't mind me asking.

Your script actually moves the player to Balmora, and then thuum_move_script sets your test static a few feet away from the player at the literal co-ordinates you provided, with a stop somewhere in a nearby loaded cell along the way.

My first question is a half-question.... I take it I can use variables to set x1, y1, z1? So if I use a OnPCDrop to getPos x,y,z and a1 in a local script on a token to set variables and then add a startscript "myscript teleport script" and from there starting thuum_move_script, it should work? (What the heck did I just say, did it make sense?)

Second question, I notice that you have a fix from your static to startscript "thuum_move_script". That starts the script and sets your static as the calling object? If that's correct,I had no idea you could do anything like that... Is that a common usage?

Third question... In the readme permissions are not exactly given, as the author wants time for bugfixes and so on. I take it this script is fairly old, is that still an issue or is the script usable in a published mod? and if not, can he be contacted for permission? I was wondering since you said the mod wasn't available online anymore.

Thanks for all the time you have taken with me, I appreciate it, really.

Moving and deleting statics

PostPosted: Mon Aug 10, 2009 7:47 am
by Bek Rideout
Wow! You've given me a lot to chew on here! I've read through your example and the thuum_move_script, and I think I have a fairly clear idea of what's goin on there.

I do have a couple of questions for you, if you don't mind me asking.

Your script actually moves the player to Balmora, and then thuum_move_script sets your test static a few feet away from the player at the literal co-ordinates you provided, with a stop somewhere in a nearby loaded cell along the way.

My first question is a half-question.... I take it I can use variables to set x1, y1, z1? So if I use a OnPCDrop to getPos x,y,z and a1 in a local script on a token to set variables and then add a startscript "myscript teleport script" and from there starting thuum_move_script, it should work? (What the heck did I just say, did it make sense?)
Balmora is just a "dummy" exterior location cell name for positioncell, it is easy to write and remember and MWEdit does not complain with it, so I always use it even if real destination coordinates are different... but I am digressing... yes, It should work
Second question, I notice that you have a fix from your static to startscript "thuum_move_script". That starts the script and sets your static as the calling object? If that's correct,I had no idea you could do anything like that... Is that a common usage?
Yes, the caller is the default object. This is how global scripts called from dialog result can do things with the speaker NPC. It is shorter (less code) and faster (no need to scan memory for the object).
Third question... In the readme permissions are not exactly given, as the author wants time for bugfixes and so on. I take it this script is fairly old, is that still an issue or is the script usable in a published mod? and if not, can he be contacted for permission? I was wondering since you said the mod wasn't available online anymore.
It seems the Thuum proof of concept has been abandoned for more efficient/simple ways to do the same things using MSWE, so I think it can be considered something that will be developed no more, and a great resource for those using vanilla scripts. Anyway, CDCooley's old webspace is currently down, you could try http://www.gamesas.com/index.php?/user/31044-cdcooley/, it seems he is not often in the forums but never say never