This function returns the string value of a spawn's archetype. Example, if this function is used for a spawn with the adventure class "Defiler", GetArchetypeName() will return the string value "Priest".
Syntax: GetArchetypeName(Spawn) where Spawn is a spawn pointer.
Wiki: GetArchetypeName()
New Lua Function: GetArchetypeName
Moderator: Team Members
- thefoof
- Retired
- Posts: 630
- Joined: Wed Nov 07, 2012 7:36 pm
- Location: Florida
New Lua Function: GetArchetypeName
Last edited by John Adams on Sat Aug 03, 2013 10:32 am, edited 1 time in total.
Reason: added link to wiki article
Reason: added link to wiki article
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: New Lua Function: GetArchetypeName
Cool. Are these being added to the Wiki too (al la Jabantiz style)? I don't want that to get any more outdated than it already is... when adding functionality.
Thanks.
Thanks.
- thefoof
- Retired
- Posts: 630
- Joined: Wed Nov 07, 2012 7:36 pm
- Location: Florida
Re: New Lua Function: GetArchetypeName
Yeah it's up there now.
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: New Lua Function: GetArchetypeName
Great job on this lua function, even added the error logs that I usually forget and have to go back and add in later. Just 2 minor issues that are more for error catching.
First is the lua_interface pointer needs to be checked first thing.
This will just prevent a server crash in the rare event that it is null.
The second is there is there is a slight chance adv_class could equal 0 skipping the if and resulting in no return value, as the function needs an int return value you just need to add
at the end. This would only be an issue on custom servers that have use the commoner class, also it will produce a warning when you compile
First is the lua_interface pointer needs to be checked first thing.
Code: Select all
if (!lua_interface)
return 0;The second is there is there is a slight chance adv_class could equal 0 skipping the if and resulting in no return value, as the function needs an int return value you just need to add
Code: Select all
return 0;Still great job on this function.warning C4715: 'EQ2Emu_lua_GetArchetypeName' : not all control paths return a value
- thefoof
- Retired
- Posts: 630
- Joined: Wed Nov 07, 2012 7:36 pm
- Location: Florida
Re: New Lua Function: GetArchetypeName
Okay thanks for looking it over jab
, only reason I knew to set the error log was because the function right above it had one
monkey see monkey do. I'll make that change now.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: New Lua Function: GetArchetypeName
Woot. Excellent work. I feel some good C++ stuff coming our way 
Who is online
Users browsing this forum: No registered users and 0 guests