Aller au contenu

Photo

Oppressive city guard behavior


  • Veuillez vous connecter pour répondre
8 réponses à ce sujet

#1
Friar

Friar
  • Members
  • 293 messages
I would like to have the city guards act as oppressive bullies who patrol the city and can kill the PC should they retaliate.

I come to the community for suggestions on scripting or ideas to make a more believably cruel city guard. I can write believable dialogue, but I mainly need help with scripting.

Here are some things I'm working on organized in correlation to the conversations:

I. PC talks to guard
    a) PC warned and PC is knocked down 1hp dmg  *
    B) PC warned
    c) PC has gold taken away by guards
    d) PC attacked

II. PC is seen performing picklock or pickpocket   *
    a) PC is questioned
          i) PC attacked
         ii) PC released
    B) PC attacked

III. PC is seen in the streets after dark / in violation of curfew    *
    a) PC is ordered to obey curfew.
    B) PC is questioned
          i) PC attacked
         ii) PC released
        iii) PC warned and PC is knocked down 1hp dmg    *
    c) PC attacked
    d) PC has gold taken away by guards
    e) PC ordered to obey curfew and PC is knocked down 1hp dmg    *


* - The parts I just simply cannot figure out how to make happen.

#2
Morbane

Morbane
  • Members
  • 1 883 messages
all that can be done with LocalInt/GlobalInts - switch between true and false for the int values - or numbers for complex situations.

The hard part isnt scripting these conditionals, that hard part is keeping your ints straight.


You can utilise/alter these gc_ scripts: skill/stat/class/is_day/night/ etc checks 

Modifié par Morbane, 27 septembre 2012 - 05:20 .


#3
Friar

Friar
  • Members
  • 293 messages
That's good to know that keeping ints straight are the only challenge.

So, Here is what I have for the warning, knockdown and 1hp of dmg.

void main()
{

object oPC = GetPCSpeaker();

object oTarget;
oTarget = oPC;

effect eEffect;
eEffect = EffectKnockdown();

ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 10.0f);

eEffect = EffectDamage(1, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL);

ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);

}


For some reason the warning sounds off in the game, but the script doesn't seem to be firing. The PC recieves niether the dmg nor does the PC get knocked down.

Also with failing the lock pick or pickpocket I don't necessarily want the guards to automatically show up because the PC fails the roll, instead I want nearby patrolling guards to roll for seeing the PC in the very act. Do you think that will be possible?

#4
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
You're using this in the action node of a conversation?
Note that with a one-liner conversation, the action scripts don't actually fire.

For your other situations, you can put a custom on-disturbed script on your NPCs to handle pick-pocketing fails (or just use the default script's hook with a variable). Your script would want to check for the nearest guard (by tag, for example), and then maybe do a spot check. For the night guard, you can either fiddle with the guard's on-perception script, or lay down triggers that check to see if a guard can see the player, or create a custom AOE for the guard that works the same as the trigger.

It's all doable, but it does require some more advanced scripting with some finicky parts of the game engine.

#5
Friar

Friar
  • Members
  • 293 messages
Yes, I am using this in an action node of a conversation.
Yes, you called it, I'm using it in a one-liner... on that note I will be making some changes.

I will try using the hooks as you suggest. I was going through your Dana'an Unvanquished mod in the toolkit and noticed you use them quite a bit.
Really love that mod too by the way.
I will be using the concept you created with the environment adding bonuses and penalties in this mod.
Too bad I'm going on almost four years of development and I already have the main story and the sequels planned out on paper but no product.

#6
kamal_

kamal_
  • Members
  • 5 260 messages
PRR 3 http://nwvault.ign.c...&comment_page=2

You can have npc's call the guard automatically on pickpocket fail, including spawning one if desired. NPC's can also "own" objects, like doors.

It essentially covers part 2: "PC is seen performing picklock or pickpocket "

Also, you want your guards to go to a custom faction that is only hostile to pc when they attack (and back to normal when done), or they'll start whacking commoners.

What you're asking to do is doable, just takes some work.

#7
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
Feel free to steal some scripts, you can just export the terrain triggers into an erf, import, and modify as needed.

#8
Friar

Friar
  • Members
  • 293 messages
@Kamal
The PRR 3 seems to have what I'm looking for although it will take me some time to digest.

@J.E. McKeller
Thanks for your support, but Ihope to credit you somehow if I can one day learn this all and effectively communicate my story on this medium.

Finally,
I'm also wondering which script I can use for the nodes to make the statements and outcomes of my guard conversations more random. For instance:

I. PC talks to guard
a) PC warned and PC is knocked down 1hp dmg (25% chance of happening)
B) PC warned (40% chance of happening)
c) PC has gold taken away by guards (25% chance of happening)
d) PC attacked (10% chance of happening)

Maybe a script that works like a four sided dice or a wheel with four outcomes.. make sense?

Modifié par koundog1, 30 septembre 2012 - 05:37 .


#9
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
The standard way is to use the standard random 1-out-of-N gc scripts, but those only really work if you want every option to have an equal possibility of occurring. Basically you go 1/4, 1/3, 1/2 until you get to the last, default option.

Another, more precise way would be to have a ga script set a random local int on the PC line, and then have each NPC line use a gc script to check that local int. So say the random int is iRandom;
a: if iRandom >= 75;
b: if iRandom >= 35;
c: if iRandom >= 10;
d: default.

A third option would be just to do it all with skill checks (I'm inverting your a and b be cause a seems worse than B):

b: Intimidation success
a: Bluff success
c: Diplomacy success
d. default - all saves failed.

You can fiddle with the DC's to get roughly the right percentages you want.