No animate in combat if visual_state set by LUA

Old bugs stored here for reference.
Locked
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

No animate in combat if visual_state set by LUA

Post by John Adams » Sun Jul 12, 2009 1:39 pm

When you use LUA to set a visual_state of an NPC, then attack that NPC, the NPC does not come out of the visual state to show the fighting animations, just stands there with the set visual state.

Example script: a Tunarian scout - when you approach, this scout "crouches" til you go out of range.

Code: Select all

--[[
	Script Name	: SpawnScripts/OutpostOverlord/aTunarianscout1.lua
	Script Purpose	: When player enters 20m proximity, scout Crouches
	Script Author	: John Adams
	Script Date	: 2009.01.08
	Script Notes	: JA: may need to adjust range
--]]

function spawn(NPC)
	SetPlayerProximityFunction(NPC, 30, "InRange", "LeaveRange")
end

function respawn(NPC)
	spawn(NPC)
end

function InRange(NPC, Player)
	FaceTarget(NPC, Player)
	DuckSpawn = GetSpawn(NPC, 2780067)		-- Get Tunarian Scout
	SpawnSet(DuckSpawn, "visual_state", "221")	-- Start crouch_idle
end

function LeaveRange(NPC, Player)
	DuckSpawn = GetSpawn(NPC, 2780067)		-- Get Tunarian Scout
	SpawnSet(DuckSpawn, "visual_state", "0")	-- Stop crouch_idle
end

Btw, we know that GetSpawn() should be done differently - these are old scripts that need to be re-addressed before release. Change the spawn ID to your spawn ID for testing, or fix the script.

User avatar
ZexisStryfe
Posts: 1026
Joined: Thu Jul 26, 2007 6:39 am
EQ2Emu Server: Sytherian Legends
Location: Connecticut
Contact:

Re: No animate in combat if visual_state set by LUA

Post by ZexisStryfe » Sun Jul 12, 2009 4:14 pm

You know its funny but I was playing around with visual states the other day and noticed this problem. However I think the issue is broader than LUA scripts. I was playing with one of the new Roper models (model 10833) a few days ago and set the visual state to "sit_idle" (id 540). This causes the roper to pretend to be a tree. However if I then attacked the roper, it autofaced properly, but didn't animate. The only way I could get him to work properly was to set mood_state to 540. With this set he pretended to be a tree and then would animate when attacked.
~ EQ2 Emulator Project Manager

Image
Image
Image
"Zexis, from this day forth, you shall be known as... '3 of 6'" - John Adams

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: No animate in combat if visual_state set by LUA

Post by LethalEncounter » Mon Jul 13, 2009 2:58 pm

A while back I found a packet that it used to temporarily change visual state information instead of the way we are doing it now. I'll get it added soon and it should fix these problems.

Locked

Who is online

Users browsing this forum: No registered users and 0 guests