Set Rotation on SIM start

Creating scripts
Post Reply
User avatar
Lunk Portal
Posts: 132
Joined: Wed Jan 26, 2022 10:03 am
Location: Northern Michigan
Has thanked: 91 times
Been thanked: 139 times
Contact:

Set Rotation on SIM start

Post by Lunk Portal »

Hey everyone, I have some doors that get jacked up every time I upload an updated OAR to my SIM...and I am tired of resetting their rotation each time :D

I used to know a snippet of code but cannot remember it.

Does anyone know the code for setting rotation and position of an object on sim start-up?

THANKS!
These users thanked the author Lunk Portal for the post:
Ilan Tochner
B. A. Shields (Lunk Portal)
TatooineRP Region
TatooineRP Website
Kitely Market - Lunk's Loot
My Novels and other Projects
https://linktr.ee/bashields
User avatar
Iain McCracken
Posts: 25
Joined: Thu Feb 21, 2013 6:35 pm
Has thanked: 35 times
Been thanked: 14 times

Re: Set Rotation on SIM start

Post by Iain McCracken »

You can use the "changed" event to detect sim restart using the "CHANGED_REGION_START" constant... So, this code inside the root prim of the door might be something like what you're looking for. I don't have a live sim right now so I can't test the sim restart on oar upload.

Code: Select all

changed(integer why)
{
	if (why & CHANGED_REGION_START)
	{
		llSetRot(blah);
	}
}
These users thanked the author Iain McCracken for the post (total 3):
Ilan TochnerLunk PortalGraham Mills
User avatar
Lunk Portal
Posts: 132
Joined: Wed Jan 26, 2022 10:03 am
Location: Northern Michigan
Has thanked: 91 times
Been thanked: 139 times
Contact:

Re: Set Rotation on SIM start

Post by Lunk Portal »

Iain McCracken wrote:
Sat Jun 25, 2022 5:03 pm
You can use the "changed" event to detect sim restart using the "CHANGED_REGION_START" constant... So, this code inside the root prim of the door might be something like what you're looking for. I don't have a live sim right now so I can't test the sim restart on oar upload.

Code: Select all

changed(integer why)
{
	if (why & CHANGED_REGION_START)
	{
		llSetRot(blah);
	}
}
I’ll give this a try next time I’m on and let you know either way
B. A. Shields (Lunk Portal)
TatooineRP Region
TatooineRP Website
Kitely Market - Lunk's Loot
My Novels and other Projects
https://linktr.ee/bashields
User avatar
Lunk Portal
Posts: 132
Joined: Wed Jan 26, 2022 10:03 am
Location: Northern Michigan
Has thanked: 91 times
Been thanked: 139 times
Contact:

Re: Set Rotation on SIM start

Post by Lunk Portal »

Yeah, I can't seem to get this to work...my script skills are weak LOL
B. A. Shields (Lunk Portal)
TatooineRP Region
TatooineRP Website
Kitely Market - Lunk's Loot
My Novels and other Projects
https://linktr.ee/bashields
Graham Mills
Posts: 1164
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 889 times
Been thanked: 941 times

Re: Set Rotation on SIM start

Post by Graham Mills »

Lunk Portal wrote:
Mon Jun 27, 2022 5:54 pm
Yeah, I can't seem to get this to work...my script skills are weak LOL
Is it part of a linkset?
Post Reply