Check if the player is not in town

Post » Fri May 13, 2011 9:03 am

if eval player.getinworldspace tamriel	if eval !(player.getinworldspace anvilworld) && !(player.getinworldspace chorrolworld) && !(player.getinworldspace brumaworld)  && !(player.getinworldspace kvatchentrance)	if eval !(player.getinworldspace cheydinhalworld) && !(player.getinworldspace bravilworld) && !(player.getinworldspace skingradworld)	if eval !(player.getinworldspace kvatchplaza) && !(player.getinworldspace kvatcheast) && !(player.getinworldspace leyawiinworld)	if eval !(player.getinworldspace ICmarketdistrict) && !(player.getinworldspace ICArenaDistrict) && !(player.getinworldspace ICArboretumDistrict)	if eval !(player.getinworldspace ICTempleDistrict) && !(player.getinworldspace ICTalosPlazaDistrict) && !(player.getinworldspace ICElvenGardensDistrict)	if eval !(player.getinworldspace ICImperialPalace) && !(player.getinworldspace ICTheArcaneUniversity)	endif	endif	endif	endif	endif	endifendif


The title says it all, really...
User avatar
Eddie Howe
 
Posts: 3448
Joined: Sat Jun 30, 2007 6:06 am

Post » Fri May 13, 2011 11:49 am

Try
 if player.getinworldspace tamriel == 1

If the Player is in the Tamriel worldspace, then he Player is not in a town.
User avatar
Lynette Wilson
 
Posts: 3424
Joined: Fri Jul 14, 2006 4:20 pm

Post » Fri May 13, 2011 1:48 pm

Unless you run Open Cities. Then you can be in the Tamriel worldspace and in town at the same time. That also means that most of the checks in the opening post will fail also, because you'd never enter anvilworld etc.

So what's the purpose of the check? It may be something where you;d need to be concerned about villages etc. (Aleswell, Pell's Gate, Harlun's Watch, ...) so worldspaces might not be appropriate anyway.
User avatar
Emily Jeffs
 
Posts: 3335
Joined: Thu Nov 02, 2006 10:27 pm

Post » Fri May 13, 2011 10:16 am

Try
 if player.getinworldspace tamriel == 1

If the Player is in the Tamriel worldspace, then he Player is not in a town.

Or they might be in the Shivering Isles. Or in an Oblivion world. There are places that aren't in the Tamriel worldspace that aren't cities.

You could use You Are Here. Possible.

That syntax looks all off to me. It's certainly a format I've never seen in the CS. I think instead of 'eval !' you would just use 'player.GetInWorldspace (city) == 0'.
User avatar
Davorah Katz
 
Posts: 3468
Joined: Fri Dec 22, 2006 12:57 pm

Post » Fri May 13, 2011 4:52 am

...
That syntax looks all off to me. It's certainly a format I've never seen in the CS. I think instead of 'eval !' you would just use 'player.GetInWorldspace (city) == 0'.


OBSE command.
Although using GetInWorldSpace doesn't require OBSE structure.
User avatar
FirDaus LOVe farhana
 
Posts: 3369
Joined: Thu Sep 13, 2007 3:42 am

Post » Fri May 13, 2011 9:36 am

The check is just making sure the player is not in a proper city with walls and lots of guards. Villages don't matter so much.

The syntax is correct, as the script compiles and does what it's supposed to. I use Eval to be able to write a false variable condition as !variable, which is what I prefer to do in C-derivatives and Java. I've tried GetInWorldSpace Tamriel before, the problem is that this returns true for when the player is in town as well, as the town worldspaces have Tamriel as their parent world.

What I need is a command that returns the worldspace the player is currently in. Then I can send that as a parameter to GetWorldParentWorld and figure out if the current worldspace has Tamriel as its parent (and is thus a town or something similar). Until we get something like GetCurrentWorldspace, I guess I'm stuck with the wall of text I posted above.
User avatar
Glu Glu
 
Posts: 3352
Joined: Sun Apr 01, 2007 5:39 am

Post » Fri May 13, 2011 11:26 am

As ghastley said, that wall of text is only useful for detecting the normal closed city spaces. If someone is using Open Cities, that wall of text will fail.

Fortunately I foresaw situations like this and made sure all the cells were named, so if you want to be able to catch OC users, the standard GetInCell checks against the city names would work.

Ie: GetInCell Anvil will work as expected there. The nice thing is, Bethesda marked all their own city spaces so that they'd work with GetInCell too.

You have no guarantee that a worldspace with Tamriel as its parent is a city.
User avatar
Marie
 
Posts: 3405
Joined: Thu Jun 29, 2006 12:05 am

Post » Fri May 13, 2011 5:42 am

Yes, I believe !(getincell TownName) might be better. I suppose GetInWorldSpace might be less performance intensive, though the difference is probably negatable.
User avatar
zoe
 
Posts: 3298
Joined: Sun Nov 12, 2006 1:09 pm


Return to IV - Oblivion