• SNPC's broken
    7 replies, posted
My custom NPC spams this error to console: [code] [ERROR] lua/includes/modules/ai_task.lua:117: bad argument #1 to 'RunEngineTask' (number expected, got nil) 1. RunEngineTask - [C]:-1 2. Run - lua/includes/modules/ai_task.lua:117 3. RunTask - gamemodes/base/entities/entities/base_ai/schedules.lua:148 4. DoSchedule - gamemodes/base/entities/entities/base_ai/schedules.lua:71 5. unknown - gamemodes/base/entities/entities/base_ai/schedules.lua:22 [/code] How to fix it?
[QUOTE=rute;41509095]My custom NPC spams this error to console: [code] [ERROR] lua/includes/modules/ai_task.lua:117: bad argument #1 to 'RunEngineTask' (number expected, got nil) 1. RunEngineTask - [C]:-1 2. Run - lua/includes/modules/ai_task.lua:117 3. RunTask - gamemodes/base/entities/entities/base_ai/schedules.lua:148 4. DoSchedule - gamemodes/base/entities/entities/base_ai/schedules.lua:71 5. unknown - gamemodes/base/entities/entities/base_ai/schedules.lua:22 [/code] How to fix it?[/QUOTE] Code?
[lua] local schdShoot = ai_schedule.New( "Shoot Enemy" ) schdShoot:EngTask( "TASK_WAIT_FACE_ENEMY", 0.1 ) schdShoot:EngTask( "TASK_ANNOUNCE_ATTACK", 0 ) schdShoot:EngTask( "TASK_RANGE_ATTACK1", 0 ) [/lua] and error comes from: [lua] self:StartSchedule( schdShoot ) [/lua]
SNPCs are broken. Deal with it. Use NextBot NPCs.
NextBot NPCs are broken as well: - Can't fire weapons. - Can't move in any other map than gm_construct. - Other NPCs can't attack them. AddRelationShip gives an error.
[QUOTE=rute;41517247]NextBot NPCs are broken as well: - Can't fire weapons. - Can't move in any other map than gm_construct. - Other NPCs can't attack them. AddRelationShip gives an error.[/QUOTE] 1) Must implement yourself. ( For now I believe ) I don't remember SNPCs able to use the weapons as well, although I might be wrong. 2) [URL="http://wiki.garrysmod.com/page/Locomotion/Approach"]False.[/URL] 3) Might be true.
[QUOTE=Robotboy655;41518783]1) Must implement yourself. ( For now I believe ) I don't remember SNPCs able to use the weapons as well, although I might be wrong.[/QUOTE] My SNPC did use weapon, but because of StartSchedule error, it no longer can. How to make NextBot fire weapons? Tried: [lua] self.Weapon = ents.Create("weapon_smg1") self.Weapon:PrimaryFire() [/lua] output: [code] attempt to call method 'PrimaryFire' (a nil value) [/code]
[QUOTE=rute;41519831]My SNPC did use weapon, but because of StartSchedule error, it no longer can. How to make NextBot fire weapons? Tried: [lua] self.Weapon = ents.Create("weapon_smg1") self.Weapon:PrimaryFire() [/lua] output: [code] attempt to call method 'PrimaryFire' (a nil value) [/code][/QUOTE] That's because weapon_smg1 is not a Lua weapon. There are not way to force it to fire. Try using a SWEP or something. Also remember that you need to bonemerge the weapon to NextBox so it actually appears in its hand.
Sorry, you need to Log In to post a reply to this thread.