• SNPC pathfinding manipulation
    0 replies, posted
I'm in the process of making a basic citizen NPC that will have basics of social law and interaction down. However, the main issue I've been running into is how to manipulate the A* pathfinding algorithm that the base_ai entity uses. Essentially, this will be used to force the NPCs to avoid generating a path in the streets and instead stick the to the sidewalks and elsewhere. I really wanted to avoid using nextbot because the basic NPC relationships (e.g. Combine, Paracidics, Rebels, Custom NPC Groups, ...) are not embedded and might make future NPC encounters ignored. Current Code: [code] function ENT:Assimilated (vecLocation, bUrgency) local iShed = bUrgency and SCHED_FORCED_GO_RUN or SCHED_FORCED_GO self:SetLastPosition (vecLocation) self:SetSchedule (iShed) self.schedule = { engine = iShed, start = CurTime (), properties = { m_vecPos = vecLocation, m_bUrgency = bUrgency } } end [/code] Essentially I'm only relying on [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="https://wiki.garrysmod.com/page/Enums/SCHED"]enum:SCHED_FORCED_GO[/URL]
Sorry, you need to Log In to post a reply to this thread.