[FilterScript] ZNPC: Zombified Non-Player Characters [v1.0] by Weponz
#1

ZNPC: Zombified Non-Player Characters by Weponz

Introduction:
Quote:

This script is the first release of my NPC based Zombie System with Advanced AI using RNPC. The script is realistic with Sound Detection AI System making zombies more attracted to noise like gunshots, sprinting players and less attracted to crouching players allowing players to move around zombies undetected. Enjoy!
Updated ZNPC Version (DEMO):



Note: This is not v1.0 but a more advanced version to show you their capability.

Features:
Quote:

1. Zombies will roam the map until they detect a victim, then they will attack.
2. Zombies will feast on killed victims and regain full health.
3. Zombies are more attracted to noise like gunshots and sprinting players. (AI)
4. Zombies are less attracted to crouching players, allowing players to move around zombies undetected. (AI)

Installation:
Quote:

1. Install RNPC(0.4.1) and MapAndreas(v1.0 beta) if required via the links below.
2. Open the Pastebin link below and paste it into pawno.
3. Edit desired definitions and make sure you add spawn locations for zombies, then compile. (IMPORTANT!)
4. Place the compiled filterscript into you "filterscript" folder.
5. Open you "server.cfg" and edit your "filterscripts" and "plugins" lines and add the filterscript/plugins names.
6. Open you "server.cfg" and change "maxnpc" to the MAX_ZOMBIES amount.

Note: You may need to modify the script to create NPC's every 100 ms(using a timer) instead of instantly under OnGameModeInit to prevent your host from thinking it is getting attacked. (Paid Hosting Only)

pawn Code:
//Example Timer
public LoadZombies()//Modify to suit your server
{
    RNPC_SetUpdateRate(80);

    MapAndreas_Init(MAP_ANDREAS_MODE_NOBUFFER);

    new name[24];
    format(name, sizeof(name), "zname_%i", zombie_count + 1);
    ConnectRNPC(name);

    zombie_count++;

    if(zombie_count == MAX_ZOMBIES)
    {
        KillTimer(ZombieTimer);//Kill LoadZombies under OnGameModeInit
    }
    return 1;
}
Download:
Quote:

1. RNPC(0.4.1): http://www.forum.sa-mp.com/showthread.php?t=355849 (Credits: Mauzen)
2. MapAndreas(v1.0 beta): http://www.forum.sa-mp.com/showthread.php?t=120013 (Credits: Kalcor)
3. ZNPC(v1.0): http://www.pastebin.com/W0Laphjx (Credits: Weponz)
Reply
#2

Aynone vid or SS? looks interesting
Reply
#3

Sorry no videos or screenshots at the moment, anyone is free to create a video or take screenshots for me to add into the thread.
Reply
#4

I will be waiting for a video or screenshots. Looks good tho! Good job mate.
Reply
#5

Thanks, enjoy!
Reply
#6

thats so cool
Reply
#7

This seems nice, but I have a suggestion for you.

pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
        if(!IsPlayerNPC(playerid))
        {
            if(newkeys & KEY_FIRE)
                {
                        if(GetPlayerWeapon(playerid) >= 22 && GetPlayerWeapon(playerid) <= 38)
                        {
                                GetVictimDetectRange[playerid] = (ZOMBIE_DETECT * 4);
                                if(GetVictimTimerStatus[playerid] == 1) { KillTimer(GetVictimResetTimer[playerid]); }
                                GetVictimTimerStatus[playerid] = 1;
                                GetVictimResetTimer[playerid] = SetTimerEx("ResetDetectRange", 5000, false, "i", playerid);
                        }
                }
                else if(newkeys & KEY_SPRINT && GetVictimTimerStatus[playerid] == 0)
                {
                    GetVictimDetectRange[playerid] = (ZOMBIE_DETECT * 2);
                        GetVictimTimerStatus[playerid] = 1;
                        GetVictimResetTimer[playerid] = SetTimerEx("ResetDetectRange", 5000, false, "i", playerid);
                }
        }
        return 1;
}
With this code, it will set all of the zombies' detect range higher when they are sprinting, no matter where they are on the map. You just adjust it to where it detects if they are in range of a zombie, and set that certain zombies detect range higher.

Because, say you are in Los Santos, and I am in San Fierro, and we are both near zombies, and you start sprinting, the zombies near me will also have higher detection ranges because you are sprinting.
Reply
#8

looks intresting
Reply
#9

Good job, but I will wait the video or pictures to download it...
Reply
#10

@VitalBulleT

Thanks.

@zDivine

I don't get what you mean, it sets the players detect range NOT the zombies.

@JeaSon

Enjoy!

@Dreyfuz

I do not have time to make a video or take screens. This is up to a satisfied downloader to do and supply for addition to the thread.
Reply
#11

I've changed the spawn coordinates for the zombies but they just TP underground and roam from there. Any reason why?

EDIT: I see them spawn where I set them then after a few seconds it TPs underground.
Reply
#12

Код:
C:\Users\faiz\Desktop\NEW3\pawno\include\rnpc.inc(539) : error 025: function heading differs from prototype
C:\Users\faiz\Desktop\Zom.pwn(41) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(59) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(62) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(111) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(133) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(147) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(163) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(164) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(180) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(181) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(184) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(204) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(237) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#13

Quote:
Originally Posted by OBSERVADOR
Посмотреть сообщение
Код:
C:\Users\faiz\Desktop\NEW3\pawno\include\rnpc.inc(539) : error 025: function heading differs from prototype
C:\Users\faiz\Desktop\Zom.pwn(41) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(59) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(62) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(111) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(133) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(147) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(163) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(164) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(180) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(181) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(184) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(204) : warning 217: loose indentation
C:\Users\faiz\Desktop\Zom.pwn(237) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Add #pragma tabsize 0 add the top
Reply
#14

Looks interesting,i'll test it and take screenshoots.
Reply
#15

Sorry for double posting,here's some screenshoots

http://postimg.org/image/iagyxkl0j/
http://postimg.org/image/5lbk5kcql/
http://postimg.org/image/5u49kl2e1/
http://postimg.org/image/c7hyij27z/

Its fun,but some zombies are stuck inside of building lol
Reply
#16

Quote:
Originally Posted by Bradley7
Посмотреть сообщение
Sorry for double posting,here's some screenshoots

http://postimg.org/image/iagyxkl0j/
http://postimg.org/image/5lbk5kcql/
http://postimg.org/image/5u49kl2e1/
http://postimg.org/image/c7hyij27z/

Its fun,but some zombies are stuck inside of building lol
When you kill the zombies you get money or something? What other bugs you faced?
Reply
#17

Quote:
Originally Posted by SecretBoss
Посмотреть сообщение
When you kill the zombies you get money or something? What other bugs you faced?
No,i dont get any money
sometime zombies moving weird
Reply
#18

Quote:
Originally Posted by Bradley7
Посмотреть сообщение
No,i dont get any money
sometime zombies moving weird
btw I am trying to start the server and it closes why? (I didn't change spawn location of zombies)
Reply
#19

check your server_log.txt
Reply
#20

Screenshots have been added to the thread. Credits: Bradley7

EDIT:

Quote:
Originally Posted by JustinAn
Посмотреть сообщение
I've changed the spawn coordinates for the zombies but they just TP underground and roam from there. Any reason why?

EDIT: I see them spawn where I set them then after a few seconds it TPs underground.
Are you sure your MapAndreas plugin is installed and working properly?

Quote:
Originally Posted by SecretBoss
Посмотреть сообщение
When you kill the zombies you get money or something? What other bugs you faced?
The script was designed to be customized but already has basic AI. And there are no known bugs at the moment.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)