Two questions for an extremely new modder.

First off, please be patient with me. I am a newb and I openly admit it. lol.

I enjoy making scenarios to complete outside of servers and so I use NPCs alot. Currently I am building a scenario that incorporates saving a hostage. Which leads me to my first question.

Is it possible for a combine (Or zombie… etc) NPC to ignore one citizen but that citizen acknowledge you? I attempted to create a ragdoll that has health and “dies” after it gets shot so many times but the mods I used impacted all ragdolls, props, and NPCs so I didn’t care for that much as it changed the way they died and how much health they had.

My next question is a little easier probably… Is it possible to change default weapons? I tried googling it but I didn’t come up with any real help. Also, if you change them for the player does it also change the combine’s weapon as well? I base all my “enemies” off of the combine and of course they can’t shoot any weapon other than the default it seems (at least that’s what I have learned…).

Anyway, thanks! I’ve been playing on Garry’s Mod for quite a while and I figure it is about time to start learning to mod and edit the back end of the game instead of just the front end. :stuck_out_tongue:

Thank you for your help and time!


(User was banned for this post ("Missed the Questions subforum (look at the bottom of the page)" - mahalis))

For anything pertaining to NPC behaviour, look through this list and you may find what you’re looking for:

As for the changing of default weapons, you have two choices:
Using the http://wiki.garrysmod.com/?title=Gamemode.PlayerLoadout hook, write an addon that has a function HOOKED to that hook (Overriding wont work if its not in the gamemode) that strips the players weapons (To get rid of default weapons), then use player:Give() to give the player what weapons you want.

If you’re writing your own gamemode, you can just use the same hook, but overwrite the function in one of your serverside gamemode files, like this:

[lua]
function GM:PlayerLoadout(pl)
pl:Give(“weapon_crowbar”)
end
[/lua]

Wow you replied quickly! thank you! I will try this when I get home. I’m at my work computer currently. It sounds like it will do exactly what I am wanting!

When you give the player a weapon, does it come with a set amount of ammo? for instance, the Mad Cow weapons only come with a default number of bullets before I have to spawn the ammo box entity to refill it. If I was to make that weapon with a limited amount of ammo the default, would it still have that same amount of ammo or will I need to change that?

I think it depends on the SWEP, there is a thing in shared.lua
SWEP.Primary.DefaultClip = (whatever extra ammo comes with the gun)
But, I think you can make one of the loadout items item_ammo_pistol, (might not be the real name of pistol ammo, just guessing).

[editline]15th February 2011[/editline]

or item_ammo_smg1.

[editline]15th February 2011[/editline]

or whatever other ammo.