Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hi again! So i figured asking would be better than bashing my head against a wall but: im curious as to how one would go about having an unknown contact become a named one without making a new contact. if it's something you also don't know don't mind it, was just a curiosity.

Set the name of the 'member' to unknown, then later, just replace that member with one with a name. So create it with the name unknown, then later remove it and replace it with one with a name. 

The name of the contact is made by checking all the members keys, and just using the one that isnt you. So if a conversationg has two members: 'mc' and 'unknown', and the phone owner is 'mc' the contact is 'unknown', as thats the one that doesnt match the phone. If you then remove the unknown member and replace it with a member called 'sarah' it will now use that as the contact name. 

But as youre still using the same conversation, just changing the other member, it will still keep all the history. 

Let me know if you need an example in code, im just on my phone atm so cant do one right now.

(2 edits)

Here, throw this in (change the member name of 'mc' if that isnt your phones name) and it will add a convo with a changing name:


default unknown_convo = [

    {"ember":"Hey"},

    {"mc":"Hey who is this"},

    {"ember":"Ember"},

    {"mc":"OH! Ill update your name"},

    {"code":"""

mc_ember_convo['members'].pop('unknown', None)

mc_ember_convo['members']['ember']= {'profile':'addaprofilepic.png'}

"""},

    {"mc":"done"}

]

default mc_ember_convo = build_conversation(

    unknown_convo,

    member("mc"),

    member("unknown", profile = "test/mc_profile.png")

)

You can obviously replace it from wherever you want, i just showed it being done in the phone here. 

Remember to always set a profile picture, it will crash if it cant find one (I will make it so it just shows a default instead of crashing at some point). If youre removing and adding the member to change the name, just re set the same one. 

oooh! got it! thank you so much! ^^