Jump to content

WIPz Stealth Wars


lonewolfkai

Recommended Posts

Bethsoft Offical WIP thread

 

After reading through Reneer's Sneak Mod I got to remincising about my days with Dark Ages of Camelot and the stealth wars that would occur there with stealthy toons. Reneer's mod adds an element of surprise by making NPCs have a sort of invisibility to them if your sneak skill was below theirs. Anyways, in DAoC while an assassin was on the prowl hunting or setting up an attack on an unsuspecting player, there was always the chance that another stealther was nearby, possibly hunting you, or after seeing you attack someone while they were waiting, ambush the ambusher (so to speak).

 

To get to the point, I started wondering about NPCs that sneaked on the player. Did that ever happen in vanilla or was there a mod like that out there already? I don't recall and don't think there is. So I had an idea of making a mod that places a random chance encounter of an NPC assassin that is sneaking and hunting the player, who is completely unaware of it. Perhaps a trigger to the event is when the player is sneaking him/herself. And to further add to it, place a few in select randomizing locations where they stay in sneak mode and wait for the player to come by, such as in the bandit dungeons or the like. Obviously Reneer's sneak mod would have to be necessary in order for the idea to be pulled off.

 

I'd like to do this mod, but this would be my first NPC type mod and would need a lot of help, both advice, and idealy have a hand in it, especially with the scripting since I'm sure there will have to be a number of them and I'm a super novice to scripts. And to be honest, I'm not sure this could even be done. What do you all think?

Link to comment
Share on other sites

I have a few ideas on how to get this idea working. I'll be working on making the individual assassins atm, but I really need some input here on the scripting/inner workings of the mod's idea. If you know someone that is good with NPC AI and scripting towards them, could you PM me so that I can get in touch with them. I could really use some help here. I'm willing to do the work myself. I just need someone to point me in the right direction so I don't get lost.

 

Also, Is there any interest in this mod at all?

Link to comment
Share on other sites

I think I might have the basic script engine worked out. Right now, the biggest thing I'm going to need help on is making sure this code will actually work. What I am aiming to do is make a random chance of an assassin appear close to the PC when the PC starts to sneak. This script is supposed to mainly just get the NPC close to the PC so they can start hunting you, which will involve some sort of AI/scripting too. I thought I would put this script on a book that the PC needs to carry. Let me know what you think. here is the code:

 

 

ScriptName StealthWarBook

Begin OnControlDown 9
  Set A to Rand 1 100
      If A <= 20 Set B to Rand 1 5
           If B == 1 Assas1.MoveTo Player 100,100,0
           Assas1.enable
           If B == 2 Assas2.MoveTo Player -100,100,0
           Assas2.enable
           If B == 3 Assas3.MoveTo Player 100,-100,0
           Assas3.enable
           If B == 4 Assas4.MoveTo Player -100,-100,0
           Assas4.enable
           If B == 5 Assas5.MoveTo Player 150,-100,0
           Assas5.enable
          EndIf
     Else EndIf
   End
End

 

Is that even correct usage for OnControlDown (9 is the code for Sneaking btw)? I think I need a "doonce" command line in there somewhere, but I'm not really sure where or the correct syntax. Before the Rand command? As far as the rand command, do I have that correct? Also, do I need references stated before the script for the NPC id's? Currently I have the NPCs' Ids set as Assas1, Assas2, etc. I'm also not sure about the placement of the assassins once they are moved to the PC's location. I know that its stated in units like x,y,z, but I may have that all wrong too. I wanted that some what randomized as well when they are moved to the PC so it doesn't occur the same way everytime. I'd also like to have them placed to the point that the PC might have a chance to spot them out before the assassin strikes. Furthermore, the script is basically just randomizing which of 5 assassins will appear, and that will be changed later to more complixity. For example, I want to code in there that two or three may appear as well. But I'm not sure how to use the MoveTo command for multiple NPCs. Do I just put an & in there with the line, like for example: assas1.moveto player & assas2.moveto player?

 

Thanks wolfhound. Its from Okami just in case you didn't know. I normally use Lonewolf as a call sign, but it's usually taken. I'll give you a kudo if you can figure out what the Kai means. ;)

Link to comment
Share on other sites

I prefer to close off each and every If, then, else to make sure everything fires exactly how I plan rather than accidental indenting and forgetting and EndIf here and there.

 

I reformatted the structure and there seemed to be an extra "End" and an unnecessary "Else" / "EndIf"

 

Is this how you envisioned this code block to work? (It does nothing if A is greater than 20.

 

ScriptName StealthWarBook

Begin OnControlDown 9
 Set A to Rand 1 100
 If A <= 20
   Set B to Rand 1 5
   If B == 1
     Assas1.MoveTo Player 100,100,0
     Assas1.enable
   EndIf
   If B == 2
     Assas2.MoveTo Player -100,100,0
     Assas2.enable
   EndIf
   If B == 3
     Assas3.MoveTo Player 100,-100,0
     Assas3.enable
   EndIf
   If B == 4
     Assas4.MoveTo Player -100,-100,0
     Assas4.enable
   EndIf
   If B == 5
     Assas5.MoveTo Player 150,-100,0
     Assas5.enable
   EndIf
 EndIf
End

Link to comment
Share on other sites

I prefer to close off each and every If, then, else to make sure everything fires exactly how I plan rather than accidental indenting and forgetting and EndIf here and there.

 

I reformatted the structure and there seemed to be an extra "End" and an unnecessary "Else" / "EndIf"

 

Is this how you envisioned this code block to work? (It does nothing if A is greater than 20.

 

ScriptName StealthWarBook

Begin OnControlDown 9
 Set A to Rand 1 100
 If A <= 20
   Set B to Rand 1 5
   If B == 1
     Assas1.MoveTo Player 100,100,0
     Assas1.enable
   EndIf
   If B == 2
     Assas2.MoveTo Player -100,100,0
     Assas2.enable
   EndIf
   If B == 3
     Assas3.MoveTo Player 100,-100,0
     Assas3.enable
   EndIf
   If B == 4
     Assas4.MoveTo Player -100,-100,0
     Assas4.enable
   EndIf
   If B == 5
     Assas5.MoveTo Player 150,-100,0
     Assas5.enable
   EndIf
 EndIf
End

 

Yep, that's exactly it. I wanted it to be a 20% chance, so to speak, of the assassin's appearance to occur. (I may change the percentage if it's too great)

 

I'm seeing a lot of Ref NPCref codes on similar "hunter" or summoning mods that are placed before the beginon gamemode in a separate block. Is this something I need to do?

Link to comment
Share on other sites

I'm seeing a lot of Ref NPCref codes on similar "hunter" or summoning mods that are placed before the beginon gamemode in a separate block. Is this something I need to do?

Depends on how you use it. I typically use it to make my code more re-usable as well as reduce the amount of lines or make sections of script run without having to do the same If, then, else code blocks over again.

 

Example:

 

ScriptName StealthWarBook

ref MyNPC

Begin OnControlDown 9
 Set A to Rand 1 100
 If A <= 20
   Set B to Rand 1 5
   If B == 1
     Set MyNPC to Assas1
     MyNPC.MoveTo Player 100,100,0
   EndIf
   If B == 2
     Set MyNPC to Assas2
     MyNPC.MoveTo Player -100,100,0
   EndIf
   If B == 3
     Set MyNPC to Assas3
     MyNPC.MoveTo Player 100,-100,0
   EndIf
   If B == 4
     Set MyNPC to Assas4
     MyNPC.MoveTo Player -100,-100,0
   EndIf
   If B == 5
     Set MyNPC to Assas5
     MyNPC.MoveTo Player 150,-100,0
   EndIf
   MyNPC.enable
 EndIf
End

If you wanted to do anything else to the NPC, you could add it around the "MyNPC.enable" line and it would work for any of the NPCs...no need to have that command repeated multiple times over and over.

 

LHammonds

Link to comment
Share on other sites

OOOOHHH Sweet!! I didn't realize you could do that. I can see soooo many possibilities with this now. The light bulb above my head just got about 10x bigger!

 

What if I wanted to place two or three NPCs instead of just one? Could I use the ref to do that?

 

Example:

 

ref MyNPC

 

set MyNPC to Assas1 & Assas2

 

 

or would it need to read

 

set MyNPC to Assas1 + Assas2

Link to comment
Share on other sites

OOOOHHH Sweet!! I didn't realize you could do that. I can see soooo many possibilities with this now. The light bulb above my head just got about 10x bigger!

 

What if I wanted to place two or three NPCs instead of just one? Could I use the ref to do that?

 

Example:

 

ref MyNPC

 

set MyNPC to Assas1 & Assas2

 

 

or would it need to read

 

set MyNPC to Assas1 + Assas2

 

Anyone got some insight on this? I suspect I can, but unsure of the correct syntax. More importantly, how would that work with the resurrection command? If the resurrect command is pointed at a ref, would it resurrect both NPCs the ref is pointed to?

Link to comment
Share on other sites

Nope. You cannot do it like that.

 

You would need to have a reference variable for the total amount you want to manipulate at one time.

 

Example:

 

Set MyNPCa = Assas1

Set MyNPCb = Assas2

Set MyNPCc = Assas3

 

But again, it completely depends on how you use it. You can still get away with just one reference variable but you need to use it one at a time.

 

Set MyNPC = Assas1

MyNPC.MoveTo Player 100,100,0

MyNPC.enable

Set MyNPC = Assas2

MyNPC.MoveTo Player 100,100,0

MyNPC.enable

Set MyNPC = Assas3

MyNPC.MoveTo Player 100,100,0

MyNPC.enable

Link to comment
Share on other sites

  • Recently Browsing   0 members

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