Welcome Guest ( Log In | Register )

2 Pages V < 1 2  
Reply to this topicStart new topic
> T.I.M.E. (The Interactive Modding Excursion), Mod-making tutorials
Renee
post May 13 2018, 07:53 PM
Post #21


Master
Group Icon
Joined: 19-March 13



Faction-changing Armor and Clothing

Game: Fallout 3

Good evening. This one is going to focus on making faction changes, which are caused by simply putting on some clothes or armor. This will work best when changing outfits just before going from one cell to another, and is much more RP-friendly than using console commands. wink.gif

I got this to work in Fallout 3 last summer, in Janet Telia's game. I was able to get her into the RaiderFaction by having her put on some specialized raider armor, waiting an hour, and then entering a cell full of raiders. Once inside that cell, these enemies were now her friends. The entire faction of raiders remained friendly to her from that point on, all across the Wasteland, as long as she was wearing her special armor.

This should also work in Oblivion too, although I have not tested if it does, yet.


----------------------------

1).Open up the GECK, bla bla... First thing we're going to do is to make a customized faction.

1a). MAIN toolbar > Characters > Faction
Go ahead and make a custom faction by right-clicking > New into the Editor ID window. I called Janet's special faction aaaRaiderFaction, though you can call yours whatever you'd like.


NOTE: DO NOT just use one of Bethesda's factions (such as RaiderFaction). It is better to make a custom faction, rather than adding the PC to one of the game's premade factions. Before I figured this out, I was using the Bethesda raider faction. When Janet put on her raider-faction armor, she was accepted by raiders just fine. Problem was, she could not 'break' out of this faction just by removing her armor. Even if she shot somebody, they would continue to be her friend. dry.gif Maybe this is a 'friendly fire' sort of function, so that if one raider shoots another, he/she won't just turn around and begin fighting this other raider, when they should be coming after us.

With a custom faction, the results worked just as I wanted them to. smile.gif There were some limits though, and these limits will be discussed toward the bottom-third of this post.


1b). Give this faction a Name. You can toggle Evil on if you want to, which will temporarily influence how Karma works.

1c). Right-click > New into the Interfaction Relations window, and use the Opposing/Affiliated scroll-bar to find the faction you want to modify toward your character's custom faction.

1d). Let's say you chose RaiderFaction in step 1c. For best results, make the Disposition Modifier 100, with Group Combat Reactions toggled to Ally.

You can experiment with numbers lower than 100, and you can also choose 'Friend' or 'Neutral' instead of Ally, if you want to make this faction-change happen with more of a question mark.


1e). Click OK (closing the Factions panel) and SAVE.


2a). OBJECT window
Go into Items. Edit an outfit (a piece of clothing or armor), and give it a unique ID. When asked if we want to save this under a new ID? Click Yes.

2b). Double-left click on the outfit you edited, and go into that outfit's script area. If the outfit already has a script, get rid of it, or choose some other article of clothing (or armor) which does not have a script.

2c). The Script Type scroll-bar can stay as Object. Here is what to write.

------------------------

scriptname aaaFactionChangingArmorScript

Begin OnEquip

Player.SetFactionRank aaaFaction 1

End

Begin OnUnequip

Player.SetFactionRank aaaFaction -1

End


-------------------------------------

Where it says "aaaFaction", you can substitute this term with the name of your actual custom faction. So for me, I'm typing aaaRaiderFaction where it says aaaFaction.

Anyway, this script will make sure the player-character gets added and removed from whatever faction you choose, in a never-ending loop. However, there are limitations to this.

-- You'll need to make sure your character changes clothes in a cell which is separate from any enemies. Once this is done it's best to wait an hour, and then you can enter the cell you're trying to influence. The faction-changing effect works best this way, and it's only realistic that a bunch of enemies won't change their hostile minds, simply because they witness our toon changing into some outfit!

--I tried entering the raider-infested grocery store (the store next to Gold Ribbon Grocery, with all those raiders inside), for instance. Janet entered this store wearing ordinary clothes. The raiders inside were hostile. Then, I had her leave the building, changing into her special Faction Armor. Back inside, the raiders were now friendly. Back outside, change of clothes again, now they're hostile again.

However, after doing this several times, they eventually defaulted to friendly no matter what she was wearing.

...Of course, nobody would do any of this in the game. It's silly to change back and forth like this as we're actually playing. We only need to change into the outfit once before we enter their territory, and maybe change back out of it once, if we're going back into ordinary civilization again. I'm just highlighting that there are some limits, here. These limits won't be found though, until the gamer is doing some heavy experimentation. ph34r.gif


--To break her friends-only status, I tried having her attack a raider. He ignored her attack at first, but eventually fought back. Once this moment was crossed, this guy was now NOT her friend anymore, and attacked every time, even if she ran outside and changed clothes from and to the Faction armor. Thing is, only that one raider attacked her. The others were still friendly to Janet.

Bottom line though: if you're just playing the game normally, change your character's outfit once, wait an hour, and then enter a cell with enemies in it, everything should work. Later, if you want to remove this outfit, maybe your character's going back to Megaton or Rivet City (wearing outlaw armor wouldn't be appropriate) all of that should work too.

This post has been edited by Renee: May 17 2018, 08:06 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Renee
post May 29 2018, 01:25 AM
Post #22


Master
Group Icon
Joined: 19-March 13



Making an NPC Follower Game: Fallout 3

Note: this method will work for Oblivion too, however, I also had some unsolvable problems with my OB followers. So for now, this only pertains to FO3. Oblivion has CM Partners, as well as Companion Share & Recruit. Both of these mods are so well done, it's almost pointless to try and top them.

Personally though, I've been dissatisfied with the follower mods I've seen in Fallout so far. Maybe that's why I decided to learn how to make my own.

-------------------------------------

1). Start up the Fallout 3 GECK, yadd yadda....

2). OBJECT window > Actors > NPC
Make a new NPC. Place him or her into the world somewhere. Do the usual: ID, Name, Race, and don't forget to give him or her a Voice Type. Once he or she is in the world, give him/her a Reference ID. Persistent Reference toggled on.

If the follower is going to be combat-oriented, choose an appropriate Class, like "SoldierScout" or "BrotherhoodKnight." Not Doctor, or Drunk.

We also want to give this NPC a reasonably good Disposition Base, so they'll like our character. smile.gif

3). Stats tab:
Change the various settings to make this NPC as you'd like, so they'll be strong, or agile, or proficient with a particular type of weapon, etc. Note that Class tends to change those Skill values around, as well.

4). Factions tab:
Putting the NPC into a particular Faction is good, but the Player Faction is NOT important at all. Do not put them in Player Faction, I have found it can actually cause problems.

AI Data tab
This can vary a lot of course, depending what kind of NPC follower you're going to make. A combat-oriented character (if we want him / her to live) should have Aggression set to Aggressive, Average for Confidence, and Helps Friends and Allies for Assistance. We don't want them too aggressive or confident; this can cause them to do stupid things.

Even with the settings I just suggested, they can still do stupid things. wacko.gif But those are the settings I prefer. If you'd like to know more about setting up an NPC, just follow the GECK's official page.


5). OBJECT window > Actor Data > Quest
Right-click > New into the Editor ID window. Quest Name is not important, except for your own reference. None of this will appear in-game, except NPC dialog.

Make sure Start Game Enabled is on, and Priority can be 55. Script Processing Delay can be on.


6). We're going to write a script now.... under the main script area, so make sure its type is Quest. Note that this script is ultra-short.
===========

sciptname aaaFollowerScript

short Status

; 0 = Sandbox, 1 = Follow, 2 = Wait


============

Note: The semi-colon to the left of 0 = Sandbox is there to make sure the game's engine won't read the words which come after the semi-colon. The game will not actually read anything after a semi-colon (on that particular line of text, anyway), so you can type whatever you'd like after one, for your own reference.

Save the script and close it. Click OK (closing the Quest window), save, reopen the Quest window, and find your script in the scroll-bar.


7a). Go back into the NPC's AI Packages tab, right-click > New into the AI Package List window, and make a Sandbox AI, by changing the Package Type scroll-bar to Sandbox. Give your package an ID name too.

7b). Click on the the Wander Location button, and change it from Near Editor Location to Near Current Location. Click OK. Make Radius = 1000, or whatever number you choose. Numbers lower than 50 will cause them to wander in almost in a circle. Anything over 500 will give the follower some breadth, causing him or her to move around an entire room or two.

Basically, this Sandbox package will be used whenever we leave the follower in a situation that isn't dangerous. For RP purposes, they should be able to move around and do stuff in their time off, since they're "at ease".

7c). We can toggle as many Allowed Behaviors as we'd like. In the Flags tab, we can also leave Enable Fallout Behavior toggled on, for somebody who's got some dynamic off-time going. Or we can toggle this off, and then click whatever behaviors we'd like the follower to allow.


7d). Conditions tab: right-click > New into the Conditions window. Choose "GetQuestVariable" in the scroll-bar, and choose your Companion quest. Status will have a Variable of == 0. Altogether the condition will read...

GetIsID aaaFollowerName == 1.00 AND
GetQuestVariable 'aaaFollowerQuest', Status == 0.00


.... substitute 'aaaFollowerName' with the actual ID name of your NPC.
.... substitute 'aaaFollowerQuest' with whatever ID name you gave your quest.


8a). Now make a Follow AI. Follow all the steps in 7a, except find Follow in the scroll-bar this time.

8b). In the Follow Target area, choose "Specific Reference," and choose Player in the Ref scroll-bar. "Cell" is not important.

8c). "Follow Distance" can be set at 300 for close-quarter action, or much further away if we want a tail rather than a shadow.

8d). Uncheck the "EndLocation" toggle.

8e). Flags tab
We can leave Enable Fallout Behavior on (or turn this off, but choose a few individual flags, like "Reaction to Player Actions"). But make sure to also check the "Continue during Combat" toggle on. "Allow Swimming" and "Allow Falls" can also be checked on.

On the other hand, "Allow Swimming" might be bad in some cases. It really sucks seeing your follower go rushing underwater just to defeat a mirelurk. rolleyes.gif Next thing you know, your stupid follower is drowning.

8f). Under Conditions tab, we can choose our GetIsID, along with GetQuestVariable 'aaaFollowerQuest', Status == 1.00


Now, to make a Wait AI. "Wait here" is going to be used to make an NPC just stand in one place. This is obviously best to use once we're out in the field again. The follower won't go wandering off, and is less likely to attract danger because of this.

9a). Right-click > New into the Editor ID window again. Choose "Guard" for the Package Type.

9b). Under "Reference to Guard" leave the 'Linked Ref' toggle on. "Remain Near Guard Location" can also be on. Press the rectangular button (it should say Near Editor Location by default) and change this to Near Current Location. Guard Location Radius can be 0, for best results.

9c). Flags tab
Most of these should be off, unless we've got ourselves a chatty, undisciplined follower who doesn't stand down very well. sad.gif For best results, of course, just turn all the Fallout Behavior stuff off.

9d). Conditions tab shall be ...

GetIsID aaaFollowerName == 1.00 AND
GetQuestVariable 'aaaFollowerQuest', Status == 2.00




12). QUEST window > Topics tab.

We're going to make a total of four GREETINGS, and five dialog Topics. Go ahead and right-click > New a GREETING topic, as well as these five dialog topics: one to do with Following, Waiting, Trading, getting Fired, and a "Goodbye" topic.

12a). The first GREETING should literally be a 'first time' greeting, which will be what the follower says to our character when first met. "Hey, who are you?" or whatever. That's a bad example, but you can get more creative here. Make sure "Say Once" is toggled on. The only Condition will be a GetIsID, for that particular NPC.

Now, in the Add Topic window, we can link from this first GREETING to only the Follow topic.

>>> 12b). The second GREETING assumes we went ahead and got this NPC to start following us. Conditions go....

GetIsID aaaFollowerName == 1.00 AND
GetQuestVariable 'aaaFollowerQuest', Status == 1.00


... since this GREETING will be what the follower says when actively following. Dialog for this greeting can be "What's up? Why have we stopped?" or whatever.

In the Add Topics box, right-click > New, and then link this GREETING to the Wait, Trade, You're Fired!, and Goodbye topics. When the NPC is already following us, we'll be able to tell him or her to "Wait here," "Can we trade some things?" and so on.

>>> 12c). The third GREETING is going to be used when the guy has been waiting around in Guard mode (not moving, in other words). "Hey I'm bored. When are we gonna get going again?"... Copy All Conditions from the second GREETING, and paste them into the third. But we're going to change the final number to match what's in the Main Script.

GetIsID aaaFollowerName == 1.00 AND
GetQuestVariable 'aaaFollowerQuest', Status == 2.00


In the Add Topics box, add all the topics except the Wait one, since the NPC is already waiting during this greeting (duh).

>>> 12d). The fourth and final GREETING will be used once the NPC has joined us (or we've fired him or her, or he/she hasn't been hired yet), yet still is in Sandbox mode. So the NPC will say "Want me to follow?" for this GREETING, or whatever.

GetIsID aaaFollowerName == 1.00 AND
GetQuestVariable: 'aaaFollowerQuest', Status == 0.00
, since this GREETING will be what the follower says when he or she is still sandboxing.

In the Add Topics box, only add the Follow and Goodbye topics. This way, we have the option to have the NPC follow us (breaking Sandbox mode) or simply stay there.



13a). For the NPC following topic. Give the NPC some stuff to say under Response Text ("YES, time to kick some Wasteland ass!") and add some words into the Prompt slot to make some text for us to click on, telling the NPC that we'd like him or her to start following us. "Hey, I could use your help," is fine.

Paste the same Conditions from the GREETING, but this time it will be ...

GetIsID aaaFollowerName == 1.00 AND
GetQuestVariable: 'aaaFollowerQuest', Status != 1.00


Note: != means "does not equal one."

13b). In the Result Script (End) box it should say these three things:

Set aaaFollowerQuest.Status to 1
aaaNPCFollwerRef.EVP
SetPlayerTeammate 1


Substitute "aaaNPCFollowerRef" with the actual Reference ID of your follower.

> EVP stands for EValuate Package. It is what the GECK uses to translate stuff, somehow.


*Note that final script: SetPlayerTeammate. This will make sure the follower tends to mirror the pc's behavior. So the follower will sneak if we do. He/she will draw their weapon when we do, and also use up any ammo we give him or her. Ammo which is a default part of their inventory though (from the GECK) will not decrease.


13c). In the Add Topics box, add the Wait, Trade, and Fire topics, so that even after we ask them to follow, we can change our mind, or still trade with them.


14a). Now, the Wait topic. Follow all the steps from the Follow topic, but make sure "Goodbye" is toggled on, if you want a quick exit.

14b). Paste all the same Conditions from before, but this time the quest variable will be....

GetIsID aaaFollowerName == 1.00 AND
GetQuestVariable 'aaaFollowerQuest', Status == 1.00


14c). Result Script (End) should be

Set aaaFollowerQuest.Status to 2
aaaNPCFollowerRef.EVP



15). Next is the Dismiss (or Fire) topic. Give this an appropriate Prompt ("Time for us to part ways, pard'ner...") and NPC Response Text ("WHAT? I thought we were buds! You suck!"). "Goodbye" should be checked on.

GetIsID aaaNPCFollower == 1 AND
GetQuestVariable: 'aaaFollowerQuest', Status != 0


The Result Script (End) should say

Set aaaFollowerQuest.Status to 0
aaaNPCFollowerRef.EVP.
SetPlayerTeamMate 0


Note that last one, the teammate one. This will cancel any behaviors the NPC was up to before we fired him or her. So if this NPC was sneaking especially, they will go away while not sneaking. sad.gif


16a). Now, Trading topic. Do all the stuff with dialog and Prompts. Set the condition window like this to make sure he only trades while following.

GetIsID aaaFollowerName == 1.00 AND
GetQuestVariable aaaFollowerQuest.Status == 1.00


We can also set it so that he'll trade only while waiting, by changing that 1 to 2. And there's actually also a third option, as seen below...

GetQuestVariable aaaFollowerQuest Status != 0

I actually like this one the best. It allows the NPC to trade while they're following or waiting. Only when sandboxing will we not be able to trade stuff.

16b). We also have a choice of 'hearing' the NPC speak either while his/her inventory is opening, or after it opens. If we put the following in the Result Script (Begin) window, it will make them speak while we are looking at their stuff, the way some merchants speak while we're starting to browse their menus.

OpenTeamMateContainer 1

If we put this into the End box, they will say what they have to say, and then show us their inventory.

The 'Trade" topic does not need anything in the Add Topics box, so leave this box blank.


17). Finally we need a way to get out of conversations. which is the Goodbye topic. We can just make some dialog and Prompt, and choose the Goodbye toggle. We can use the same GetIsId, but we finally won't need a GetQuestVariable, so that we can say Goodbye to this NPC whether or not he /she is following.


18). Now... Priorities. In the upper right hand corner of the Topic panel is a small slot for Priority. Give this Goodbye topic a lower Priority than the others (all of which will be 50 except for GREETING, which is 55). We can give the Goodbye topic 49. What this does is it causes the NPC's topics to appear from top to bottom according to how high each Priority is. "Goodbye" will always appear toward the bottom.

That should be all. smile.gif Note that during actual gameplay, NPC followers sometimes wander off and do their own thing, when they're supposed to be following us. This happens especially when going from one cell to another: indoor to outdoor is most common. This can get frustrating! But even though there are some long pauses when it seems the NPC is nowhere around, they eventually do start following.


19A). Oops, one more thing. We can add a script to the NPC follower which makes them not only heal up, but which will also restore several of their stats, especially once combat is over. Here it is.

--------------------------

scriptname aaaNPCFollowerScript

Begin OnCombatEnd

If (GetPlayerTeammate == 1)

ResetHealth
restoreav PerceptionCondition 100
restoreav EnduranceCondition 100
restoreav LeftAttackConditino 100
restoreav RightAttackCondition 100
restoreav LeftMobilityCondition 100
restoreav RightMobilityCondition 100

EndIf
End

Begin OnDeath
Set aaaFollowerQuest.Status to 0

End


---------------------------------

This script is especially helpful, since followers don't seem to use stimpaks, even if we add these to their inventories. mad.gif Grrr.....

The death script at the bottom is basically a "clean up" function, which turns the entire follower quest off for that particular NPC, once he or she had died. It cancels any running background scripts to keep the game not sending or collecting any information to this dead NPC.

This post has been edited by Renee: Jun 1 2018, 03:14 AM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Renee
post Jun 10 2018, 11:53 PM
Post #23


Master
Group Icon
Joined: 19-March 13



Timer Scripts. Game: TES IV: Oblivion or Fallout 3

Today's post is going to be another shortie, and shall deal specifically with timers. I use timers a lot, for a bunch of different ideas, so it'll be good to have a timer standalone post.

There are a couple different types of timers Bethesda uses; daily and hourly versions. I've only figured out the daily ones. Timers can be used in all sorts of ways for scripting, for a variety of different functions. In this case, the timer script below will cause a quest stage to advance.



1). Open up the Oblivion Construction Set, or Fallout 3 GECK. File > Data.

2). Find the esp you've been working with and activate it, bla bla bla..

...Let's say a quest is already being written, and there are two quest stages. For now, I'll call them Stage X and Stage Y. Between these two stages is going to be a timer script, which triggers after Stage X begins. And Stage X begins due to some sort of event. This event can be any number of things: Maybe an NPC finishes pontificating a speech. Maybe a door gets unlocked. Maybe an enemy gets pwned. Maybe a certain calendar day gets passed. Whatever it is, the event causes Stage X to occur. Once X is happening, now the timer begins its job. The timer counts down a day, or a certain number of days. Once the timer's job is done, the quest advances from Stage X to Stage Y.

Hope that made sense. rolleyes.gif Basically the process goes: event occurs, quest bumps to Stage X, timer begins, a day (or more) passes, timer ends, quest bumps to Stage Y.

That is just one example of how a timer script can be used. And here is how to set it all up.


3). Go into your quest's Quest Data tab. Open up its main script.

And here is the script necessary to make the timer begin...

-------------------

scriptname aaaQuestnameScript

short Timer
short StartDay

Begin GameMode

If (GetStage aaaQuestname == X)
If (Timer == 0)
Set StartDay to GameDaysPassed
SetTimer to 1

EndIf
EndIf

If (Timer == 1)
If ((GameDaysPassed - StartDay) >=1)
SetStage aaaQuestname Y
Set Timer to 0

EndIf
EndIf

End


------------------

Notice the "StartDay) >=1" part. The number 1 means at least one day must pass before the quest stage advances from X to Y. The number 1 can be changed to whatever you'd like though: 3... 10 .... 16 whatever you'd like. I'm sure there is some sort of limit here. Not sure what this could be though. I've gone as high as 30.

Let's say Stage X is actually Stage 30, and Stage Y is actually Stage 40. Altogether, this means an event happens which sets Stage 30 (whether an NPC gives us information, a door is opened, the death of an NPC occurs, whatever). Since the quest is at 30, this triggers the timer to begin. After a day (or more) has passed, the timer automatically moves the quest's stage to 40.

During playtesting, the timer might sometimes require more than an actual day before it does its job. We've all been there during certain Bethesda quests, right? laugh.gif We wait and wait for ... whatever the quest is supposed to do next. An example is during Oblivion's Main Quest, when Martin needs time to translate the Mysterium Xarxes. This takes several days, if I remember correctly, during which some gamers can become impatient.

I think it all depends on what hour the timer began. In-game days begin at midnight, just like they do on Earth. I haven't figured out what this means in-game though, pertaining to timer scripts. Does the timer begin counting at the very hour the event occurs? (9 pm, for instance?) or does it start at midnight, since that's the beginning of the next day? .... I haven't figured that out, yet.

To be safe, if you want 10 days to go by, and the quest must get something done within 10 days, you can use the number 9 instead of 10, in the StartDay line. Chances are, 10 days are what will pass.


4). Save the script and close it.

And that is all. As I said, timers can be used to do all sorts of things, not just triggering quest stages. The first time I used a timer, I managed to make a quest advance, but the timer also made two NPCs teleport from two outside cells, into Summitmist Manor. These two NPCs met, had a conversation full of threats and insults, and then began attacking one another.

Here are some other examples: timers can be implemented to make rooms rentable by day, houses rentable by month, quests reset back to their beginning (for Skyrim-type revolving bounty stuff), NPCs can begin to travel from one town to another and so on. All of these ideas will be explained in future posts.

This post has been edited by Renee: Jun 27 2018, 07:56 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Renee
post Jun 24 2018, 03:37 AM
Post #24


Master
Group Icon
Joined: 19-March 13



Making a house for sale or rent. Game: TES IV: Oblivion

(This also works for Fallout 3, but there are enough differences between each game that Fallout will get its own post).

This one is going to explain how to make a house (or flat, or whatever sort of dwelling you'd like) into something we can not only buy, but also rent. And when we rent this space, we'll be able to make it rentable for an entire month.... or however long you'd like.

But why rent, when we can just buy?


Glad you asked. It's because in many cases (if we're keeping things somewhat realistic, as per the vanilla game's policy on housing prices), our character cannot afford the house he or she may want to buy. Not until later on, when lots of money has been accrued. Renting is cheaper, therefore we can get a place earlier. I also like the idea of having something to always spend money on. And it's just fun making this stuff up, and seeing it all work in-game.

We can create a new place to live, or we can use one which is already in the game, it doesn't matter. Here is my personal story on how the idea came about.




1a). CELL + RENDER windows
First thing to do is find the place's interior in the cell window, and then click on its Door Marker so now we're outside. Double left-click on its door. Give this door a Reference ID. I'm going to give this door a Ref ID called aaaFrontDoorRef.

1b). Click on the Lock tab too, and lock that door if it's not already locked. Or, lock that door with a tougher lock than it has. Click OK, closing the door's Reference panel.

1c). OBJECT window > Items > Key. Edit a key, save it as a New Form. If the door already has a key, this key can be used and a key won't need to be created.

1d). Reopen the door's Reference panel > Lock tab. Use the door's Key scroll-bar to find the key you just made. Again, if it already has a key, just keep using that one. Click OK.


2a). OBJECT window
Edit a named NPC. I wanted this NPC to also buy & sell stuff, so for convenience, I edited Velus Hosidius, the guy who runs the Merchants' Inn in the I.C. Market District. Since Velus is already a merchant, this will make setting him up easier. I edited his ID to aaaHouseAgent and changed his Name to Leyawiin House Agent.

Click OK, closing the NPC's panel.

2b). Place the NPC housing agent out in the world and give him or her a Reference ID. This NPC is going to be our agent who we rent the house from, or buy it from. So depending where we put him, we should alter his Faction, his AI, his Inventory, etc.

2c). Class can stay as MerchPublican, unless there's some specific reason to change it.

2d). Whoever you chose to edit, make sure to get rid of all his or her AI. If you want the agent to buy & sell stuff, you can keep any AI that has the "Offers Services" toggle on, just make sure to change the AI package's Cell Location to where the NPC has been placed. You can also add your own AI (making the agent travel or sleep or whatever) though that is optional.

2e). Get rid of any script too, by scrolling the scroll-bar up until it says NONE.

2f). Click OK and use the main tool bar to SAVE.

2g). Now, open up your NPC house agent's panel again. Start a new script. The script's Script Type will stay as Object, and the script itself is incredibly simple, compared to what Velos had.

-------------------------

scriptname aaaHouseAgentScript

short Rent


-----------------------------

2h). Close and save that script. Click OK (closing the house agent's panel) and reopen it. Find the house agent's script. Click OK again. bluewizardsmile.gif And that's all for his script.

It's a good idea to leave the agent on-screen, in the Render window. Later on when conditions are being set up (as the quest is being made), the agent can be clicked upon to quickly set up some stuff that'll be gotten to in a few more steps.


3). QUEST window > Quest Data tab
Press the Q button on the main toolbar, and start a new quest. All the typical things that usually go into the Quest Data page will also be in this one. Start Game Enabled toggled on, GetIsPlayableRace == 1.00 under Quest Conditions, etc. The only difference is we don't have to set Priority very high. Matter of fact, it can be as low as 10, especially since the NPC we're dealing with won't be associated with any other quests.

4). Quest Stages tab:
A minimum of three quest stages go in the Index window. I am choosing 0, 5, and 100.

You can add more stages than this if you'd like to build some sort of story, and make this into an actual quest. But the basic build only requires three stages.


5a). Topics tab
Go ahead and give your NPC a GREETING. He / she will explain that there is a house for rental or purchase in his / her dialog. "How fares thee? My name is X, and I am the official housing agent here in X. Have you come to rent or buy a home today?"

There are three Conditions:

GetIsID aaaHouseAgent == 1.00 AND
GetStage aaaQuestName < 5.00 AND
GetScriptVariable 'aaaHouseAgentRef', Rent == 0


For the GetScriptVariable, when it asks for a reference, just click the "Select Reference in Render Window" button, and then double left-click on the agent. This'll set things up nice and quick.

.... that final Condition (the GetScriptVariable) is one I'd never used before, at the time that I made this mod. What this does is makes sure the agent ONLY says this greeting if we have not rented the place yet. Of course, this is the first time we're meeting the agent, so of course it hasn't been rented yet. But that line of code will show up several times later on, and it's got an ability to make sure certain dialog happens when the agent is spoken to, or does not happen.

Buying the place won't require this variable, because if we can afford to buy it, the entire quest simply ends. But if we rent it, the game needs to know whether or not we've already rented the place, so that the agent's dialog fits what is happening. This variable will also ensure that the game won't keep taking our money, if we accidentally try to rent after the place has already been rented. .

When we speak to this agent for the first time, this will bump the quest into a "middle" stage, which I'm calling Stage 5. This stage does not actually need a Log Entry (it's like if we rent a room from Velus, or any innkeeper; there is no need for a quest stage to appear). But it's important to make this quest move forward via SetStage. This way, we can add dialog which includes the moment that agent is first met, and also after we meet him or her. Dialog will be different in each situation, which adds some realism.

5b). So, in the Result Script add Player.SetStage aaaQuestName 5

Substitute your quest's name where it says "aaaQuestName."


6). Choices box: Add two dialog choices here: one which will lead to renting the space, another which will lead to buying it. aaaRent and aaaBuy.


7a). First, let's discuss renting. In the Editor ID, find the two Choices just added, and add them into this window as well. Now let's choose the Topic which will allow rental dialog.

7b). "How much to rent the place?" we can put under Topic Text. And give the agent a response. "It's your lucky day! The market has been down, and so we're asking for 300 gold per month," or whatever you think is appropriate.

7c). In the Conditions window, we can just copy/paste everything from the GREETING, including the Script Variable. The only difference will be the GetStage Condition, which will reflect that middle stage the quest has bumped to.

GetIsId aaaHouseAgent == 1.00 AND
GetStage aaaQuestName == 5.00 AND
GetScriptVariable 'aaaHouseAgentRef', Rent == 0


7d). Now, add two more choices in the Choices box: one which is a "Yes" response (aaaRentYes), and one which is a "No" response (aaaRentNo).

7e). Add these into the Editor ID window, and change the Topic Text for each into plain English. "Yes, I'd like to rent it", and "No, I changed my mind."


First, the aaaRentYes topic: Once we're back in-game, and at the moment when we wish to rent, there has to be some way for the game to know if the character has enough money. If the character can afford to rent it, there'll be a response for this. We'll also need to make a response which the agent will say if we can't afford to rent it. Go ahead and make both of these responses: "Very well, your house has been rented. You'll find its door unlocked for the next 30 days," or "Hmm, seems you haven't enough gold at this time."

8a). Let's say the agent is asking 300 gold a month, and our character can afford this. Here are what will go in the Conditions box for that response...

GetIsId aaaHouseAgent == 1.00 AND
GetStage aaaQuestName == 5.00 AND
GetScriptVariable 'aaaHouseAgentRef', Rent == 0.00 AND
GetGold NONE >= 300.00


8b). Toggle "Run on Target" ON for that final condition (the GetGold one). The character needs to have 300 gold or more, to make this response happen, and the game engine needs to be able to look into the character's inventory at this moment. If Run on Target is not toggled on, the game won't be able to "see" how much gold the character has.

8c). In the Result Script box, add the following.

aaaFrontDoorRef.unlock
Player.RemoveItem Gold001 300
Set aaaHouseAgentRef.Rent to 1
SetCellOwnership Cell


> Substitute 'aaaFrontDoorRef' with the Reference ID you gave the door of your rentable space.

> Substitute 'Cell' with whatever cell your character is going to be living in. This assumes (of course) the Player does not already own this cell. So in my game, that final script is SetCellOwnership LeyawiinCingorsHouse


Overall ... when the agent is spoken to, and we tell him or her we'd like to rent the place, what'll happen is the game will automatically unlock the place's door IF our character has 300 gold, or more. The game changes the place's Rent variable from 0 to 1, which causes the agent's dialog to follow a different path if we try to speak to him / her again. And finally, the game makes sure the cell now belongs to the player-character.


9). Now ... if your character can't afford the 300 gold, here are the Conditions for this...

GetIsId aaaHouseAgent == 1.00 AND
GetStage aaaQuestName == 5.00 AND
GetGold NONE < 300


... Again, make sure GetGold has Run on Target toggled ON. "Goodbye" can also be toggled on, making the NPC ForceBye us, because he or she's not happy that we're wasting their time.


10a). Make a second GREETING, this one saying "You're back. And the place is still available. Would you like to rent or buy it?" ... The NPC will say this Greeting after the place has been rented, but 30 days have passed, therefore the rental has expired.

10b). Again, include the same topic Choices (for renting or buying) which were included during the first GREETING: aaaRent and aaaBuy. These choices will lead in the exact same directions as they did after the first GREETING, which ensures that this quest is repeatable, giving us maximum choice all along.

Conditions look like this....

GetIsId aaaHouseAgent == 1.00 AND
GetStage aaaQuestName == 5.00 AND
GetScriptVariable 'aaaHouseAgentRef', Rent == 0.00


10c). Now, make a third GREETING. This one will show up after the place has been rented, but the rental has not expired yet: "You are back. How is your lovely home? You have already rented it, are you thinking of buying today?"

GetIsId aaaHouseAgent == 1.00 AND
GetStage aaaQuestName == 5.00 AND
GetScriptVariable 'aaaHouseAgentRef', Rent == 1.00


We have not written any "buy" dialog yet, but we'll do that in a moment. For now, just click OK (closing the quest window) and save. And reopen the Quest window.


11). QUEST DATA tab
It's that time! Time to write a script, and it's going to be a timer script, just like in the post above this one. This timer script will allow the game to rent us the place for however long we'd like. Let's say we're renting it for 30 days. Here is what the script will look like.

------------

scriptname aaaHomeScript

short Timer
short StartDay

Begin GameMode

If (aaaHouseAgentRef.Rent == 1)
If (Timer == 0)
Set StartDay to GameDaysPassed
Set Timer to 1

EndIf
EnfIf

If (Timer == 1)
If ((GameDaysPassed - StartDay) >= 29)

If (Player.GetInCell Cell != 1)
Set Timer to 0
aaaFrontDoorRef.lock 100
set aaaHouseAgentRef.rent to 0

Message "Your home rental has expired", 36

EndIf
EndIf
EndIf

End


----------------------------

So... this timer ensures that several things will happen. When the agent has been paid 300 gold, this begins the timer's script. After 30 days have passed, this script now LOCKS the front door with a "Needs a Key" lock. An easier lock can be placed here if you'd like. Just change 100 to any number between 1 and 99, if you want a situation in which the house can possibly be broken into. This door will ONLY Lock if the character is not inside the cell though, ensuring the character won't get locked in. There is also a message which tells the player when the rental terms are over, which will stay onscreen 36 seconds. This part is optional and may be game-breaking for some, but it helps to know if the quest is working, or not.

Finally, in the line which says StartDay, note that I put 29 instead of 30. The game always seems to add an extra day.

Optional: If desired, the game can also give the character the key, which opens the front door. Make this key a Quest Item, so it can't be dropped, and then picked up later on after the rental has expired. This key can get added via dialog, at the moment of rental (player.AddItem aaaFrontDoorKey 1 would go into the Result Script box). This key can also be removed after 30 days have passed. The Main Script is used to remove this key, once the timer is finished, by putting Player.RemoveItem aaaFrontDoorKey 1 into the second block of If/EndIf texts, under the line which says aaaFrontDoorRef.lock 100. Adding a key during the rental phase is more necessary in Fallout than it is in Oblivion (Fallout doors tend to lock themselves prematurely).


12a). TOPICS tab
Now, it's time to finally going to add dialog and Topics which will allow the agent to sell the place. Selling is not nearly as complicated as renting. Click on the Buy topic you created before, and change its Topic Text to something appropriate. "How much to buy the place?" or whatever. And add some appropriate text like as a Response. "It's your lucky day! We're asking just 2000 gold."

Conditions look like this:

GetIsID aaaHouseAgent == 1.00 AND
GetStage aaaQuestName == 5.00


12b). Let's say the place does cost 2000 gold. In the Choices box, make a choice which says includes a Yes response, and one which includes a No response: aaaBuyYes and aaaBuyNo. Add both of these into the Editor ID as well.

12c). For the aaaBuyYes topic, if the character has the 2000 gold, everything moves forward, and the entire quest comes to an end.

Conditions:

GetIsId aaaHouseAgent == 1.00 AND
GetStage aaaQuestName == 5.00 AND
GetGold NONE >= 2000


Make sure "Run on Target" is toggled ON for GetGold.

12d). Result Script is very simple: Player.SetStage aaaQuestName 100

12e). Make a second response for aaaBuyYes, in which the character wishes to buy the place, but hasn't got enough gold. "Ahhm. Seems you haven't enough. I asked specifically for 2000 gold!!!"

GetIsID aaaHouseAgent == 1.00 AND
GetStage aaaQuestName == 5.00 AND
GetGold NONE < 2000


12f). Toggle Goodbye on for this response, if the agent becomes haughty, angry, or whatever. mad.gif Or maybe the agent remains cordial. Don't toggle goodbye, if this is so, and make the agent smile.


13a). QUEST STAGES tab
Go to the final stage (I am calling this Stage 100). Add a Log Entry, denoting that the house, the warehouse, the loft, etc. has been purchased. "I have decided to purchase the home.... bla bla bla."

Result Scripts should be....

Player.RemoveItem Gold001 2000
Player.AddItem aaaFrontDoorKey 1
SetQuestObject aaaFrontDoorKey -1
StopQuest aaaQuestName


> The "SetQuestObject" script is only necessary if the key has been made into a quest item earlier for the rental phase. If it hasn't, don't worry about this script.

> Since we're purchasing this house and the agent will never talk to us again, he / she simply gives us the key we made in step 1a.

13b). Don't forget to toggle Complete Quest on.


14). Topics tab
Finally, fill in the Topic and dialog which causes the PC to back out of buying the place. This is the topic I called aaaBuyNo earlier. "2000 is too much," or whatever. Again, the NPC's response can be haughty if you'd like. Conditions are just the same GetIsID as before, along with the GetStage pertaining to Stage 5, or whatever number you chose for the quest's middle stage.

Voila.

This post has been edited by Renee: Jun 30 2018, 02:05 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

2 Pages V < 1 2
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 

- Lo-Fi Version Time is now: 19th July 2018 - 04:21 PM