Bully-Board
Bully Modding Section => Modding Questions/Help => Modding Questions/Help Archives => Topic started by: Black Norton on December 04, 2013, 05:19:33 AM
-
now i want to try make mission in lua,so can everyone give me a command for :
-make symbol to get ped to the target (like X Symbol in map)
-Make ped to run to the target
-make health ped in top screen like BOSS Fight
-if mission end,back to the normal game
i think only this
thanks :happy:
-
C00ldoc explained how to do this in another thread. Ask him he knows.
-
Make symbol to get ped to the target :
NAMEOFBLIP = BlipAddXYZ(X,Y,Z,IDOFTHESYMBOL)
The ID for the X is 29
Ped run to target :
PedMoveToXYZ(PEDNAME,SPEED,X,Y,Z)
Speed = 0 is walk, 1 is jog, 2 is run, 3 is run very very fast
Make health ped in top screen like BOSS fight :
PedShowHealthBar(PEDNAME, true, "N_NAME", true)
if Mission end, back to the normal game :
Put this in the main = function() :
repeat
Wait(0)
until l_0_0 ~= false
MissionSucceed()
-
Make symbol to get ped to the target :
NAMEOFBLIP = BlipAddXYZ(X,Y,Z,IDOFTHESYMBOL)
The ID for the X is 29
Ped run to target :
PedMoveToXYZ(PEDNAME,SPEED,X,Y,Z)
Speed = 0 is walk, 1 is jog, 2 is run, 3 is run very very fast
Make health ped in top screen like BOSS fight :
PedShowHealthBar(PEDNAME, true, "N_NAME", true)
if Mission end, back to the normal game :
Put this in the main = function() :
repeat
Wait(0)
until l_0_0 ~= false
MissionSucceed()
3 is run very fast?like davis in "The Setup"?
-
Idk if the same speed but its faster then Jimmy.
-
c00ld i'm getting problem
i write in mission settup like this :
Darby = PedCreateXYZ(37,l_1_0 + 1,l_1_1 + 1,l_1_2 + 1)
PedMoveToXYZ(Darby ,3 ,515,504,19.60971009)
but darby isn't run to the XYZ.he only stay and stand.
and why in PedShowHealthBar,the health isn't decrease??
can you fix it??
-
c00ld i'm getting problem
i write in mission settup like this :
Darby = PedCreateXYZ(37,l_1_0 + 1,l_1_1 + 1,l_1_2 + 1)
PedMoveToXYZ(Darby ,3 ,515,504,19.60971009)
but darby isn't run to the XYZ.he only stay and stand.
and why in PedShowHealthBar,the health isn't decrease??
can you fix it??
PedMoveToXYX - You didn't put the Z coords.
Its like this (PED,SPEED,X,Y,Z)
You all placed the PED,SPEED,X,Y but you didn't wrte the Z (look in the code)
And about PedShowHealthBar make sure you selected the ped you want to see he's health.
Example :
Darby = PedCreateXYZ(ID,X,Y,Z)
PedShowHealthBar(Darby, true, "N_Darby", true)
-
PedMoveToXYX - You didn't put the Z coords.
Its like this (PED,SPEED,X,Y,Z)
You all placed the PED,SPEED,X,Y but you didn't wrte the Z (look in the code)
And about PedShowHealthBar make sure you selected the ped you want to see he's health.
Example :
Darby = PedCreateXYZ(ID,X,Y,Z)
PedShowHealthBar(Darby, true, "N_Darby", true)
Ok,PedShowHealthBar fixed
but PedMoveToXYZ
I write like this PedMoveToXYZ(Darby,3,515,504,19.60971009)
look the
X = 515
Y = 504
Z = 19.60971009
I put the XYZ Coord but why didn't work?? :wacko:
-
Well it may be the following :
1. The coords you selected are inside a wall or a place the ped cant reach.
2. The coords are at a diffrent interor or Area Code then the ped is at (for example the ped is in the school's building but the coords are in the gym, so he cant reach it)
if not those two, please make sure to give me the full script here or on PM and say exactly where the ped is spawned and where the coords you have chosen are at.
-
^lol jimmy stuck in a wall yes that all i wanna see
-
Here :
ImportScript("\\Library\\LibTable.lua") -- imports the LibTable library
ImportScript("\\Library\\LibPed.lua") -- imports the LibPed library
local l_0_0 = false
MissionSetup = function() -- basic mission setup function which is used in almost all bully scripts
local l_1_0 = 270 -- X coords
local l_1_1 = -110 -- Y coords
local l_1_2 = 6.4000000953674 -- Z coords
PlayerSetHealth(200) -- gives the player 200 health
AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
Darby = PedCreateXYZ(37,l_1_0 + 1,l_1_1 + 1,l_1_2 + 1)
PedMoveToXYZ(Darby,3, 515, 504, 19.60971009)
end
F_MissionSetup = function()
ClockSet(9, 30)
ClockSetTickRate(0.0060000000521541)
end
MissionCleanup = function()
end -- end statement
main = function() -- Main mission function
F_MissionSetup()
gMissionRunning = false
while gMissionRunning do
if PedGetHealth(gplayer, 200) < 200 then
PedSetHealth(gplayer,200)
repeat
Wait(0)
until l_0_0 ~= false
MissionSucceed()
end
Wait(0)
end
end
the target is Old Bulworth Vale basket court.
the area has same area code (is 0)
-
you cannot help me?? :-\
-
I'm at school at the moment.
I'll help when I'm back.
-
oh sorry
but how long you focus on school??
-
I decided to take a look at your script there m8.
Quite a few problems from what I can see unless pasting it here messed something up.
First off...the syntax is all wrong since there is way too much whitespace in the code....this will cause some minor problems with the lua interpreter in following all of the code.
There are a few ways to force a ped to move to a set xyz coord of their own power but personally...it would be far easier to just spawn them directly at the coords you wish to be spawned and either spawn there on your own at the same time or just add some code to make them permanent with a marker on the map to lead you to them and to let you know they are still in the game unless knocked out or something.
PedMoveToXYZ is a code I never really bothered using since while it does work...it is kinda a problematic code at times and I have found far easier methods to achieve moving a ped around.
Here is a cleaned and properly formatted version of your script. I fixed a couple typos so...see if this works now since from what I can see your code is pretty much correct.
ImportScript("\\Library\\LibTable.lua") -- imports the LibTable library
ImportScript("\\Library\\LibPed.lua") -- imports the LibPed library
local l_0_0 = false
MissionSetup = function() -- basic mission setup function which is used in almost all bully scripts
local l_1_0 = 270 -- X coords
local l_1_1 = -110 -- Y coords
local l_1_2 = 6.4000000953674 -- Z coords
PlayerSetHealth(200) -- gives the player 200 health
AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
Darby = PedCreateXYZ(37, l_1_0 + 1, l_1_1 + 1, l_1_2 + 1)
PedMoveToXYZ(Darby, 3, 515, 504, 19.60971009)
end
F_MissionSetup = function()
ClockSet(9, 30)
ClockSetTickRate(0.0060000000521541)
end
MissionCleanup = function()
end -- end statement
main = function() -- Main mission function
F_MissionSetup()
gMissionRunning = false
while gMissionRunning do
if PedGetHealth(gplayer, 200) < 200 then
PedSetHealth(gplayer,200)
repeat
Wait(0)
until l_0_0 ~= false
MissionSucceed()
end
Wait(0)
end
end
-
If you want full animation of them walking on their own to a specified destination you will need to add quite a bit more code to your script plus also load a couple animation groups as well since otherwise the ped will not do what is wanted. If c00ldoc can't help you with this just say something and I will see what I can do.
Kinda coding blind here since I don't exactly have bully installed atm so can't really test any code and am going solely from memory here so....hopefully I am correct and not mis-leading you in any way.
-
I can help him but I don't find the time.
I've been moving peds around nearly all parts of the map for anything from videos (for a few peds running scenes) to Mods like Russell Mod custom missions.
I don't find rhe time because school takes me a lot of time aswell I have to rewrite my last sub section in the Tables section in my LUA tutorial, keep my fans on YouTube entertained by uploading new videos every week and hang with friends from times to times.
Once I get the time I'll help.
But if u don't want to wait then Mad you can go ahead and take this quest on you mate :P
-
I decided to take a look at your script there m8.
Quite a few problems from what I can see unless pasting it here messed something up.
First off...the syntax is all wrong since there is way too much whitespace in the code....this will cause some minor problems with the lua interpreter in following all of the code.
There are a few ways to force a ped to move to a set xyz coord of their own power but personally...it would be far easier to just spawn them directly at the coords you wish to be spawned and either spawn there on your own at the same time or just add some code to make them permanent with a marker on the map to lead you to them and to let you know they are still in the game unless knocked out or something.
PedMoveToXYZ is a code I never really bothered using since while it does work...it is kinda a problematic code at times and I have found far easier methods to achieve moving a ped around.
Here is a cleaned and properly formatted version of your script. I fixed a couple typos so...see if this works now since from what I can see your code is pretty much correct.
ImportScript("\\Library\\LibTable.lua") -- imports the LibTable library
ImportScript("\\Library\\LibPed.lua") -- imports the LibPed library
local l_0_0 = false
MissionSetup = function() -- basic mission setup function which is used in almost all bully scripts
local l_1_0 = 270 -- X coords
local l_1_1 = -110 -- Y coords
local l_1_2 = 6.4000000953674 -- Z coords
PlayerSetHealth(200) -- gives the player 200 health
AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
Darby = PedCreateXYZ(37, l_1_0 + 1, l_1_1 + 1, l_1_2 + 1)
PedMoveToXYZ(Darby, 3, 515, 504, 19.60971009)
end
F_MissionSetup = function()
ClockSet(9, 30)
ClockSetTickRate(0.0060000000521541)
end
MissionCleanup = function()
end -- end statement
main = function() -- Main mission function
F_MissionSetup()
gMissionRunning = false
while gMissionRunning do
if PedGetHealth(gplayer, 200) < 200 then
PedSetHealth(gplayer,200)
repeat
Wait(0)
until l_0_0 ~= false
MissionSucceed()
end
Wait(0)
end
end
If you want full animation of them walking on their own to a specified destination you will need to add quite a bit more code to your script plus also load a couple animation groups as well since otherwise the ped will not do what is wanted. If c00ldoc can't help you with this just say something and I will see what I can do.
Kinda coding blind here since I don't exactly have bully installed atm so can't really test any code and am going solely from memory here so....hopefully I am correct and not mis-leading you in any way.
sorry mad but the script isn't work
Darby only stand and i don't know what the problem :wacko: :ohmy:
I can help him but I don't find the time.
I've been moving peds around nearly all parts of the map for anything from videos (for a few peds running scenes) to Mods like Russell Mod custom missions.
I don't find rhe time because school takes me a lot of time aswell I have to rewrite my last sub section in the Tables section in my LUA tutorial, keep my fans on YouTube entertained by uploading new videos every week and hang with friends from times to times.
Once I get the time I'll help.
But if u don't want to wait then Mad you can go ahead and take this quest on you mate :P
if you're busy no problem dude :)
you can help if you have the time :D
-
Huh??
help me dude :o :ohmy:
-
Sry I have not been able to reply back or do much more. Trying to concentrate fully on getting the player selector out for everyone by or before xmas and that has my full concentration atm.
-
The player selctor?? :blink:
-
The player selctor?? :blink:
psm = CANCELLED MOD
-
No unknown soldier it's not. Get your facts right. It's just renamed
-
No unknown soldier it's not. Get your facts right. It's just renamed
He heard it on swegta/c00ld0c stream yesterday
-
We have disscussed it with Rise and he confirmed it, so on the B-B podcast, we announced that the PSMM, is CANCLED.
Sorry very much.