Create an account

Avatar offline  

Upload: 29 Jan 2023, 08:26
Created by: AuD [X]
Uploaded by: Aqxaro
Avatar offline

Requires Player is forced to respawn in car (If disconnected inside)

This mod is being improved.

This mod will spawn an avatar on your location when you log out, anyone can move that avatar around the world by carrying it on them like an item, when the affected player logs back in, it will respawn where is his avatar.
The avatar is affiliated with the player name (account name).

The avatar does not risk attacks from players or zombies. only its displacement is possible (for the moment...).

WORK IN MULTIPLAYER ONLY (tested on dedicate server)
Force Respawn in Car mod is needed
 
You can safely add and remove this mod in existing save
Just the function for QUIT and QUIT to deskop buttons is overwrite

To take advantage of this mod, there will be a procedure for each existing account and therefore, each new account of newcomers (in no case am I talking about doing this manipulation after each death, but only one manipulation for each name of existing account), it is this procedure that will be explained, but you can directly test this mod, more explanations at the bottom of this description

This mod is work in progress, I do not hide that it needs to be improved on certain points mentioned below, it may contain errors, I spent a lot of time on this mod to eliminate potential bugs or glitches but this mod contains surely no errors, unless I missed this one.

The only concern of this mod for the moment, it is to be sure that the avatar appears well with the disconnection, and if you make alt f4, it will not be there. if you quit the game normally, there should be no problem.

The other (minor) glitch, the avatar can appear weird on the floor, I can't seem to put a fixed rotation of the avatar object when it automatically appears

If your avatar stays in the world while you're logged in and present on the server, that would be annoying, and I'd love some feedback on that if you find that kind of problem. Logically everything should be fine.

I will improve it over time, in its current state it is largely playable for a fair play group of players.

To know :
  • If you want to manually place your avatar before exiting the game, for a nice roleplay scene of a well-positioned avatar, you just have to do "shift"+"escape" key to get your own avatar in your inventory, so you can use the "place object" option on item, like a vanilla 3d object. you will have 30 seconds to place your avatar where you want it before auto-disconnection.

  • If you move with an avatar on you, the position is saved every 10 minutes IG.

  • If you transfer the avatar item from your inventory to the ground, the position of the avatar and therefore of the player will also be saved at this time.

  • You could not leave the game with avatars on you, they will be automatically placed on the ground.

  • A print() named ... AvatarMOD ... is generated on the server side each time: the position of an avatar is saved, a player logging in and not having an avatar affiliated with his account name, if there are glitch/dup/exploit with the avatars.
    On each print(), you will have the name of the manipulated avatar, the name of the player performing the manipulation, and possibly the related vehicle.

  • If a player connects while you have his avatar on you, it will be deleted from your inventory automatically and the player will appear at the last saved position.

  • If you die with an avatar on you, it will be impossible to recover the avatar on the corpse, the player corresponding to this avatar will be forced to reappear and play at the last saved position.

  • If you take the road with an avatar, you will have to sit it in the car, it will take a place like in the respawn in car mod, since it works together, it avoids moving with a 2-seater car and carry 10 avatars at the same time.

  • Impossible to put the avatar in a container (just on you, from the virtual seats from inside vehicles and on the ground).

  • If you play with the Rv interior mod, it will be impossible for you to take the avatar in the room of the motorhome, you will have to take it directly in the car with the appropriate option (accessible right click on the car when you are inside it).

  • You can create avatar items (in advance), even if the player account does not exist, if you generate avatars, in administrator mode, place them in the world, when creating the account later , the person of this account will appear at the position of the avatar, because the positions of the avatars will be taken into account, even if the account did not exist at the time of having placed it.

Procedure (a better explanation will be posted)
Here is the way to declare a new player account, you need to create a .txt in the media/scripts folder in your server mod, and declare the exact name of the user account as an Item, just copy/paste this code, and just change the name for the one you want. you can customize the icon and avatar image for each account name if you wish. in the item.txt of this mod there is an example with more explanation, you can take inspiration from the existing code in this path:

C:\Program Files (x86)\Steam\steamapps\workshop\content\108600\2915808671\mods\Avatar offline\media\scripts

Do not forget to look at the tutorial videos visible at the top (novice).

module AvatarMOD {

    imports
    {
        Base
    }

	item your_account_name
    {
		DisplayCategory = Corpse,
		Weight	=	2,
		Type	=	Normal,
		DisplayName	= your_display_Name_Character, 	
		Tags = AvatarMOD,

		Icon = NoAvatarM_PNG,						
		WorldStaticModel = NoAvatarPNG,	
    }	
}

You can test this mod directly in this way, you can create a login account with these names and test directly:

Men :

Brad
Billy
Ethan
Joe
Joey
Luke
Matthew
Ryan
Evan
Aaron
Bryan

--------------
--------------
Women :

Ivy
Madeline
Tess
Lexie
Emily
Daisy
June
Meredith
Kristen
Kelly
Cindy

Sanbox options :

AvatarMOD = {
ShiftEscManualPlace = true,
TakeAvatarFromNotYourSafehouseIsProhibited = false,
TakeAvatarIfNotYourFactionIsProhibited = false,
IfNotAvatarExistThenAutoQuit = false,
},

INFO: Administrators are not affected by sandbox options

ShiftEscManualPlace = If true, you can manually place your avatar with the shift and escape keys.

TakeAvatarFromNotYourSafehouseIsProhibited = If true, it will be forbidden to take an avatar from the ground if you are in another player's safehouse and if you are not part of their faction.

TakeAvatarIfNotYourFactionIsProhibited = If true, you will be prohibited from manipulating avatars that are not part of your faction.

IfNotAvatarExistThenAutoQuit = If true, when the player logs in, and they don't have an avatar affiliated with their account name, they will be automatically kicked out of the game with a message.


Comments
The minimum comment length is 10 characters.