This is about as clear as mud to me. I understand why there is LuaSpell compared to Spell, I get that part. They are two completely different things, but related. So if I create a LuaSpell object in C++, how can I get the object from it's Spell counterpart, make sense?
I do not think I can do a direct cast, I think I have tried.
LuaSpell from Spell
Moderator: Team Members
Forum rules
READ THE FORUM STICKY THREADS BEFORE ASKING FOR HELP!
Most information can be found there, and if not, the posts will help you determine the information required to get assistance from the development team.
Incomplete Help Requests will be locked or deleted.
READ THE FORUM STICKY THREADS BEFORE ASKING FOR HELP!
Most information can be found there, and if not, the posts will help you determine the information required to get assistance from the development team.
Incomplete Help Requests will be locked or deleted.
- Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
LuaSpell from Spell
Resident Dirty Hippy
-
Jabantiz
- Lead Developer
- Posts: 2912
- Joined: Wed Jul 25, 2007 2:52 pm
- Location: California
Re: LuaSpell from Spell
LuaSpell contains a pointer to Spell simply called spell
EDIT: And I got that backwards, you want LuaSpell from a Spell, not sure that is possible will need to check.
EDIT2: Ok it looks like this is the best way to get the LuaSpell* from a spell
However this returns a copy of the LuaSpell and not the original and needs to be deleted when finished, if you just need info from the LuaSpell it will work find, if you need to modify the LuaSpell this will not work.
Code: Select all
LuaSpell* spell;
spell->spell->(What ever you need from Spell*)
EDIT2: Ok it looks like this is the best way to get the LuaSpell* from a spell
Code: Select all
string lua_script = spell->GetSpellData()->lua_script;
lua_script.append(".lua");
lua_spell = 0;
if(lua_interface)
lua_spell = lua_interface->GetSpell(lua_script.c_str());
- Gangrenous
- Posts: 812
- Joined: Sun Apr 24, 2016 6:54 am
- Characters: Dinsmoor
Re: LuaSpell from Spell
I started writing my own routines a few hours after, I have it working. I just need to clean up the code some but it is working.
Resident Dirty Hippy
Who is online
Users browsing this forum: No registered users and 0 guests