Logo

[SM5] Get character directory for each player?

Register Log In Back To Forums

Post #1 · Posted at 2016-11-04 01:14:37pm 7.4 years ago

Offline leadbman
leadbman Avatar Member
263 Posts
Australia
Reg. 2016-02-01

"Working On: 5thMix BGA bgchanges"

Last updated: 2016-11-04 02:36pm
Hi all,

Just wondering if it's possible to get the directory name for the character chosen by each player within SM5?

What I'd like to be able to do is change the character on another screen to the character that the player has selected on the ScreenSelectCharacter screen. I'm sure this is possible somehow but I'm not sure what way to call for the directory name for each player etc.

An example of what I'd want to do in bold is below.

Quote

t[#t+1] = Def.Model{

local characterselectedp1 = GetCharacterDirectoryNameP1

if characterselectedp1 == "(5th) Rage" then
Materials = "(5th) Rage/model.txt";
Meshes = "(5th) Rage/model.txt";
elseif characterselp1 == "(5th) Alice" then
Materials = "(5th) Alice/model.txt";
Meshes = "(5th) Alice/model.txt";
else
Materials = "(5th) Rage/model.txt";
Meshes = "(5th) Rage/model.txt";
end;


Bones = "_DDRPC_common_Rest.bones.txt";
InitCommand=cmd(x,0;y,210;zoom,0;rotationy,180;cullmode,'CullMode_None';diffusealpha,0;);
OnCommand=cmd(sleep,0.6;linear,0.1;diffusealpha,1;zoom,30);
OffCommand=cmd(sleep,0.3;linear,0.1;zoom,0;diffusealpha,0;);
};


OR

Quote

t[#t+1] = Def.Model{

local characterselectedp1 = GetCharacterDirectoryNameP1

Materials = "characterselectedp1/model.txt";
Meshes = "characterselectedp1/model.txt";


Bones = "_DDRPC_common_Rest.bones.txt";
InitCommand=cmd(x,0;y,210;zoom,0;rotationy,180;cullmode,'CullMode_None';diffusealpha,0;);
OnCommand=cmd(sleep,0.6;linear,0.1;diffusealpha,1;zoom,30);
OffCommand=cmd(sleep,0.3;linear,0.1;zoom,0;diffusealpha,0;);
};


Can anyone help me work this out? Thanks in advance!

EDIT: What I'm trying to achieve is a new style character select screen and character model usage across a whole theme for Stepmania 5. There are not many themes with a proper character select screen and ones that do have it (5th Mix theme for example) are a bit too complicated/require a user to have specific files and characters.

The final product should see a proper select screen with animated characters, the ability to port across all the characters throughout the theme if they so desire.

What I've got so far:
- Basic Character Select Screen
- Showing Characters over the Select Style Screen

Plans:
- Change Characters on the Select Style Screen to what the player selects [What this thread is regarding]
- On the Character Select Screen show the 3D model of the highlighted Character [Hopefully from this threads answer I'll be able to somehow get this one working too]
- Fix the code to somehow show all icons for all characters on the Select Character Screen [When you set it up from the default metrics, the icon list of the characters shows a fallback image].
https://zenius-i-vanisher.com/ddrsig/18213.png?t=1510895050
Really need to add my scores to the tracker soon.
Always learning, always trying to push the boundaries of SM.

Post #2 · Posted at 2016-11-04 05:17:14pm 7.4 years ago

Offline Inorizushi
Inorizushi Avatar Member
487 Posts
Not Set
Reg. 2012-10-25

"huhbluh"

Last updated: 2016-11-04 05:17pm
What you want is to set a local variable do something like

Quote
local charP1 = GAMESTATE: GetCharacter(PLAYER_1):GetDisplayName();

The problem with this however is that the character isn't set until Gameplay is the current screen. You would need to make an ActorScroller to display both the model that coressponds to the highlighted character.

Post #3 · Posted at 2016-11-04 05:26:18pm 7.4 years ago

Offline leadbman
leadbman Avatar Member
263 Posts
Australia
Reg. 2016-02-01

"Working On: 5thMix BGA bgchanges"
Thanks for that. Yeah, I noticed I can't do it on the character select screen at this point as no character is set. I think I'd have to make it set the character on character change somehow.

I got the Select Style screen characters to change though! Code below:

Quote

local char = GAMESTATE:GetCharacter(PLAYER_1)
local charID = char:GetCharacterID();

local char2 = GAMESTATE:GetCharacter(PLAYER_2)
local charID2 = char2:GetCharacterID();

t[#t+1] = Def.Model{
Condition=GAMESTATE:IsSideJoined(PLAYER_1) == true and GAMESTATE:IsSideJoined(PLAYER_2) == false;
Materials = "../../../../Characters/"..charID.."/model.txt";
Meshes = "../../../../Characters/"..charID.."/model.txt";
Bones = "_DDRPC_common_Rest.bones.txt";
InitCommand=cmd(x,0;y,210;zoom,0;rotationy,180;cullmode,'CullMode_None';diffusealpha,0;);
OnCommand=cmd(sleep,0.6;linear,0.1;diffusealpha,1;zoom,30);
OffCommand=cmd(sleep,0.3;linear,0.1;zoom,0;diffusealpha,0;);
};

t[#t+1] = Def.Model{
Condition=GAMESTATE:IsSideJoined(PLAYER_2) == true and GAMESTATE:IsSideJoined(PLAYER_1) == false;
Materials = "../../../../Characters/"..charID2.."/model.txt";
Meshes = "../../../../Characters/"..charID2.."/model.txt";
Bones = "_DDRPC_common_Rest.bones.txt";
InitCommand=cmd(x,0;y,210;zoom,0;rotationy,180;cullmode,'CullMode_None';diffusealpha,0;);
OnCommand=cmd(sleep,0.6;linear,0.1;diffusealpha,1;zoom,30);
OffCommand=cmd(sleep,0.3;linear,0.1;zoom,0;diffusealpha,0;);
};


I know I could probably get the character folder path a little easier/cleaner but every time I try GetModelPath() etc it hasn't worked for me so for now I've done it the long way.

I hope this helps someone doing something like this with a SuperNOVA theme etc. I'll keep trying to sort out the character select screen. Once I'm done I'll do a thread completely detailing how it all works.
https://zenius-i-vanisher.com/ddrsig/18213.png?t=1510895050
Really need to add my scores to the tracker soon.
Always learning, always trying to push the boundaries of SM.

Post #4 · Posted at 2016-11-04 06:32:19pm 7.4 years ago

Offline Inorizushi
Inorizushi Avatar Member
487 Posts
Not Set
Reg. 2012-10-25

"huhbluh"
I'll try and take a look at the code when I can.

Right off the bat I can tell that this code wouldn't work well when you switch to versus.

It's also incredibly verbose and unclean. Using Condition isn't a recommended technique either, most people use if then statements now. It would also be better to set the Models in an actor table, this way you dont need to cppy the Init, On, and Off commands.

Post #5 · Posted at 2016-11-04 07:29:39pm 7.4 years ago

Offline leadbman
leadbman Avatar Member
263 Posts
Australia
Reg. 2016-02-01

"Working On: 5thMix BGA bgchanges"
Already sorted versus with separate code. I know it's not clean, I was basically doing trial and error till I got it working.

If you can suggest ways/how I should code it to clean it up that'd be fantastic.
https://zenius-i-vanisher.com/ddrsig/18213.png?t=1510895050
Really need to add my scores to the tracker soon.
Always learning, always trying to push the boundaries of SM.
Register Log In Back To Forums

0 User(s) Viewing This Thread (Past 15 Minutes)

©2006-2024 Zenius -I- vanisher.com -5th style- IIPrivacy Policy
Web Server: 4% · Database: 4% · Server Time: 2024-04-24 14:20:47
This page took 0.005 seconds to execute.
Theme: starlight · Language: englishuk
Reset Theme & Language