How to use bots in your title packs

Discuss everything related to custom data creation.

Moderator: NADEO

Post Reply
User avatar
TMarc
Posts: 15255
Joined: 05 Apr 2011, 19:10
Location: Europe
Contact:

Re: How to use bots in your title packs

Post by TMarc »

ok
User avatar
xbx
Nadeo
Nadeo
Posts: 1289
Joined: 14 Jun 2010, 17:35

Re: How to use bots in your title packs

Post by xbx »

steeffeen wrote: another question though:

Code: Select all

Users_CreateFake(Text, Integer);
works but fails always on my end
the fake players gets created successfully and is working, but the script crashes instantly with the following error
http://www.pictures.esc-clan.net/upload/createfake.jpg

and a request:
it would be great if fake players wouldn't be part of the Players array but included in the BotPlayers array
So....
I checked:
* there's a bug in the error check Users_CreateFake(), doh... so the function completes successfully but still send an error... (fixed in next update)
* the parameter of Users_CreateFake() is a nickname, the login is internally generated.

Actually If you want to create BotPlayers , you should use :

Code: Select all

CreateBotPlayer(NullId, 0, 200, Spawn, 0)
instead.

Users_xxx() are inteded to mimic the connection of actual users for the ease of debbuging (like filling score tables & such), so that's why they're not added to the botplayers.
(and maybe at some point in the future also move and shoot around as fake adversaries with scores and all)
Kak0
Posts: 156
Joined: 11 May 2012, 09:25

Re: How to use bots in your title packs

Post by Kak0 »

steeffeen wrote:Saunter_AnchorPoint doesn't exist
My bad, should be in the next update. It only means that for the moment the bot wanders around its spawn point, this variable will allow you to make it wander in another zone.

For the Users_CreateFake problem, you can also use this :

Code: Select all

Users_SetNbFakeUsers(Integer _NbClan1, Integer _NbClan2)
This one should work.
User avatar
steeffeen
Translator
Translator
Posts: 2463
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: How to use bots in your title packs

Post by steeffeen »

thanks for your responses :)
yeah i had already managed to get bots working quite well actually
they are rocking the scores, i have to play very seriously if i don't want to lose against my bots :lol: (see InstaDM)

thanks for this feature! :thx:
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    User avatar
    TMarc
    Posts: 15255
    Joined: 05 Apr 2011, 19:10
    Location: Europe
    Contact:

    Re: How to use bots in your title packs

    Post by TMarc »

    Well done, for the findings and the fixing :3
    steeffeen, you're becoming script-bug hunter #1 :thumbsup:
    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2463
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: How to use bots in your title packs

    Post by steeffeen »

    xbx wrote:Users_xxx() are inteded to mimic the connection of actual users for the ease of debbuging (like filling score tables & such), so that's why they're not added to the botplayers.
    (and maybe at some point in the future also move and shoot around as fake adversaries with scores and all)
    actually i'm fine with that by now, it was just weird at the beginning

    other things:

    1. if you set a number of fake players with Users_SetNbFakePlayers() and restart the script the fake users stay, their number isn't defaulted back to 0, is that intended?
    2. after you've set a number of fake players and create one with Users_CreateFake(), is one of the other fake players supposed to be replaced? how do these methods work together? it's quite a puzzle
    3. if you try to destroy a fake player with Users_DestroyFake() it says "can't destroy fake" or something like that, is that because the fake user that you want to destroy has to be created by the Users_CreateFake() method or is that a bug?

    regards
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks
      Kak0
      Posts: 156
      Joined: 11 May 2012, 09:25

      Re: How to use bots in your title packs

      Post by Kak0 »

      steeffeen wrote:1. if you set a number of fake players with Users_SetNbFakePlayers() and restart the script the fake users stay, their number isn't defaulted back to 0, is that intended?
      I don't understand. If you restart the script, the fake players are unspawned, then when the script restarts Users_SetNbFakeUsers() is called again (unless you commented/deleted the line where it was called), so fake players are spawned again... Where is the problem ? Do you mean that you spawned fake players with Users_SetNbFakeUsers(), then deleted the call to this function in your script, restarted, and the fake players were not unspawned ?
      steeffeen wrote:2. after you've set a number of fake players and create one with Users_CreateFake(), is one of the other fake players supposed to be replaced? how do these methods work together? it's quite a puzzle
      Users_SetNbFakeUsers(X, Y) makes sure there are X fake players in one clan and Y in the other, destroying fake players if there are more than this number, creating them if there aren't enough. Users_CreateFake() just creates a bot, no matter what. So, if you call Users_CreateFake() before Users_SetNbFakeUsers() there might be some conflicts (calling it after should do what it is meant to, though I don't see the point in using these functions together).
      User avatar
      xbx
      Nadeo
      Nadeo
      Posts: 1289
      Joined: 14 Jun 2010, 17:35

      Re: How to use bots in your title packs

      Post by xbx »

      steeffeen wrote: 1. if you set a number of fake players with Users_SetNbFakePlayers() and restart the script the fake users stay, their number isn't defaulted back to 0, is that intended?
      yes. (in the sense that it mimics a real user: when you restart the script, the people aren't juste kicked away from the server... )
      steeffeen wrote: 2. after you've set a number of fake players and create one with Users_CreateFake(), is one of the other fake players supposed to be replaced? how do these methods work together? it's quite a puzzle
      Users_SetNbFakeUsers() is just a helper / convience function that just calls Users_DestroyFake()/ Users_CreateFake()
      steeffeen wrote: 3. if you try to destroy a fake player with Users_DestroyFake() it says "can't destroy fake" or something like that, is that because the fake user that you want to destroy has to be created by the Users_CreateFake() method or is that a bug?
      mmm not quite sure here.
      I guess you're talking of DestroyBotPlayer() ?
      so yeah Users_DestroyFake() can only be called for players from Users_CreateFake() (and Users_SetNbFakeUsers() )
      and DestroyBotPlayer() only for CreateBotPlayer(), you cannot cross them.
      symmetry! :3
      User avatar
      steeffeen
      Translator
      Translator
      Posts: 2463
      Joined: 14 Oct 2012, 16:22
      Location: Germany

      Re: How to use bots in your title packs

      Post by steeffeen »

      let's see...
      Kak0 wrote:Where is the problem ? Do you mean that you spawned fake players with Users_SetNbFakeUsers(), then deleted the call to this function in your script, restarted, and the fake players were not unspawned ?
      yep, after deleting the function call the bots are still "on the server"
      xbx wrote:yes. (in the sense that it mimics a real user: when you restart the script, the people aren't juste kicked away from the server... )
      alrighty! :)
      Kak0 wrote:Users_SetNbFakeUsers(X, Y) makes sure there are X fake players in one clan and Y in the other, destroying fake players if there are more than this number, creating them if there aren't enough. Users_CreateFake() just creates a bot, no matter what. So, if you call Users_CreateFake() before Users_SetNbFakeUsers() there might be some conflicts (calling it after should do what it is meant to, though I don't see the point in using these functions together)
      xbx wrote:Users_SetNbFakeUsers() is just a helper / convience function that just calls Users_DestroyFake()/ Users_CreateFake()
      yeah that's what i expected, i just wanted to clarify this because i couldn't test it yet (Users_CreateFake() is bugged as you know^^)
      i won't use them together knowing that but with this information you could think that the "overall" number of fake users is 0 if you don't set it with Users_SetNb... and your fake user create with CreateFake() will be destroyed instantly ;)
      xbx wrote:mmm not quite sure here.
      I guess you're talking of DestroyBotPlayer() ?
      so yeah Users_DestroyFake() can only be called for players from Users_CreateFake() (and Users_SetNbFakeUsers() )
      and DestroyBotPlayer() only for CreateBotPlayer(), you cannot cross them.
      symmetry!
      i didn't talk about bot players, everything was concerning fake users
      example:
      - Users_SetNbFakeUsers(3, 0);
      - 3 fake users on the server
      - Users_SetNbFakeUsers(2, 0);
      - 2 fake users on the server and the third one is still in the scores and in the user list (disconnected status)
      - now i want to get rid of the disconnected fake user, i tried DestroyFake() him but it doesn't work, i will post a screenshot later
      - i was able to get him out of the scoreboard by Reset()ing his score but that way it's not 100% clean

      maybe you can't really destroy a user object and the method will only "disconnect" the user? it's just that i expected that the whole user object will be destroyed and removed out of the Users list.. oh well that's probably the point.. after you've said that Users_SetNbFakePlayers() calls CreateFake() and DestroyFake() and these fake users aren't removed out of the Users list :lol:
      i see, i see, fake users are only there to simulate a normal (player) user and i'm just abusing them for my needs :lol:

      //Edit: okay i couldn't reproduce the issue with DestroyFake(), i will post about that as soon as it happens again
        Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

        ManiaControl, FancyManiaLinks
        User avatar
        TGYoshi
        Posts: 795
        Joined: 15 Mar 2011, 16:59

        Re: How to use bots in your title packs

        Post by TGYoshi »

        Latest patch (a few minutes ago) messed bots up. They go idle after setting their mode from Turret back to Patrol. If I set it to Turret after Patrol again it'll act like a turret as expected, but it won't resume it's Patrol behaviour.
        The initial Patrol at spawn does work correctly, tho.
        =3
        Post Reply

        Return to “Title Pack & Custom Data Creation”

        Who is online

        Users browsing this forum: No registered users and 1 guest