Jump to content

The wolf answers on scripting


Greywolf

Recommended Posts

Okay I am opening this thread up to answer any and all scripting questions you have to the best of my abilities. I am not a top of the line scripter, but I'm pretty darn close ... besides I know someone if things get hairy (sorry wook ... no pun intended). So ask away ... I'll check this at least once every day ... every other if something comes up.
Link to comment
Share on other sites

yes I acually have a post on this question, but maybe this is a better way at getting the answer I am looking for. I have seen a couple of mods ( morrowind comes alive, and less generic npc's) and it got me thinking. Maybe I can do this myself. What I would like to know is if I want to have the npc's wnder and "teleport" inside do I have to make a script for that, or can I get away with changeing the AI that the npc uses? I know that I will need a script for some of the things I want them to do ( like go indoors when it starts to rain,or when it gets dark). Also one of the things that I have an ideal for is makeing the bars more "lively" by haveing some of the npc's go in. Your thoughts will be greatly apreciated. (note to any moderators: my post called "need some advice for a plugin" can be closed, it did not< for the most part, give me the answers I needed.)
Link to comment
Share on other sites

Ok hehe hi ya and how ya doing :)

 

NPC's.

 

Firstly in order for each NPC to go inside there own respective homes on bad weather and darkness, each NPC will need there own script (you could do this as a global with all the NPC's ID tags and all there respective houses if you liked but disposing of one of the courpses might corrupt the script) these scripts would just be basicly if (condition) position cell blah blah blah blah set state to blah (remembering if the npc is inside or outside so you dont fire the script more than necicarry and the npc doesent turn into a maniquine) they should still wander around as per the norm so you shouldent have to set any custom paths for them. (unless you wanted them to walk to there doors then get tellaported in but the scripts are getting big by this point) As for going to the pub you could do a random100 at regular intavels after midday (diff variables for diff drinkers) and have them have another random100 call as to when they leave (then check where they are leaving to the street or the home) and send them there :)

 

this should put you on the right track to doing this sought of scripting yourself :)

 

hope i have helped and i hope i have answerd the right question and dident miss read you :(

Link to comment
Share on other sites

Hello,

1.a- In game when you create a potion, it is given an id. that is a lot of numbers.(12 to 13 long )

is it possible to script, so a chest or container can detect the potions player makes in game.

eg. scarthrew and other ingred. make a cure potion using mortor. so when player puts it in chest to end quest script will fire next block of code, saying "you made right potion"

 

1b- is it a calculation using duration effect power or something...

 

2- what is the max length of an if/elseif statment. how many elseif's can you have before they don't activate..... I reach 20 to 25 sometimes is there a way around this..

Link to comment
Share on other sites

A: I am going to check on that but know it would be a major headache in the long run ...

 

B: No, I know that for sure

 

C: I believe sometimes scripts don't fire right when you get around 6 - 8 elseifs I simply break things up into states in that case

 

If Blah

 

elseif blah

 

elseif blah

 

elseif blah

 

elseif blah

 

elseif blah

 

else

Set state to 10

endif

 

 

If ( state == 10 )

 

If blah

 

elseif blah

 

 

endif

 

set state to 0

 

endif

 

something like that is one way around elseif blues

Link to comment
Share on other sites

A: You could try scripting the ingredients instead of the potions -- make some monstrosity of a conditional that, when the amount of that ingredient within the PC's inventory drops, checks if the item was dropped or eaten (the latter can be achieved through another big conditional checking if certain effects have just appeared out of thin air), and, if both conditionals hold false, assumes that the item was used in a potion. Keep a record of this and voila -- you'll know what potions the PC has made.

 

Of course, there is a problem with this method -- namely, if the PC ingests the ingredient but there is no effect (a common situation for alchemical greens), the ingredient will be registered as having been part of a potion. Since potions need multiple ingredients, you can safely dismiss those instances where a single reagent is removed from inventory without a second one following while the PC is still in MenuMode. However, if the PC ingests two or more ingredients, all while in MenuMode, a potion will be created where none existed. Also, if a combination of potion-making and effectless ingestion were to take place, the orphan ingredients and the ingredients put into a potion would be mixed into a single potion.

 

On top of that, if the PC makes multiple potions in battery -- without exiting MenuMode -- the ingredients involved in those operations would also be mixed together.

 

However, though this method has its obvious and exploitable flaws, they can be patched over with some "creative" storytelling. For instance, perhaps the PC won't immediately figure out that he's made the correct potion -- after a day of intensive potion-testing and a good night's sleep, he could suddenly figure it all out and bust out his mortar and pestle.

Link to comment
Share on other sites

ok, laugh if you want, but i suck at scripting really bad............

 

i am new to all this stuff and have read some tutorials on scripting, but nothing is working for me......

 

all i want is a simple script that would make 2 npcs spar with eachother....if its possible...

 

can you help me.....?

 

edit: ugh, yellow is the worst color you could have picked... use plain white like the rest of us.

-Peregrine

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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