GetInWorldSpace question

Post » Sat Feb 19, 2011 7:55 am

I wrote a simple script that is supposed to execute when the player is in the Skingrad Worldspace. Problem is, the script isn't running. I'm just testing it right now. I am in the Skingrad Worldsapce (I think)...Does the Worldspace include cells around the outside of the walls? According to the CS, it does. But why isn't the script being triggered?

All the script does is check if the player is in the worldspace, and then play a sound. But the script isn't running. I tried leaving the Worldspace and then come back to it, thinking maybe GetInWorldspace has a limitation on when the function works when called, but that didn't help.

Any ideas?
User avatar
Jamie Lee
 
Posts: 3415
Joined: Sun Jun 17, 2007 9:15 am

Post » Sat Feb 19, 2011 8:06 am

Well, I did a little testing, and it turns out that Skingrad is returning an empty worldspace. I have no idea why, but the area around Skingrad isn't returning as a worldspace. So, I'll have to modify the script some.
User avatar
Liv Staff
 
Posts: 3473
Joined: Wed Oct 25, 2006 10:51 pm

Post » Fri Feb 18, 2011 11:07 pm

have a look at 'nameincludes' functions.
User avatar
NO suckers In Here
 
Posts: 3449
Joined: Thu Jul 13, 2006 2:05 am

Post » Sat Feb 19, 2011 9:39 am

Not sure what you're trying to accomplish, but maybe if ( player.getincell Skingrad ) could be useful.
User avatar
Helen Quill
 
Posts: 3334
Joined: Fri Oct 13, 2006 1:12 pm

Post » Sat Feb 19, 2011 9:59 am

have a look at 'nameincludes' functions.


Precisely what I did after learning that the Skingrad woorldspace was returning an empty string. Check this out though:
I used OBSE's ref walking function to return the cell I'm in. I then used CompareName (like you suggest) to find if the cell has "Skingrad" in the name. Turns out the cell name is returning an empty string as well. What the heck kind of an anomaly is this? Is Skingrad just fubar'd?

Not sure what you're trying to accomplish, but maybe if ( player.getincell Skingrad ) could be useful.


No. GetInCell only works for Interior cells. Thanks though.
User avatar
Lyndsey Bird
 
Posts: 3539
Joined: Sun Oct 22, 2006 2:57 am

Post » Sat Feb 19, 2011 12:07 pm

No GetInCell works for exterior cells also. I used it myself in 1 of my mods to check if the player entered a city/village. This also includes the area outside a city btw.
User avatar
Emily Graham
 
Posts: 3447
Joined: Sat Jul 22, 2006 11:34 am

Post » Sat Feb 19, 2011 3:01 am

No GetInCell works for exterior cells also. I used it myself in 1 of my mods to check if the player entered a city/village. This also includes the area outside a city btw.


Oh, okay. Well according to the CS Wiki, it only works for interior cells. Obviously, I didn't test it. But I'll give it a go and see if it works.
User avatar
jenny goodwin
 
Posts: 3461
Joined: Wed Sep 13, 2006 4:57 am

Post » Sat Feb 19, 2011 11:20 am

You are right, MatH! GetInCell does work for exterior cells. That function allowed my mod to do what I wanted it to. Thank you very much.

I wonder why when using the ref walking, the cell names returned empty strings, but when using GetInCell, all was good?

I don't know, maybe in my noobness I didn't script the thing properly...
User avatar
sophie
 
Posts: 3482
Joined: Fri Apr 20, 2007 7:31 pm

Post » Sat Feb 19, 2011 7:23 am

I wonder why when using the ref walking, the cell names returned empty strings, but when using GetInCell, all was good?


That is because the cell name is empty for the Tamriel exterior cells (exterior cells don't have names, so functions like GetName and %n return the worldspace name for them. It just happens that the Tamriel worldspace does not have a name, so Tamriel exterior cells have no name)

On the other hand, GetInCell checks against the cell EditorID (not the name), and all cells have an EditorID (well . . . not counting the 'wilderness' cells).

As for the WIKI text, what it means is that GetInCell will only accept an interior cell EditorID as a parameter, not an exterior EditorID. So, GetInCell will compile if you use 'AnvilTheFocsle' (interior) as argument, but will not compile if you use, for example, 'AnvilBay' (exterior).
This is why, btw, the game has dummy cells named Anvil (or Bravil, or Bruma), so you can use Anvil as argument for GetInCell and get a positive return for all interiors that start with Anvil and all exterior cells in the AnvilWorld worldspace (which, btw, as opposed to Tamriel, does have a name that, obviously, is "Anvil")

Oh . . . and I do not understand why you attempted to use ref walking to get the cell name
User avatar
Hilm Music
 
Posts: 3357
Joined: Wed Jun 06, 2007 9:36 pm

Post » Sat Feb 19, 2011 3:08 am

That is because the cell name is empty for the Tamriel exterior cells (exterior cells don't have names, so functions like GetName and %n return the worldspace name for them. It just happens that the Tamriel worldspace does not have a name, so Tamriel exterior cells have no name)

On the other hand, GetInCell checks against the cell EditorID (not the name), and all cells have an EditorID (well . . . not counting the 'wilderness' cells).

As for the WIKI text, what it means is that GetInCell will only accept an interior cell EditorID as a parameter, not an exterior EditorID. So, GetInCell will compile if you use 'AnvilTheFocsle' (interior) as argument, but will not compile if you use, for example, 'AnvilBay' (exterior).
This is why, btw, the game has dummy cells named Anvil (or Bravil, or Bruma), so you can use Anvil as argument for GetInCell and get a positive return for all interiors that start with Anvil and all exterior cells in the AnvilWorld worldspace (which, btw, as opposed to Tamriel, does have a name that, obviously, is "Anvil")

Oh . . . and I do not understand why you attempted to use ref walking to get the cell name


Oh, okay. Great explanation. I'll be sure to remember that for future use.

I was trying to use ref walking because I am a noob when it comes to scripting, and that was the idea that came to my mind when I was trying to come up with a way to access cells in the worldspace of Skingrad.
User avatar
mollypop
 
Posts: 3420
Joined: Fri Jan 05, 2007 1:47 am


Return to IV - Oblivion