Welcome Guest ( Log In | Register )

4 Pages V « < 2 3 4  
Reply to this topicStart new topic
> Renee's Modding Thread
Renee
post Jul 26 2020, 06:07 PM
Post #61


Councilor
Group Icon
Joined: 19-March 13
From: Ellicott City, Maryland




Horse Rentals. Game: TES IV: Oblivion


This is going to make a horse rentable in TES IV: Oblivion. Renting a horse (rather than buying one) is good for someone who hasn't go a lot of money available yet. Another advantage is: if the horse gets killed, at least the PC did not blow weeks or even months of earnings! In roleplay terms: maybe the character has also not become too attached to the poor horse in such a scenario.

So this idea is going to make it possible to rent a horse for one month, from a Chestnut Handy NPC who I'm something going to call Stable Master, or aaaStableMaster. After the horse is rented, it is essentially owned by the Player. After a month has passed, the horse will return to Chestnut Handy Stables, near the Imperial City. It will also no longer belong to the Player.


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

OBJECT window > Actors > NPC
1). Edit an NPC, doing all the usual steps, and place this NPC wherever. This is going to be the stable master who we rent the horse from. I am going to call this guy aaaStableMaster

I am placing my NPC (an orc) into the Chestnut Handy pen, where all the horses are kept. In fact, my original idea was so make this NPC sell horses, not rent them, since the vanilla game doesn't allow us to buy horses here (ahem). But buying horses is nothing new. I want to try something new.


Now to make the horse itself. Horses are to be found in two areas of the Construction Set's Object window: Creature > Creature or Creature > Horse.

--Do not edit anything from the Creature > Creature section. These cannot be ridden. These are (in fact) the wild horses which can sometimes be seen south of the Imperial City.

--Do not edit anything quest-related, or anything from the MyHorse area. nono.gif
--Do not edit an ImpLegion horse.


Actors > Creature > Horse
2a). Right-click > Edit a basic horse, such as HorsePaint. These are good to start with since they haven't got any scripts.

2b). Change ID and Name, I am calling it aaaPaintHorseRental and Paint Horse Rental.

Stats tab
2c). By default, most horses are Level 1, and they are somewhat weak. A Bay has 250 health, for instance. This may seem quie a lot, but since it's possible for a person to acquire even more, I don't feel bad toggling PC Level Offset on. This horse is special. It can have hundreds more health. It'll last longer, if it happens to get into a fight!

2d).
Toggle Respawn on (if it's not on). You can leave Can Corpse Check toggled on or off.

2e). Get rid of any AI packages.

By default, base horses have zero Aggression, 50 Confidence, 25 Energy Level, and 50 Responsibility.. They will never pick fights, but somehow they'll be able to know if our character is stealing. Weird. Change these around, if desired.

Factions tab
By default, basic horses are part of the Prey faction, which has an interfaction relationship of -50 to the Creature Faction. Yikes. It's up to you if you'd like to place this horse into the HorsePC faction (which causes the horse to stay absolutely loyal to the Player, unless broadly attacked over and over) or play around with a customized faction. The reason this is important is by default, horses get attcked by a lot of Player enemies, which can get annoying. It might be prudent to try to change this.

I am going to experiment by not putting the horse into any faction at all. Because like I said, the vanilla game has an annoying habit of making enemies attack our horse first, instead of attacking the PC. Maybe this has something to do with the HorsePC faction MyHorses are placed into.

2f). Click OK, saving as a New Form. Find an appropriate worldspace, and place the horse out into the world.

2g). Give the horse a Reference ID. I am calling it aaaPaintHorseRentalRef. Copy this ID and paste it onto a Notepad page so it can be pasted into scripts later.

2h). Click on the Ownership tab, and find the NPC stablehand in the NPC scroll-bar. If the horse is not rented, this NPC owns the horse, and it's considered stealing if it's not paid for. Click OK.

OBJECT window > WorldObjects > Static
3). Drag an XMarker out into the Render window. Give this X-marker a Reference ID. I am calling it aaaPaintHorseReturnXMarker. This marker is where the horse will return after its rental terms is over.

Again, copy this ID and paste it onto the same Notepad page, so it can be pasted into scripts later.


QUEST window
4a). Start a new quest. This quest does not need a name, unless you want it to appear in the Quests section of the in-game menu for some reason. Otherwise, this quest does not require stages, and therefore does not need a Name.

4b).
Change Priority to 30. This is the standard number for Bethesda's own Horse quest.

4c). Leave Start Game Enabled toggled on. Toggle Allow repeated conversation topics on as well.

4d). GetIsPlayableRace == 1.00 goes into the Quest Conditions winow.

4e).
Start a script, and add these variables.

scriptname aaaHorseQuestScript

short Rent
short Timer
short StartDay


Save that, click OK, and reopen the quest window. Find the script in the scroll-bar and click OK. Reopen the quest window.


Topics tab
5a). We're going to make a total of five GREETINGs. Each one has a different set of options and QuestVariables.

Greeing one is what starts the dialog. "Hi, my name is Bob. I rent horses here at Chestnut Handy Stables...." this NPC explains that he or she rents horses, rather than sells them (or eats them).

5b). In the Conditions window, make a GetISID for the NPC created ealier.

GetIsID NPC: aaaStableMaster == 1.00 AND
GetQuestVariable 'QuestName', Rent == 0.00


5c).
In the Result Script box, type Set QuestName.Rent to 1

5d). Right-click > AddTopic into the Add Topics window. Start a new topic called aaaHorseTopic. Add this into the Editor ID window, too.
----------------------------

Greeting Two: this gets spoken if dialog is started (the first GREETING is spoken), but for some reason the PC backs out of conversation.
The dialog spoken during Greeting two can be siomething simple. "Can I help you?" Conditions go like this...

GetIsID NPC: aaaStableMaster == 1.00 AND
GetQuestVariable 'QuestName', Rent == 1.00


Add the same aaaHorseTopic into the Add Topics window.

-------------------
Greeting Three: this is another interim greeting, spoken when the QuestVariable is at 2. Again, this gets spoken if the Player backs out of conversatio early, but then returns to the NPC.

GetIsID NPC: aaaStableMaster == 1.00 AND
GetQuestVariable 'QuestName', Rent == 2.00


Add the same aaaHorseTopic into the Add Topics window.

Set QuestName.Rent to 1 goes into the Result Script box.

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

Greeting Four gets spoken after the player-character rents the horse, backs out of conversation, but for whatever reason returns to speak to the NPC stable master. "How is your horse? I hope everythin is satisfactory." and so on. By now, the PC temporarily owns the beast.

GetIsID NPC: aaaStableMaster == 1.00 AND
GetQuestVariable 'QuestName', Rent == 3.00


Add aaaHorseTopic into the Add Topics window. A Result Script is not needed.

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

Greeting Five is used after the horse rental has ended, and the player retuns to the stablehand NPC to maybe try renting it again. "You have returned.... bla bla bla."

GetIsID NPC: aaaStableMaster == 1.00 AND
GetQuestVariable 'QuestName', Rent == 4.00


Result Script: Set QuestName.Rent to 1

Add aaaHorseTopic into the Add Topics window.

Click OK and save.


QUEST window > Topics tab
6a). Select aaaHorseTopic (or whatever this first custom topic was called). Change the Topic Text name to something in plain English, if necessary.

6b). Two responses are going into the Info window.

In the first one, it is explained further to the PC that there is a horse (or horses) available for rent. "We have paints, bays, and chestnuts..." The NPC explains how much each selection will cost for that month. The stablehand also explains that after the month is over, the horse will return to its home stable. Write this response. Conditions go like this...

GetIsID NPC: aaaStableMaster == 1.00 AND
GetQuestVariable 'QuestName', Rent == 1.00


Result Script: Set QuestName.Rent to 2.

6b). In the Choices window I'll start a Paint Horse topic choice and a No choice. Eventually there will be a Bay Horse Topic choice and a Chestnut Horse Topic choice. But for now, right-click > Add Topic. Since the first horse I'm adding is a paint, I'm calling the topic aaaPaintHorseTopic.

Add aaaBayPaintTopic (or whatever it's called) into the Editor ID window.


6c). Also add a "No" topic into the Chocies window. If you already have a No topic from other quests, this can get reused. If you do not have a No topic, create one, and make sure to add it into the Editor ID as well. Here are its conditions and Result Script.

GetIsID NPC: aaaStableMaster == 1.00 AND
GetQuestVariable 'QuestName', Rent <= 2.00


Result Script: Set QuestName.Rent to 0

6d).
Click OK and save.


7a). Go back into the Quest window and back into the initial Horse topic (which I called aaaHorseTopic). Start a second response. "You have already rented a horse from me, is there a problem?"

GetIsID NPC: aaaStableMaster == 1.00 AND
GetQuestVariable 'QuestName', Rent == 3.00


There is no Result Script or Choices for this topic. After one horse has been rented, it is not possible to rent another; doing so would complicate things. So this topic is simply an empty 'filler' which follows the fourth GREETING.

7b). In the Editor ID window, go back to the first horse choice. I called this aaaPaintHorseTopic. Dialog can go like "Yes, I've got a fine paint available. Slow, but durable, and more highly maneuverable than a faster horse. Good for rugged terrain..."

GetIsID NPC: aaaStableMaster == 1.00 AND
GetQuestVariable 'QuestName', Rent == 2.00


7c). In the Choices window, add a "yes" choice (aaaYesPaint), and a "no" choice. The No choice can be the same No used before. Add aaaYesPaint into the Editor ID.

7d). Select aaaYesPaint in the Editor ID window. Topic Text can be changed to "Yes, I'd like to rent a paint horse." Two responses are going to be written here: one which the stablemaster will say if the PC has enough gold, and one which hte stablemaster will say if the PC does not have enough. Let's start with the first response.

7e). "Very good, that paint over there is now yours for the next thirty days..." says the stablehand. In my game, this guy will charge 120 gold for the month.

GetIsID NPC: aaaStableMaster == 1.00 AND
GetQuestVariable 'QuestName', Rent == 2.00 AND
GetGold ......... NONE.... >= 120


Make sure to toggle Run on Targlet ON for that final GetGold condition.

Result Scripts: aaaPaintHorseRentalRef.SetOwnership
Set QuestName.Rent to 3
Message: "Paint Horse has been rented for one month", 30
Player.RemoveItem Gold001 120


Notice that the SetOwnership script does not refer to the Player. It took me awhile to figure out, if nobody is referenced, the referenced item will automatically go to the Player! panic.gif (You don't know how many error messages I sat through as I kept trying to include Player here. Grr....)

7f). But what happens if the PC does not have enough money? "No, I asked for 120 gold. And this is not enough..." goes the dialog. Toggle Goodbye on, so the quest's dialog gets forced back to the beginning (from the stablehand's point of view).

GetIsID NPC: aaaStableMaster == 1.00 AND
GetGold ......... NONE....< 120.00


Again, toggle Run on Target ON for that GetGold condition.

Result Script: Set QuestName.Rent to 0[b]

[b]7g).
Click OK and save. All the dialog has been written, so phew.


QUEST window > Quest Data tab
8a). Time to write yet another Timer script. I love these things. This has already been started with the three short variables.

scriptname aaaHorseQuestScript

short Rent
short Timer
short StartDay

Begin GameMode

If (Timer == 0)
If (aaaHorseQuest.Rent == 3)
Set Timer to 1
Set StartDay to GameDaysPassed
EndIf
EndIF

If (Timer == 1)
If ((GameDaysPassed - StartDay) >= 30)
aaaPaintHorseRentalRef.SetOwnership aaaStableMaster
Set QuestName.Rent to 4
Set Timer to 0

Message: "My horse rental has expired.", 30

EndIf
EndIf

End


8b). Save that, click OK, and save from the main toolbar.

RENDER window
9a). Make sure the X-marker created earlier is onscreen. It also helps to find the horse as well, and have both of these items onscreen. Double left-click on the horse, and click its AI button. Two packages are needed: one which causes the horse to return home after the rental has expired, and one which causes the horse to NOT return home, assuming it's been paid for.

9b).
Let's start the go home package. Right-click > New into the AI Package List window. Name the ID something specific for that horse, such as aaaPaintHorseReturnHome. Click on the Package Type scroll-bar and find Travel.

9c). Toggle Must Reach Location and Defensive Combat on. You can also toggle Always Run on, which might allow the horse to make it back home without getting pwned.

9d). Click on the Conditions tab. GetQuestVarible 'QuestName', Rent == 4.00 goes here.

9e). Click on the Location tab. Toggle Near Reference on, click Select Reference in Render Window, and double left-click on the X-marker. Click OK.

9f). Right-click > New into the AI Package List window again, and name its ID aaaPaintHorseDismounted. Find Wander in the Package Type scroll-bar.

9g). Toggle Must Complete on. Defensive Combat can also be toggled on.

9h). Conditions tab: GetQuestVariable 'QuestName', Rent == 3.00.

9i). Location tab: select Near Current Location and use a binary number (such as 512) for the Radius slot. This way, the horse will wander around a bit when dismounted, looking for grass to munch on, perhaps. It is also possible to simply choose 0 for Radius, if you really want to keep the horse from wandering into trouble.

Note that when dismounting the horse, this will cause any other rentable horses to also wander a bit in their stables, way back home! This is safe, as long as "home" is not located near an enemy lair.

9j). Click OK. Click Save. Click OK. And Save.

This post has been edited by Renee: Aug 20 2020, 02:40 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Renee
post Sep 27 2020, 12:47 AM
Post #62


Councilor
Group Icon
Joined: 19-March 13
From: Ellicott City, Maryland



Trigger Zones, Game: Fallout 3

Fallout 3 does have X-markers, but it also uses what are called trigger zones or 'triggers" to setstage quests and perform various script-related functions as we pass through them. Triggers can be more effective than X markers. The reason is, trigger zones can be structured to cover an entire area, to make sure the PC will pass through them. X-markers, on the other hand, require scripts to determine how close we are, which don't always work as well.

Here is a good video to watch, for those who want better visual aids.

https://www.youtube.com/watch?v=QaMtpvrEG9E&t=34s

Otherwise, here are some text instructions.

CELL window
1). Go into the Cell or Worldspace where the trigger zone is going to be added.

2). On the main toolbar, find the T button. It looks like a child's block with a T in it, and is just right of the NavMesh button (with red scribbles in it). Click this button.

3). In the Render window, left-click somewhere on the ground, and drag upon it. It helps if the area where you are clicking does not have a bunch of stuff on it (items, Markers, etc.). After you drag on the ground.

4). At first, nothing might happen. Or perhaps a red square will show onscreen. If nothing is seen, just move the mouse upwards (without holding any buttons). Now we should be seeing a transperant red cube. This red cube will be what activates the next stage of the quest, or the next script variable, or whatever.

Once we're back in game, walking THROUGH this red area is what makes things happen, so if it's not big enough, or if it's not in the right area, chances are it might need to be redrawn or dragged. These red cubes can be tricky to move around though.

5). Double left-click on the red cube. This will pull up the Activator panel.

6). We'll need to give it a new ID. Click on the New toggle (next to the ID pane), and give it a new ID name. "Name" is not important, and can be deleted, even.

7). If there is any Script on this Activator, get rid of it by moving the scroll-bar to NONE. Click OK. And Save.

Note: After we close the Activator panel, notice there are a bunch of colored lines & arrows in the cube. Now it can be moved and manipulated. Just left-click and drag. Pull or collapse. The video can give better visuals, of course.

8). Double-click on the red cube. Next, click on Edit Base. Now we're going to add a script, which can be left as an Object. It should look like this..

scn XnameScript

Begin OnTriggerEnter Player

If (GetStage == X)
SetStage X
EndIf

End


Save the script, click OK on the Activator panel, and reopen it.

9). Click Persistent Reference ON.

10). Click OK and as always, save.

The instructions below are for those who wish to attach the trigger zone to a Quest Objective, such as a marker.

11). Open up the Quest window you've been working on (if there is one). Go into the Quest Objectives tab. In the Target Ref window, add a target if this hasn't been done already.

12). In the Quest Objectives tab's Cell scroll-down bar, locate the area where the red cube has been added, and select its Ref.

Note: If this cube has been placed outside (especially somewhere in Wilderness) it may not show up in the scroll-bar. If this is so, click on the "Select Reference in Render Window" button. Make sure that the Render window is still displaying the area where the red cube has been created. Double-click on the cube, and it should automatically get selected as the Ref.

This post has been edited by Renee: Sep 27 2020, 03:36 AM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Renee
post Sep 28 2020, 02:55 PM
Post #63


Councilor
Group Icon
Joined: 19-March 13
From: Ellicott City, Maryland



https://www.youtube.com/watch?v=wj6qGCT4isg...nnel=Seddon4494

Timer script with seconds
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

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

 

- Lo-Fi Version Time is now: 30th September 2020 - 06:56 PM