Jump to content

A way to prevent companions from taking off?


lonewolfkai

Recommended Posts

Maigrets, the scripting language, especially supplemented with OBSE and its plugins, is a full, general purpose programming language that, to my knowledge, demonstrates Turing completeness. Except for the fact that it has only very primitive graphic output support you could, conceivably, write a full-featured word processor program with it. In other words, if it can be programmed, you should be able to do it with Oblivion scripting, with the exception, perhaps, of various object-oriented features which are supported by high-end compilers, but even those could probably be implemented in a round-about way.

 

It should be possible, then, to write a sophisticated AI for companions. The only real limitations are the size of individual scripts and the fact (at least I think it's a fact) that you pretty much have to control NPCs and creatures through quest-driven scripts -- at least I don't know how to do it using ONLY scripts with no quest attached. I'm still struggling with trying to figure out how to give all NPCs in the game a new dialog topic, so I'm at a very early stage in learning that part of the CS, but I'm finding it a very clunky way to control actors.

 

Well the most common method of controlling AI via script is to create a series of scripted AI packages and then call AddScriptPackage since it overrides any existing running AI. You can write some very detailed scripted AI functionality into a scripted AI package and having the freedom to simply add the package with one script command makes the process simpler. The hard part isn't the functionality, it's creating an intelligent set of AI scripts that run as intended and, most importantly, when you intend them to run. You would end up having to create an intricate state machine involving most likely a lot of registered event handlers that track the NPC's current state. The other issue is how laggy that AI becomes since it will likely have a lot of constantly running scripts doing state detection for events that can't be handled by the event handler system. Open up Vilja's esp and peruse the scripting some time, you'll see what I mean... and even she can misbehave on occasion and she has 43 scripts and around 86 AI packages controlling her behavior and a very intricate state machine.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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