[Tut] Move some air drop config to MasterServer.cfg

Results 1 to 14 of 14
  1. #1
    Account Upgraded | Title Enabled! Duong Phan is offline
    MemberRank
    Sep 2012 Join Date
    VNLocation
    203Posts

    [Tut] Move some air drop config to MasterServer.cfg

    Default item drop:

    sobj_DroppedItem.cpp

    Look for:
    Code:
    int obj_DroppedItem::GetItemDefault(int i)
    Change all function to:

    Code:
    int obj_DroppedItem::GetItemDefault(int i)
    {
    static const char* configFile = "MasterServer.cfg";
    const char* group      = "AirDrop";
    int AirItem1 = r3dReadCFG_I(configFile, group, "AirItem1", 301128);
    int AirItem2 = r3dReadCFG_I(configFile, group, "AirItem2", 301128);
    int AirItem3 = r3dReadCFG_I(configFile, group, "AirItem3", 301128);
    int AirItem4 = r3dReadCFG_I(configFile, group, "AirItem4", 301128);
    int AirItem5 = r3dReadCFG_I(configFile, group, "AirItem5", 301128);
    
    	switch(i)
    	{
    	case 0:	
    			return AirItem1;
    	case 1:
    			return AirItem2;
    	case 2:
    			return AirItem3;
    	case 3:	
    			return AirItem4;
    	case 4:	
    			return AirItem5;
    	}
    	return 0;
    }
    Air drop time:
    ServerGameLogic.cpp
    Search:
    Code:
    static const char* configFile = "MasterServer.cfg";
    Delete:
    Code:
    RESPAWN_TIME_AIRDROP = 4.0f * 60.0f * 60.0f); // 4 hours
    Add:
    Code:
    const char* group      = "AirDrop";
    const float RESPAWN_TIME_AIRDROP = r3dReadCFG_F(configFile, group, "AirDropTime", 43000.0f); // 12 hours
    MasterServer.cfg

    Add:

    Code:
    [AirDrop]
    AirDropTime = 43000.0f //12 hours
    AirItem1 = 301997
    AirItem2 = 301997
    AirItem3 = 301997
    AirItem4 = 301998
    AirItem5 = 301998
    AirlootBox =  301128


  2. #2
    My Status --> LukasCCB is offline
    MemberRank
    Apr 2013 Join Date
    CracolandiaLocation
    1,190Posts

    Re: [Tut] Move some air drop config to MasterServer.cfg

    you forgot change

    [AirDrop]
    AirDropTime = 43000.0f //12 hours
    AirItem1 = 301997
    AirItem2 = 301997
    AirItem3 = 301997
    AirItem4 = 301998
    AirItem5 = 301998
    AirlootBox = 301128

    const char* group = "AirDrop";
    const float RESPAWN_TIME_AIRDROP = r3dReadCFG_F(configFile, group, "AirDropTime",
    30197); // 12 hours

    time is ordered per second

    43000 = 12 hours
    5000 = 1 hour
    15000 = 4 hours (default time in source)

    Thank you :)
    Last edited by LukasCCB; 22-10-16 at 12:44 AM.

  3. #3
    Account Upgraded | Title Enabled! Duong Phan is offline
    MemberRank
    Sep 2012 Join Date
    VNLocation
    203Posts

    Re: [Tut] Move some air drop config to MasterServer.cfg

    Quote Originally Posted by lukasccb View Post
    you forgot change

    [AirDrop]
    AirDropTime = 43000.0f //12 hours
    AirItem1 = 301997
    AirItem2 = 301997
    AirItem3 = 301997
    AirItem4 = 301998
    AirItem5 = 301998
    AirlootBox = 301128

    const char* group = "AirDrop";
    const float RESPAWN_TIME_AIRDROP = r3dReadCFG_F(configFile, group, "AirDropTime",
    AirDropTime); // 12 hours

    EXTRA!
    time is ordered per second

    43000 = 12 hours
    5000 = 1 hour
    15000 = 4 hours (default time in source)

    Thank you :)
    That's just default value, if you change that you need to declare AirDropTime or you'll get error when compile, no need to change that.

  4. #4
    ☆Dying Dawn☆ Bombillo is offline
    MemberRank
    Jan 2012 Join Date
    ValhallaLocation
    977Posts

    Re: [Tut] Move some air drop config to MasterServer.cfg

    Quote Originally Posted by Duong Phan View Post
    Code:
    [AirDrop]
    AirDropTime = 43000.0f //12 hours
    AirItem1 = 301997
    AirItem2 = 301997
    AirItem3 = 301997
    AirItem4 = 301998
    AirItem5 = 301998
    AirlootBox =  301128
    What does the red word means?

  5. #5
    Account Upgraded | Title Enabled! Duong Phan is offline
    MemberRank
    Sep 2012 Join Date
    VNLocation
    203Posts

    Re: [Tut] Move some air drop config to MasterServer.cfg

    Quote Originally Posted by Bombillo View Post
    What does the red word means?
    not in use

  6. #6
    ☆Dying Dawn☆ Bombillo is offline
    MemberRank
    Jan 2012 Join Date
    ValhallaLocation
    977Posts

    Re: [Tut] Move some air drop config to MasterServer.cfg

    I see btw nice relase!

  7. #7
    Proficient Member demonlord21 is offline
    MemberRank
    Apr 2012 Join Date
    127.0.0.1Location
    153Posts

    Re: [Tut] Move some air drop config to MasterServer.cfg

    Quote Originally Posted by Duong Phan View Post
    That's just default value, if you change that you need to declare AirDropTime or you'll get error when compile, no need to change that.
    hmm if i read that all right his way enables you do change the airdrop timer where as your way the time set to every 12 hours in the source so wouldnt it be better to just define it then your able to change timer via cfg rather than have to recompile it?

  8. #8
    Proficient Member GMkidink is offline
    MemberRank
    Apr 2012 Join Date
    152Posts

    Re: [Tut] Move some air drop config to MasterServer.cfg

    Sweet release! but how about put LootBox (random wood boxes) in the airdrop I tried but I get error when the items is spawning ('Spawned item is not model')

  9. #9
    Account Upgraded | Title Enabled! Duong Phan is offline
    MemberRank
    Sep 2012 Join Date
    VNLocation
    203Posts

    Re: [Tut] Move some air drop config to MasterServer.cfg

    Quote Originally Posted by GMkidink View Post
    Sweet release! but how about put LootBox (random wood boxes) in the airdrop I tried but I get error when the items is spawning ('Spawned item is not model')
    Just change the default value in xml to 0 and set last id to your lootbox, but it'll only drop 1 item, if you need 5 or more, you need edit in sobj_DroppedItem.cpp

    - - - Updated - - -

    Quote Originally Posted by demonlord21 View Post
    hmm if i read that all right his way enables you do change the airdrop timer where as your way the time set to every 12 hours in the source so wouldnt it be better to just define it then your able to change timer via cfg rather than have to recompile it?
    I did, and like i said, that's default value, mean when you missing AirDropTime in your cfg it'll take 43000.0f in your source

  10. #10
    Proficient Member GMkidink is offline
    MemberRank
    Apr 2012 Join Date
    152Posts

    Re: [Tut] Move some air drop config to MasterServer.cfg

    Quote Originally Posted by Duong Phan View Post
    Just change the default value in xml to 0 and set last id to your lootbox, but it'll only drop 1 item, if you need 5 or more, you need edit in sobj_DroppedItem.cpp
    but what value in itemdb do you mean?

  11. #11
    Apprentice samwite is offline
    MemberRank
    Feb 2011 Join Date
    8Posts

    Re: [Tut] Move some air drop config to MasterServer.cfg

    how to random Item to drop ?

  12. #12
    DeadZone The Unknown is offline
    MemberRank
    Feb 2014 Join Date
    CanadaLocation
    442Posts

    Re: [Tut] Move some air drop config to MasterServer.cfg

    Quote Originally Posted by samwite View Post
    how to random Item to drop ?
    You can't. The Airdrop config reads the item ID's, you would need to create a system where it randomly generates a valid ItemID.

  13. #13
    ☆Dying Dawn☆ Bombillo is offline
    MemberRank
    Jan 2012 Join Date
    ValhallaLocation
    977Posts

    Re: [Tut] Move some air drop config to MasterServer.cfg

    Quote Originally Posted by samwite View Post
    how to random Item to drop ?
    you can do something like this or make a function to connect with the SQL to getrandom items

  14. #14
    Apprentice samwite is offline
    MemberRank
    Feb 2011 Join Date
    8Posts

    Re: [Tut] Move some air drop config to MasterServer.cfg

    Quote Originally Posted by Bombillo View Post
    you can do something like this or make a function to connect with the SQL to getrandom items
    Oh yessss you do mini Tutorials please please please
    Thank you.



Advertisement