Page 1 of 1

selection spawn screen modify?

Posted: Tue Aug 18, 2015 9:22 am
by Deviss
hello to everybody, i only have knowledge on modeling, so i am trying learn about map, and now about modding(lua script).

so i need know if its possible modify the selection spawn screen for look like carrousel screen from galactic conquest (its same than psp screen)?

i wish make this:
Hidden/Spoiler:
Image
thanks :)

Re: selection spawn screen modify?

Posted: Tue Aug 18, 2015 9:37 am
by Anakin
I'd say yes, it is. But then you'll ask me next how, and i'd have no idea. :D

My ideas:
1. Modify the original ifs_charselect (?) file to look like that and load it with your ingame,
2. use an wrapper in an custom gc script to do that. that's actualy what i'm trying to learn right now to fix my font problems and bring back the fakeconsole for RCM

Re: selection spawn screen modify?

Posted: Tue Aug 18, 2015 10:57 pm
by Teancum
I can't remember, but either ifs_charselect had a condition to check whether it as PC or not (if it's not on PC, it uses the rotating "character wheel" like you've shown), or whether a different character select screen was used. Either way, I can tell you it's possible as I once accidentally did it on PC several years ago.

Re: selection spawn screen modify?

Posted: Tue Aug 18, 2015 11:12 pm
by [RDH]Zerted
There's a non-PC version of the script. It was very easy to accidentally use that one and get stuck.

Skip the custom gc script (and anyway it'd be a user script since it's an ingame screen). Use a stock SWBF2 and directly edit whatever you need to edit. It'll be easier that way and you'll be confused enough as it is. Trying to deal with injecting all your changes instead of just making them would probably make the project too difficult. If you get it working you can always convert it into a custom user script later.

Definitely look at the code for the other carrousels in the game and at the non-PC sources. Do something 'easy' at first like moving a text description or changing what's displayed at the unit location. It might be easier to modify the non-PC script towards the PC version than the PC version towards the non-PC one.

Re: selection spawn screen modify?

Posted: Tue Aug 18, 2015 11:27 pm
by jedimoose32
[RDH]Zerted wrote:Definitely look at the code for the other carrousels in the game and at the non-PC sources. Do something 'easy' at first like moving a text description or changing what's displayed at the unit location. It might be easier to modify the non-PC script towards the PC version than the PC version towards the non-PC one.
I've studied the PC version a fair amount and I couldn't find any references to character models or animations. I believe that portion of it is hard-coded. The buttons and text aren't though.

Re: selection spawn screen modify?

Posted: Wed Aug 19, 2015 12:23 pm
by Anakin
Haven't found the PS2 or XBox spawn script, but i'd say you need to combinate this from the ifs_freeform_sides.lua
Hidden/Spoiler:
[code]do
this = ifs_freeform_sides

if gPlatformStr == "PS2" then
this.bgModel = NewIFModel {
ScreenRelativeX = 0.5,
ScreenRelativeY = 0.5,
ZPos = 255,
model = "shell_cube",
ColorR = 0, ColorG = 0, ColorB = 0,
scale = 1.25,
depth = 0.009,
inert = 1,
}
else
-- note this isn't the safe dimensions!
local w,h,v,widescreen = ScriptCB_GetScreenInfo()

this.bgImage = NewIFImage {
ScreenRelativeX = 0,
ScreenRelativeY = 0,
UseSafezone = 0,
ZPos = 255,
texture = "blank_icon",
ColorR = 0, ColorG = 0, ColorB = 0, alpha = 0.75,
localpos_l = 0,
localpos_t = 0,
localpos_r = w*widescreen,
localpos_b = h,
inert = 1,
}
end

local w,h = ScriptCB_GetSafeScreenInfo()

this.title = NewIFContainer {
ScreenRelativeX = 0.5, -- center
ScreenRelativeY = 0.0, -- top

text = NewIFText {
font = "gamefont_large",
string = "ifs.freeform.picksides",
textw = w,
halign = "hcenter",
valign = "top",
nocreatebackground = 1
}
}

side_w = w * 0.5

this.team1 = NewIFContainer {
ScreenRelativeX = 0.0, -- left
ScreenRelativeY = 0.2, -- top

text = NewIFText {
font = "gamefont_large",
textw = side_w,
x = 0,

halign = "hcenter",
valign = "vcenter",
nocreatebackground = 1
},

icon = NewIFImage {
ZPos = 200,
alpha = 0.25,
localpos_l = side_w * 0.5 - 32,
localpos_t = -32,
localpos_r = side_w * 0.5 + 32,
localpos_b = 32,
inert = 1,
}
}

this.team2 = NewIFContainer {
ScreenRelativeX = 1.0, -- right
ScreenRelativeY = 0.2, -- top

text = NewIFText {
font = "gamefont_large",
textw = side_w,
x = -side_w,

halign = "hcenter",
valign = "vcenter",
nocreatebackground = 1
},

icon = NewIFImage {
ZPos = 200,
alpha = 0.25,
localpos_l = -side_w * 0.5 - 32,
localpos_t = -32,
localpos_r = -side_w * 0.5 + 32,
localpos_b = 32,
inert = 1,
}
}

name_h = h * 0.1

this.players = NewIFContainer {
ScreenRelativeX = 0.0,
ScreenRelativeY = 0.35,
side_x = { [1] = 0, [2] = side_w },
name_y = { [0] = 0, [1] = name_h, [2] = name_h * 2, [3] = name_h * 3 },

[0] = NewIFText {
font = "gamefont_medium",
textw = side_w,

halign = "hcenter",
valign = "vcenter",
nocreatebackground = 1
},

[1] = NewIFText {
font = "gamefont_medium",
textw = side_w,

halign = "hcenter",
valign = "vcenter",
nocreatebackground = 1
},

[2] = NewIFText {
font = "gamefont_medium",
textw = side_w,

halign = "hcenter",
valign = "top",
nocreatebackground = 1
},

[3] = NewIFText {
font = "gamefont_medium",
textw = side_w,

halign = "hcenter",
valign = "top",
nocreatebackground = 1
},
}

local screen_w, screen_h = ScriptCB_GetScreenInfo()
local bar_h = h * .1

this.letterbox_top = NewIFContainer{
ScreenRelativeX = 0.0, --left
ScreenRelativeY = 0.0, --top
texture = "blank_icon",
ZPos = 200,

image = NewIFImage {
texture = "blank_icon",
ColorR = 0, ColorG = 0, ColorB = 0,
-- alpha = 1.0,
ZPos = 200,
localpos_l = -screen_w,
localpos_t = -screen_h,
localpos_r = screen_w,
localpos_b = bar_h,
inert = 1,
},
}

this.letterbox_bottom = NewIFContainer{
ScreenRelativeX = 0.0, --left
ScreenRelativeY = 1.0, --bottom
texture = "blank_icon",
ZPos = 200,

top = NewIFImage {
texture = "blank_icon",
ColorR = 0, ColorG = 0, ColorB = 0,
ZPos = 200,
localpos_l = -screen_w,
localpos_t = -bar_h,
localpos_r = screen_w,
localpos_b = screen_h,
inert = 1,
},
}

this.action = NewIFContainer{
ScreenRelativeX = 0.0, -- left
ScreenRelativeY = 1.0, -- bottom
width = action_w,
header = "Action",
ZPos = 190,


misc = NewHelptext {
x = w,
buttonicon = "btn_directional_pad_LR",
string = "common.change",
bRightJustify = 1,
y = -34,
},


accept = NewHelptext {
x = w,
buttonicon = "btna",
string = "common.select",
bRightJustify = 1,
y = -15,
},

back = NewHelptext {
x = 0,
buttonicon = "btnb",
string = "ifs.freeform.fleet.deselect",
bLeftJustify = 1,
y = -15,
},
}

end[/code]
With the ifs_pc_spawnselect.lua file (specialy only at the part where the units are listed)
Hidden/Spoiler:
[code]
for i = 0,MAX_CLASS_SLOTS do

local tag = string.format("SlotWindow%d",i)

this.Info[tag] = NewButtonWindow
{
ZPos = 200,
x = SlotUnitNameOffsetX + SlotUnitNameOffsetX * 2.5,
y = SlotYOffset + i * ( boxh + textheight + buttonlabelheight + 2 ),
--ScreenRelativeX = 0.0, -- center
--ScreenRelativeY = 0.0,
width = boxw,
height = textheight + boxh,
titleText = "ifs.profile.list",
font = fontsize,
buttonHeightPad = 1,
buttonGutter = 1,
titleOffsetX = 5,
}

this.Info[tag].bHotspot = 1
this.Info[tag].fHotspotX = -0.5 * (boxw)
this.Info[tag].fHotspotY = -0.5 * (textheight + boxh) - buttonlabelheight
this.Info[tag].fHotspotW = boxw
this.Info[tag].fHotspotH = textheight + boxh + buttonlabelheight

this.Info[tag].InfoText = NewIFText --the equipment/weapon text
{
width = boxw,

halign = "hcenter",
valign = "vcenter",
textw = boxw - boxh, -- usable area for text
texth = textheight,
font = smallfontsize,
string = "InfoText",
ColorR = 255, ColorG = 255, ColorB = 255, -- white
flashy = 0,
}

--how many lines of text to squeeze into the info box
local numLines = 4
if numSlots > 7 and screenHeight < 960 then
numLines = 3
end

local textscale = textheight / (numLines * ScriptCB_GetFontHeight(smallfontsize))
--if textscale < 1 then
this.Info[tag].InfoText.HScale = textscale
this.Info[tag].InfoText.VScale = textscale
--end
end
[/code]
let me know if you were successful :D

Re: selection spawn screen modify?

Posted: Wed Aug 19, 2015 8:44 pm
by Teancum
jedimoose32 wrote:
[RDH]Zerted wrote:Definitely look at the code for the other carrousels in the game and at the non-PC sources. Do something 'easy' at first like moving a text description or changing what's displayed at the unit location. It might be easier to modify the non-PC script towards the PC version than the PC version towards the non-PC one.
I've studied the PC version a fair amount and I couldn't find any references to character models or animations. I believe that portion of it is hard-coded. The buttons and text aren't though.
It's the same carousel layout that's used when unlocking units for Galactic Conquest on PC. It's not hard-coded.

Re: selection spawn screen modify?

Posted: Wed Aug 19, 2015 8:56 pm
by jedimoose32
I was referring to the PC instant action spawn select which doesn't use the carousel. I don't remember seeing any reference to the non-PC versions in there but I could be mistaken.

Re: selection spawn screen modify?

Posted: Thu Aug 20, 2015 12:08 pm
by Deviss
Anakin wrote:Haven't found the PS2 or XBox spawn script, but i'd say you need to combinate this from the ifs_freeform_sides.lua
let me know if you were successful :D
Teancum wrote:
jedimoose32 wrote:
[RDH]Zerted wrote:Definitely look at the code for the other carrousels in the game and at the non-PC sources. Do something 'easy' at first like moving a text description or changing what's displayed at the unit location. It might be easier to modify the non-PC script towards the PC version than the PC version towards the non-PC one.
I've studied the PC version a fair amount and I couldn't find any references to character models or animations. I believe that portion of it is hard-coded. The buttons and text aren't though.
It's the same carousel layout that's used when unlocking units for Galactic Conquest on PC. It's not hard-coded.
Many thanks Teancum, Zerted, Anakin and Jedimoose, this monday my pc crashed, after 6 years of use, i am searching about buy a new one, so all my work will be delay, i hope can try soon :), many thanks again, i will have new soon i hope

EDIT: new hard disk!!, well about the script i am checking the file "ifs_pc_spawnselect.lua" it have how will show spawn selection, i tried searching a XBOX/PS2 mod tools (for the scripts) but i didnt find him, so i am trying mixing it file with the one from galactic conquest, many thanks to everybody now i will enjoy mixing lua files :)

Re: selection spawn screen modify?

Posted: Sun Sep 13, 2015 3:40 pm
by AnthonyBF2
Teancum wrote:I can't remember, but either ifs_charselect had a condition to check whether it as PC or not (if it's not on PC, it uses the rotating "character wheel" like you've shown), or whether a different character select screen was used. Either way, I can tell you it's possible as I once accidentally did it on PC several years ago.
Would you have any memory or idea on what to edit? I have as well always wanted wheel selection mode :)

And yes, computer deaths are sad, good luck on a new machine! :D