Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Determining if the player has just warped in


Vince
 Share

Recommended Posts

I need to determine if the player has just warped in.  I can do this by checking for a discontinuity in time and player distance.  Using a GameMode script block and saving the variables as globals (so they won't reset) there will always be a discontinuity in either time or distance, but not necessarily both.  I can give examples if necessary.  Being basically lazy, I'm looking for something simpler.

So, is there an easier way?

WillieSea, are you out there?

Link to comment
Share on other sites

What do you mean "the player has just warped in"?

Do you mean teleported to a certain location?

If so, there are several posibilities. You could have a trigger zone. You could have a script with a gamemode, since they only run when they are in a cell that is loaded in memory. More info is necessary for a good solution.

Link to comment
Share on other sites

Yes, I do mean just fast traveled in.  The problem with a trigger zone (or checking the player's distance from a given reference object) is the player may pass by the position of the map marker and not have just warped in.  Knowing that the player is in the cell is not sufficient.  I need to know the specific case where the player has just warped in and nothing else.

Background: I create exterior homes, where the "interior" is part of the exterior world.  While this has a lot of benefits, there is the risk of it raining or snowing inside.  I specifically designed my first exterior home Top of the World so that you could only get there by fast travel, since that made the scripts for keeping the rain out much simpler (the player was either there or far away).  I'm about to release a mod with an exterior home at ground level.  This requires substantially more scripting.  Although I have scripts that work for this mod, so it never rains or snows inside, you sometimes see a discontinuity in the weather.  So, I've redoing the scripts from scratch.  There are several parts.  When the player travels toward the home on foot or horseback, the scripts detect when he is 10,000 Oblvion units away.  That way, if the weather needs to be changed, SetWeather can be used to gradually change the weather rather than ForceWeather.  As the player gets very close to the home, the scripts use ForceWeather if the change to good weather has not been completed.  Of course, if the player fast travels to the home, the change to an acceptable weather must be instantaneous.  Hence the interest in a simpler way of determining if the player has just warped in.

Link to comment
Share on other sites

A trigger zone will work. I proved this concept when I looked into weather changes for one of Dark Riders inside home is in exterior world.

But, it will be a bit more complicated. I used several trigger zones and a global variable so I knew which trigger zones were hit and in what order.

- - -

You could use your getdistance to set the global to 1 if it detects the player from 9000 to 10000 units away. This way, you know fast travel was not used and you can advance the weather normally.

If the player never gets to the 9000-10000 range, then you know they fast traveled in. So, if they are suddenly less than 2000 units, you force the weather instead.

But, as you may have noticed, the weather is a pain to make it look nice.

I have successfully made it snow outside while the inside was not snowing in a house that was in the exterior world. Its a bit flakey at first but it does work. There is that 'blink' when the weather is forced.

Link to comment
Share on other sites

WillieSea, If I needed to use multiple trigger zones and keep track of the order, I would rather track the distance and time discontinuitues.

I could be mistaken, but I don't think the distance alone, as you suggest, always works.  For example, the player is near the home, walks by the position of the (invisible) map marker, and warps out.  So the last position recorded in the GameMode block is right on top of the map marker.  Later, he warps back in.  In this case, the difference in distance can be arbitrarily small, depending on how close the player was to the marker when he warped out.  In this case, there will be a time discontinuity.  So far I have not been able to come up with a situation were the player just warped in where there will not be a discontinuity in either time or distance.  So, it's a bit awkward to track both, but AFAIK never fails, so I guess I'll use it.

Relative to the snowing, yes that's cool.  I did that with rain using RainLight.nifs.

Link to comment
Share on other sites

MarkerCollision.jpg

Green 'M' is map marker.

Purple is a trigger zone.

Yellow are trigger zone walls surrounding the inner trigger zone.

Begin onload, set global to 0

Yellow sets global to 1 when triggered

If purple is triggered and global is 1 then leave weather alone. Set timer start countdown for 1 minute.

If purple is triggered and global is 0 then force weather.

If player is GetDistance (outside yellow triggerzones) from purple triggerzone, set global to 0.

If Timer on purple expires and player GetDistance (outside yellow triggerzones) then set global to 0.

This might need fine tuning, but it would probably work for what you want.

Link to comment
Share on other sites

WillieSea, that's ingenious.  I tried the time/distance tracking.  It was simpler than I expected.  You can see an example code below.  Since one must travel by foot or horseback to "discover" the home before fast traveling, I don't have to worry about the case where the old time and distance haven't been set.  I've tried this every way I can think of and haven't broken it yet.  The only way it doesn't work is if you warp out within 40 units (~ 1 foot) of the travel marker and warp back on another day at exactly the same time of day to 1 part in 1000.  I can live with that.  Although I think I'll stick with this, like I said, your way is innovative fur sure.   aa_biggrin.gif

WarpScript.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...