[FIXED] Possible Bug?

Here we stuff all the bugs we've managed to squash/squish/squelch.
Locked
Blue Dragon
UOX3 Apprentice
Posts: 159
Joined: Mon Jan 09, 2012 1:43 am
Has thanked: 0
Been thanked: 0

Possible Bug?

Post by Blue Dragon »

Xuri, is there a bug in UOX3 on the part of the character become criminal? For example, I send attack on my NPC, and even though I am your owner, I am a criminal! I tried to fix it on my own script, but of my knowledge, everything is perfect. Yet I keep getting criminal if I attack my npc or send him to attack me...
 
function onCallback0( socket, myTarget )
{
    myPlayer = socket.currentChar;
    myNPC = socket.tempObj;

        if( !socket.GetWord( 1 ) && myTarget.isChar && myTarget.vulnerable && myTarget.serial != myNPC.serial )
        {
            myNPC.target = myTarget;
                myNPC.atWar = true;
                myNPC.attackFirst = ( myTarget.target != myNPC );
            myNPC.attacker = myTarget;

                if( myTarget.innocent == true && myTarget.owner != myPlayer )
                {
                myNPC.criminal == true;

                    if( myNPC.criminal == true )
                    {
                    myNPC.owner.criminal = true;
                    }
                }
                else
                {
                myNPC.criminal == false;
                }
        }
            else
        {
            myPlayer.SysMessage( "Alvo invalido." );
        }
}
xantier
UOX3 Novice
Posts: 58
Joined: Tue Dec 20, 2011 6:51 am
Has thanked: 0
Been thanked: 0

Post by xantier »

where exactly do you attach this script ?
Blue Dragon
UOX3 Apprentice
Posts: 159
Joined: Mon Jan 09, 2012 1:43 am
Has thanked: 0
Been thanked: 0

Post by Blue Dragon »

Well, this is not the whole script, it's just a small piece of it, but which corresponds a part to making my NPC attack a target.

This script has been attached to domesticated animals (horses, spiders, giant scorpions, bears...) and also summons / invocations that are controllable (daemon, air elemental, fire elemental...).

Basically, if I say "todos matem" (this in my language which is Portuguese - correspond to "kill all" or something in English), a target will appear, here I select the target, my NPC, if I am your owner, will obey me and will attack him...

I want to be able to tell my npc to attack me, but when I do, I'm a criminal and my NPC also...

Note: I'm not very good in English and use a translator to help =/
xantier
UOX3 Novice
Posts: 58
Joined: Tue Dec 20, 2011 6:51 am
Has thanked: 0
Been thanked: 0

Post by xantier »

"all kill" is a trigger word from speech.mul, i don't think you can override it, make sure that your target system works but i don't think it will.
Blue Dragon
UOX3 Apprentice
Posts: 159
Joined: Mon Jan 09, 2012 1:43 am
Has thanked: 0
Been thanked: 0

Post by Blue Dragon »

No, if I understood what you said, that's not the problem... My npcs matching command in Portuguese, and he attacks normally the selected target. The reported problem was that, even with this script snippet above, if the target is myself, the unfortunate animal turned a criminal and I also...

Except that I'm mistaken, my character turn criminal first, then the NPC in sequence, because I am his master, but if he's mine, and I told him to attack me, why the hell am I a criminal? o.o"
xantier
UOX3 Novice
Posts: 58
Joined: Tue Dec 20, 2011 6:51 am
Has thanked: 0
Been thanked: 0

Post by xantier »

myNPC.criminal == true;

myNPC.criminal == false;

are those correct notations ? double '='s. try

myNPC.criminal = true;
myNPC.criminal = false;
Blue Dragon
UOX3 Apprentice
Posts: 159
Joined: Mon Jan 09, 2012 1:43 am
Has thanked: 0
Been thanked: 0

Post by Blue Dragon »

LOL, as I was distracted ...

But fix it there, but still getting criminal...

My player becomes criminal when I say for my "animal" attack me, and I counter attack him in the defending reaction... For this, I think may be a bug (or not), because if the NPC or summom is mine (I'm owner of him), I should not be criminal if I attack or defend me of him, which is the case...
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

A fix for this will be included in my next CVS update (and thus in the next UOX3 version).
-= Ho Eyo He Hum =-
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Fixed on CVS.
-= Ho Eyo He Hum =-
Locked