Jump to content

Castro

Inactive Member
  • Posts

    7
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by Castro

  1. how it's not works? 

     

    Can you explain or is there anything about this?

     

    If you want to new function like pc.warp_local, here ;)

    	int dungeon_warp_local(lua_State* L)
    	{
    		if (!lua_isnumber(L, 1)) 
    		{
    			sys_err("no map index argument");
    			return 0;
    		}
    
    		if (!lua_isnumber(L, 2) || !lua_isnumber(L, 3))
    		{
    			sys_err("no coodinate argument");
    			return 0;
    		}
    
    		long lMapIndex = (long) lua_tonumber(L, 1);
    		const TMapRegion * region = SECTREE_MANAGER::instance().GetMapRegion(lMapIndex);
    
    		if (!region)
    		{
    			sys_err("invalid map index %d", lMapIndex);
    			return 0;
    		}
    
    		int x = (int) lua_tonumber(L, 2);
    		int y = (int) lua_tonumber(L, 3);
    
    		if (x > region->ex - region->sx)
    		{
    			sys_err("x coordinate overflow max: %d input: %d", region->ex - region->sx, x);
    			return 0;
    		}
    
    		if (y > region->ey - region->sy)
    		{
    			sys_err("y coordinate overflow max: %d input: %d", region->ey - region->sy, y);
    			return 0;
    		}
    
    		CQuestManager::instance().GetCurrentCharacterPtr()->WarpSet(region->sx + x, region->sy + y);
    		return 0;
    	}

    Kind Regards

    HaveBeen

     Thats excactly what i wanted^^ will test it soon! thanks bro!

  2. Hi com, 

    I'm here to ask for a new function that is working like pc.warp_local() but in a dungeon, and to a single player not to the whole group.

    The effect should be like a /go. If I use pc.warp_local() it kicks the player out of the dungeon...

     

     

    If there is any other way how to fix this without a new function you can also tell me how to. :)
    I tried : pc.warp_local(d.get_ma_index(), X, Y ) but it gave me the error : "53003 no valid mapindex"

     

     

    I hope someone can help me :)

    MFG Castro

  3.  

     

    Try a debug version:

    when login begin
    local mapidx = pc.get_map_index()
    syschat("Map index: "..mapidx or "error")
    if 352 == mapidx then
    ...

    Correct, try with this method and if it returns error then you will know the reason.

     

     

     

    I tried it like this:

    When login with pc.get_map_index() == 352 begin

    chat("DEBUG: logged warp")

    end

    and it worked. 

    Now it seems to me that global vars are unique for every core, maybe i have to use MYSQL for the table then, but thats fine. I will try it later and post the results here :) 

    Anyways, thanks to the guys who helped me out! 

    MFG Castro

     

    #closerequest

  4. Theres no use to post the quest here as it works perfectly. The problem is about the different Channels.

     

    If you port from Ch99 to this map ( CH99 ) it works. If you port from CH1 to this map it doesnt.

     

    I did both rleoad q and full reboot..

     

     

    #Edit:

     

    Can it be the problem that I use global Variables? Are they unique for Each Channel?

  5. Hi Guys :D

    I have a problem with a quest im currently working on, or better said the part it should execute after getting ported to a map.
     

    With this Code;

     

    pc.warp(x,y) -- Warps to map with mapindex == 352

     

    when login with pc.get_map_index() == 352 begin

     

     

     

     

    It works fine as long as you were on Channel99 before porting. When you try to port from Channel1 to this map (ch99 ) it doesnt start the code.

     

    Does anyone know why this is the case?

     

    sincerely Castro

     

    SOLUTION: 

    The solution is that global vars are unique for every Core. You have to use MYSQL to make them accessable by every core without getting errors like I did.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.