Jump to content

Scripting resource... more advanced than the wiki?


Reverend Jasen

Recommended Posts

I'm pretty confident I have down the syntax and general scripting behavior of the game (the Bethesda devs obviously have a love affair with Perl :) ), but many small details are missing for me. Things like a list of all available variable types, function return types, etc. The wiki is a pretty good generic resource, but it lacks information like this. Is there anything else out there?

For instance, a "short". What's the range? 0 to 256, 0 to 32,000, -32,000 to 32, 000, or -2,000,000 to 2,000,000? In VB I'd call it an integer and assume -32k to 32k. But in C++ or Perl it would be different. Basically, I'd love to find an MSDN-esqe site for this. :) Asking too much?

 

I also have another scripting behavior question.

Here is my goal at the moment: I want to have an NPC to have a script that it can pass on to other NPC's or players. Much like Vampirism, but not a disease, an object script. It will completely change the NPC's behavior, faction, etc when they catch it.

 

My current method is to treat it like a spell. The first NPC casts the spell on the second, which immediately adds this spell to the second NPC's spell list (thus allowing him to cast it on others), and then the spell just runs for an extended period of time, altering the NPC behavior. Every time this NPC contacts another (OnActorTrigger) it passes the script on. Like a plague. ;)

What I'd like to do is remove and replace the NPC's associated object script permanently, not just add and run a spell. Is this possible?

Link to comment
Share on other sites

The return values aren't mapped anywhere -- maybe BethSoft has the document lying somewhere, but it isn't public ;)

 

Shorts are integers. Longs are -- well -- long integers :)

The game engine stores all of the numbers as floats, anyway.

 

I think the shorts's max are 32k. Haven't tested the min. I wasn't able to find the "long" max. 4.000.000 didn't work (neither did 20.000.000).

 

It isn't possible to *remove* an object script from the actor. And it would totally screw up quests.

The contact-spell-thing IS possible. One of the funniest things I've ever done in Oblivion was making an area-effect spell that launched when an NPC got near the holder. It then made the NPC immune to it.

The script was something like:

scn bob
ref self
begin scripteffectstart
if isspelltarget gimmunity == 0
set self to getself
modav energy 150
; Here I had something for making them paranoid, but I can't remember it.
endif
end

begin scripteffectfinish
if isspelltarget gimmunity == 0
cast gimmunity self
cast gmagic self
endif
end

I have it on a USB-key somewhere, but can't find it atm :(

Link to comment
Share on other sites

I figured as much. I knew a short was an int, but depending on the language, int's have a wide range of min/max values. Guess I'll have to just test it out. Wish there was some debugging and code step-through possible.

 

 

As for messing up quests, that's really the point of my current script. It's less a serious mod, more of a silly one.

I'm recreating "28 Days Later". One guy walks into town with a disease. Anyone he touches catches the disease. A few hours after catching it, they die, then get resurrected. At this point stage2 of the spell is cast, which changes the NPC's faction to "undead", sets aggressiveness at max, intelligence to zero, removes any weapons, and sends them on a hunt to attack anyone or anything they can find. I'm trying to get them to wander aimlessly through the streets, from area to area as well, to spread the disease as far as possible. The culmination of the script will see every NPC in town (and if I can manage it, every town) a raging lunatic that kills all normal humans. Right now the spell is on a long timer, so after a couple days things will go back to normal. I was thinking about creating a quest for the player to seek out an anti-virus, which you would then have to cast on yourself and go spread to the masses to cure them.

I've got half of this working already. I guess keeping it as spells will be the best way.

 

Thanks!

Link to comment
Share on other sites

It's on the Wish List.

http://cs.elderscrolls.com/constwiki/index...ions_We_Lost.21

 

I'd suggest you keep an eye on that, and maybe ask in the official fora, as well.

 

EDIT (Reply to above post): I'd suggest using a conversation result script. You could probably give the NPC membership in a "Diseased" faction, and have a few topics specifically for that faction.

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...