Bully-Board
Bully Modding Section => Modding Questions/Help => Modding Questions/Help Archives => Topic started by: boyser on January 29, 2016, 02:17:48 PM
-
Sorry for asking alot of questions in a short period of time but can someone tell me how to make my selector look like the one in not another selector?
-
Sorry for asking alot of questions in a short period of time but can someone tell me how to make my selector look like the one in not another selector?
You will have to make a menu revises the tutorial of Unknown Soldier
-
His menu tutorial doesn't show you how you can make menu's look differently it only tells you how to setup a basic menu
-
His menu tutorial doesn't show you how you can make menu's look differently it only tells you how to setup a basic menu
function f_strafe()
if IsButtonPressed(10,0) and IsMoving() and not isStrafing and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
PedSetActionNode(gPlayer,"/Global/J_Grappler_A/Default_KEY/ExecuteNodes/LocomotionOverride/Combat/CombatBasic","Act/Anim/J_Grappler_A.act")
isStrafing = true
elseif (not IsButtonPressed(10,0) or not IsMoving()) and isStrafing and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
PedSetActionTree(gPlayer,"/Global/J_Grappler_A", "Act/Anim/J_Grappler_A.act")
isStrafing = false
elseif isStrafing then
local x,y,z = PedGetPosXYZ(PedGetTargetPed())
PedFaceXYZ(gPlayer,x,y,z)
end
end
IsMoving = function()
local s = 0.08
return GetStickValue(16,0) > s or GetStickValue(16,0) < -s or GetStickValue(17,0) > s or GetStickValue(17,0) < -s
end
-
His menu tutorial doesn't show you how you can make menu's look differently it only tells you how to setup a basic menu
function f_strafe()
if IsButtonPressed(10,0) and IsMoving() and not isStrafing and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
PedSetActionNode(gPlayer,"/Global/J_Grappler_A/Default_KEY/ExecuteNodes/LocomotionOverride/Combat/CombatBasic","Act/Anim/J_Grappler_A.act")
isStrafing = true
elseif (not IsButtonPressed(10,0) or not IsMoving()) and isStrafing and not PedIsValid(PedGetGrappleTargetPed(gPlayer)) then
PedSetActionTree(gPlayer,"/Global/J_Grappler_A", "Act/Anim/J_Grappler_A.act")
isStrafing = false
elseif isStrafing then
local x,y,z = PedGetPosXYZ(PedGetTargetPed())
PedFaceXYZ(gPlayer,x,y,z)
end
end
IsMoving = function()
local s = 0.08
return GetStickValue(16,0) > s or GetStickValue(16,0) < -s or GetStickValue(17,0) > s or GetStickValue(17,0) < -s
end
What is this???
-
You just need to be a bit creative with how you print your text. Here's a simple example where you're just selecting through a bunch of strings.
function MissionSetup()
AreaTransitionXYZ(0,270,-110,6)
end
function MissionCleanup()
end
function main()
-- Setup variables:
local blip = BlipAddXYZ(270,-105,6,0,1,1)
local menu = {"menu item1","spudgun","dildo","RPG-7","Gary Smith","Pete","Damon","Sheldonator"}
local s = 1
-- Main loop:
while true do
if PedIsInAreaXYZ(gPlayer,270,-115,6,0.8) then -- if player is in blip
TextPrintString("Press \b to use menu",0,2) -- print prompt for blip
Wait(0) -- suspsend script for 1 frame so text can be printed and buttons can be processed
if IsButtonBeingPressed(9,0) then
-- Disable player control so he doesn't move:
PlayerSetControl(0)
-- Menu loop:
repeat
-- Show text:
local text = "MENU\n\n" -- the title and 2 linebreaks
for i = s - 2,s + 2 do -- for loop with i starting 2 before our current selection (s) and ending 2 after
if i == s then -- if i is our current selection, add a > to show that this menu option is currently selected
text = text..">"
end
if i >= 1 and i <= table.getn(menu) then -- if i is in between 1 and the size of our table, use i to get a menu option
text = text..menu[i]
end
text = text.."\n" -- add a linebreak, even if there was no text to show a linebreak still keeps everything positioned properly
end
TextPrintString(text,0,1) -- 0 time means 1 frame which is all we need
Wait(0) -- this suspends the script for one single frame, and during this frame the text above will be printed, and the game will process button preses which is important before our script processes the buttons
-- Process buttons:
if IsButtonBeingPressed(2,0) then
s = s - 1
if s < 1 then
s = table.getn(menu)
end
elseif IsButtonBeingPressed(3,0) then
s = s + 1
if s > table.getn(menu) then
s = 1
end
elseif IsButtonBeingPressed(7,0) then
TextPrintString("You selected "..menu[s],3,1)
Wait(3000)
end
until IsButtonBeingPressed(8,0) -- end the loop when jump is pressed
-- Regain control:
PlayerSetControl(1)
end
else
Wait(0) -- if the player wasn't in the blip, then we should still wait so that the game doesn't crash from the script never waiting
end
end
end