oh nice I didn't know that was even a thing haha. I'll have to look around and see if I can find anything using it so i can get a better idea of how it works thank you ^.^kjLotus wrote:npc:timer
ACP and ASA
- DanteMccloud
- Posts: 25
- Joined: Wed May 04, 2016 10:53 pm
Re: ACP and ASA
Expedition Gaming
IP Address: expeditiongaming.ddns.net
Server Forums: https://expeditiongaming.ga/forum/index.php
Discord: https://discord.gg/5kJbxCF
Facebook is https://www.facebook.com/groups/1749730585295430
I host an array of game servers from FFXI (pre Abyssea), Tera, Arma3, FFXIV, SWG (pre-CU), BDO (v491)
IP Address: expeditiongaming.ddns.net
Server Forums: https://expeditiongaming.ga/forum/index.php
Discord: https://discord.gg/5kJbxCF
Facebook is https://www.facebook.com/groups/1749730585295430
I host an array of game servers from FFXI (pre Abyssea), Tera, Arma3, FFXIV, SWG (pre-CU), BDO (v491)
Re: ACP and ASA
i don't think anything is using it.. but it just takes time (in ms) as the first param and the function (probably a closure) as the second param
- DanteMccloud
- Posts: 25
- Joined: Wed May 04, 2016 10:53 pm
Re: ACP and ASA
haha I think I'm using it majorly wrong or something as every variation I've tried just crashes the server I'll keep playing with it though.kjLotus wrote:i don't think anything is using it.. but it just takes time (in ms) as the first param and the function (probably a closure) as the second param
I was hoping to find something using it as then I could pick it apart and learn how that works and such,
Code: Select all
local MandyTest = SpawnMob(-----)
npc:timer(10000,MandyTest); --This would spawn that monster in 10seconds?
so sorry for bugging you with these questions kjLotus, ty for all the help so far though I can't wait to have it working and share ^.^ having a delay/wait function like this will open SO many doors for projects I've been working on in the server. All tiny things but things none the less haha.
Does DSP support LUA 5.2 ? Or any of the windower lua handles?
Last edited by DanteMccloud on Thu Jun 02, 2016 2:09 pm, edited 1 time in total.
Expedition Gaming
IP Address: expeditiongaming.ddns.net
Server Forums: https://expeditiongaming.ga/forum/index.php
Discord: https://discord.gg/5kJbxCF
Facebook is https://www.facebook.com/groups/1749730585295430
I host an array of game servers from FFXI (pre Abyssea), Tera, Arma3, FFXIV, SWG (pre-CU), BDO (v491)
IP Address: expeditiongaming.ddns.net
Server Forums: https://expeditiongaming.ga/forum/index.php
Discord: https://discord.gg/5kJbxCF
Facebook is https://www.facebook.com/groups/1749730585295430
I host an array of game servers from FFXI (pre Abyssea), Tera, Arma3, FFXIV, SWG (pre-CU), BDO (v491)
Re: ACP and ASA
Code: Select all
local trader = player
npc:timer(1000, function(npc)
SpawnMob(whatever):updateClaim(trader)
end )
- DanteMccloud
- Posts: 25
- Joined: Wed May 04, 2016 10:53 pm
Re: ACP and ASA
Thanks Mate!! you are a life saver that seems to be working well, now to just fine tune what i have to work right 100% of the time ^.^kjLotus wrote:Code: Select all
local trader = player npc:timer(1000, function(npc) SpawnMob(whatever):updateClaim(trader) end )
fun note this function HATES :updateClaim() it dies and crashes the server something about line 6081 in Lua_baseentity.cpp way beyond me on why but thought I'd let you know in case you happened to see or know why haha.
"Unhandled exception at 0x01021D4C in DSGame-server.exe: 0xC0000005: Access violation reading location 0xCCCCCCD8."
Code: Select all
/************************************************************************
* *
* updates enmity and claims monster *
* *
************************************************************************/
inline int32 CLuaBaseEntity::updateClaim(lua_State *L)
{
DSP_DEBUG_BREAK_IF(m_PBaseEntity == NULL);
DSP_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_MOB);
//DSP_DEBUG_BREAK_IF(lua_gettop(L) > 1);
DSP_DEBUG_BREAK_IF(lua_isnil(L, 1) || !lua_isuserdata(L, 1));
CLuaBaseEntity* PEntity = Lunar<CLuaBaseEntity>::check(L, 1);
if (PEntity != NULL && /*-----------------BREAKS HERE when running debug-----------------*/
PEntity->GetBaseEntity()->objtype != TYPE_NPC)
{
battleutils::ClaimMob((CMobEntity*)m_PBaseEntity, (CBattleEntity*)PEntity->GetBaseEntity());
}
return 0;
}
Expedition Gaming
IP Address: expeditiongaming.ddns.net
Server Forums: https://expeditiongaming.ga/forum/index.php
Discord: https://discord.gg/5kJbxCF
Facebook is https://www.facebook.com/groups/1749730585295430
I host an array of game servers from FFXI (pre Abyssea), Tera, Arma3, FFXIV, SWG (pre-CU), BDO (v491)
IP Address: expeditiongaming.ddns.net
Server Forums: https://expeditiongaming.ga/forum/index.php
Discord: https://discord.gg/5kJbxCF
Facebook is https://www.facebook.com/groups/1749730585295430
I host an array of game servers from FFXI (pre Abyssea), Tera, Arma3, FFXIV, SWG (pre-CU), BDO (v491)
Re: ACP and ASA
oh yeah, i was hoping the assignment to a local would get around that but I guess not (you can't use a parameter passed into the on(whatever) functions in a closure since it gets destructed immediately after)
normally you could use getTarget or something like that to get it back...
anyways, you'll have to instantiate a new CLuaBaseEntity instead of that assignment - i think you might be able to do local target = CLuaBaseEntity.new(trader), but i have never tried that, and the syntax might be wrong (or entirely impossible)
it's a common use case so i'll have to look into it later if it doesn't work
normally you could use getTarget or something like that to get it back...
anyways, you'll have to instantiate a new CLuaBaseEntity instead of that assignment - i think you might be able to do local target = CLuaBaseEntity.new(trader), but i have never tried that, and the syntax might be wrong (or entirely impossible)
it's a common use case so i'll have to look into it later if it doesn't work
- DanteMccloud
- Posts: 25
- Joined: Wed May 04, 2016 10:53 pm
Re: ACP and ASA
I think I need to also add timer2 timer3 timer4 etc as when you try to call npc:timer more than once for multiple waves it just sets all previously called timers to the last called ones time. This fight requires several waves of Seed mandragora starts low and adds in more every 1-3 mins until the player has kill 30 of them. I couldn't find a way to make npc:timer work for multiple cases of the timer. Was hopeful that I could get it by use separate local's but that didn't really work either haha.kjLotus wrote:oh yeah, i was hoping the assignment to a local would get around that but I guess not (you can't use a parameter passed into the on(whatever) functions in a closure since it gets destructed immediately after)
normally you could use getTarget or something like that to get it back...
anyways, you'll have to instantiate a new CLuaBaseEntity instead of that assignment - i think you might be able to do local target = CLuaBaseEntity.new(trader), but i have never tried that, and the syntax might be wrong (or entirely impossible)
it's a common use case so i'll have to look into it later if it doesn't work
would likely be easier to just put the timer into the mandy's onMobDeath rather than in the function for the ???'s fight spawn lol.
so that worked in the onmobdeath but they spawn invisible then lol
Expedition Gaming
IP Address: expeditiongaming.ddns.net
Server Forums: https://expeditiongaming.ga/forum/index.php
Discord: https://discord.gg/5kJbxCF
Facebook is https://www.facebook.com/groups/1749730585295430
I host an array of game servers from FFXI (pre Abyssea), Tera, Arma3, FFXIV, SWG (pre-CU), BDO (v491)
IP Address: expeditiongaming.ddns.net
Server Forums: https://expeditiongaming.ga/forum/index.php
Discord: https://discord.gg/5kJbxCF
Facebook is https://www.facebook.com/groups/1749730585295430
I host an array of game servers from FFXI (pre Abyssea), Tera, Arma3, FFXIV, SWG (pre-CU), BDO (v491)
Re: ACP and ASA
i'd have to see your code, but it shouldn't be doing that
- DanteMccloud
- Posts: 25
- Joined: Wed May 04, 2016 10:53 pm
Re: ACP and ASA
Thank you so much for all the guidance kjLotus!! I got it working, I'm still fine tuning it to be as close to retail as i can get. They continue to spawn in waves now until the player kills 30 of them ^.^ then they stop respawning. I'm so happy to have this close to done so i can move on in the story arc and get all of ACP ready to play. ended up putting it in the Seed Mandy's onMobDeath function and usedkjLotus wrote:i'd have to see your code, but it shouldn't be doing that
Code: Select all
mob:timer(30000, function(npc) SpawnMob(17293643,240000) end);
Code: Select all
local wait = math.random(60000,180000);
Expedition Gaming
IP Address: expeditiongaming.ddns.net
Server Forums: https://expeditiongaming.ga/forum/index.php
Discord: https://discord.gg/5kJbxCF
Facebook is https://www.facebook.com/groups/1749730585295430
I host an array of game servers from FFXI (pre Abyssea), Tera, Arma3, FFXIV, SWG (pre-CU), BDO (v491)
IP Address: expeditiongaming.ddns.net
Server Forums: https://expeditiongaming.ga/forum/index.php
Discord: https://discord.gg/5kJbxCF
Facebook is https://www.facebook.com/groups/1749730585295430
I host an array of game servers from FFXI (pre Abyssea), Tera, Arma3, FFXIV, SWG (pre-CU), BDO (v491)
Re: ACP and ASA
For the seed mandragora I was just going try having the handling of their spawns in onTick() in a status effect when I had time to look at it. I had no idea I could timer() it.
Besides them there is also the sneak attack mechanic on the seed globlin to do, the dulkfutt tower climb (which I have had sitting on my local copy for awhile), and then the final battlefield mechanics (clones etc).
Also eventually need to redo the tenshodo coffer into need tables, but wasn't going to even bother with it till more of its data was filled in.
...And then ACP will finally be finished. I just haven't had free time nor motivation do get-er-done. Juts moved to a new house and got my internet back on now I need to fix the electrical here so I can use my desktop. I just can't get work done on this laptop, wrecks my flow.
Besides them there is also the sneak attack mechanic on the seed globlin to do, the dulkfutt tower climb (which I have had sitting on my local copy for awhile), and then the final battlefield mechanics (clones etc).
Also eventually need to redo the tenshodo coffer into need tables, but wasn't going to even bother with it till more of its data was filled in.
...And then ACP will finally be finished. I just haven't had free time nor motivation do get-er-done. Juts moved to a new house and got my internet back on now I need to fix the electrical here so I can use my desktop. I just can't get work done on this laptop, wrecks my flow.
Hi, I run The Demiurge server.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
DO NOT PRIVATE MESSAGE ME ABOUT BUGSPLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE