Jump to content

Writing a Script to check if current player location is cleared.


ajs52698

Recommended Posts

Once again ive been messing around with scripting and im again, having a hard time understanding how to do something. In this case its checking whether the current location of the player has been cleared.



This is what ive got, dont know if its right or not.


Also would be nice if someone could explain things like int and strings and whatever else, its one thing im still confused about.



Event OnCellLoad()


Strings MyLocation == Game.getplayer().GetcurrentLocation()



if MyLocation.iscleared()


Endif

EndEvent


Link to comment
Share on other sites

Hey ajs, been kinda following you do a bit. Anyway hopefully I can lend a hand.

 

You're pretty close but when you call things like a Location. That's actually something you need to call it as.

 

So when you're poking around the Wiki, the hyphened off things are literally what you would call it as, or rather what it applies to.

 

http://i.imgur.com/1YJK6c9.png

 

Actor, ActorBase, Location, FormList, ObjectReference, Potion, etc.

 

What you want to do is instead of cast for a 'Strings'

 

You want to cast it as a Location.

 

<CAST AS> <VARIABLE> = <WHAT YOU WANT TO GET> <POSSIBLY CONVERT>

 

Honesty check out this 'Cast As' page.

http://www.creationkit.com/fallout4/index.php?title=Cast_Reference

 

STRING are literally words. It's like using Debug.Notification("THIS IS A STRING")

INT is an Integer, they have to be whole numbers. 0, 1, 2, 3, 4, etc.

FLOAT is an Integer with Decimals. They store exact number values. 0.21, 1.53251, etc.

BOOL is a true or false statement. It can only be true or false, no matter what.

 

Here are the function literals.

http://www.creationkit.com/fallout4/index.php?title=Literals_Reference

 

Hope this can clear some things up for you.

Link to comment
Share on other sites

Change the string variable type to Location.

Location MyLocation

But it's not necessary unless you're calling GetCurrentLocation more than once. For all Get functions, if you need to call them more than once, and if you know the value you are looking for isn't going to change, you want to store their result to a variable and use it throughout the script.

Edited by TummaSuklaa
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...