Bully-Board
Bully Modding Section => Modding Questions/Help => Modding Questions/Help Archives => Topic started by: DreamEvo on June 08, 2013, 08:22:35 PM
-
If i were to spawn a few greasers in the preps side of town where the basketball courts are, I know i have to get the coorandents of it but how would i spawn them there?
-
You will get the cordinates and then you will type in
Ped1 = PedCreateXYZ(23, l_1_0 + 2, l_1_1 + 2, l_1_2 + 2)
This code will spawn Johhny.
:)
-
Thanks, is that the location of the place?
-
No
This picture shows you were you put the cordinates.
(http://i44.tinypic.com/2zix4s9.jpg)
Tell me if you want more help
-
^False.
You don't need coordinates in order to spawn something.
You can simply just type in the coordinates in
Ped1 = PedCreateXYZ(23, x, y, z)
Replace x, y and z where your coords are.
-
i didnt know that. Thanks! :)
-
But you can type up there also
-
^False.
You don't need coordinates in order to spawn something.
You can simply just type in the coordinates in
Ped1 = PedCreateXYZ(23, x, y, z)
Replace x, y and z where your coords are.
Both codes are correct but using locals is cleaner.
-
I keep on messing up on the code. Can someone help me with it? Its the basketball courts on the rich side of town.
-
Which greasers you want to spawn there?
-
This code will spawn 4 greasers there but somehow they don't walk around or do anything, just stand there and stare :(
GlobalImportScript("SObjTest.lua")
ImportScript("Library/LibTable.lua")
ImportScript("SZone.lua")
l_0_0 = 60
MissionSetup = function()
local l_1_0 = 515
local l_1_1 = 504
local l_1_2 = 19.60971009
AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
Ped1 = PedCreateXYZ(28, 516, 504, 19.60971009)
Ped2 = PedCreateXYZ(26, 517, 504, 19.60971009)
Ped3 = PedCreateXYZ(24, 518, 504, 19.60971009)
Ped4 = PedCreateXYZ(27, 519, 504, 19.60971009)
end
F_MissionSetup = function()
PlayerSetControl(1)
CameraFollowPed(gPlayer)
ClockSet(9, 30)
ClockSetTickRate(0.0060000000521541)
LaunchScript("SObjTest.lua")
end
MissionCleanup = function()
ClearTextQueue()
EnablePOI()
gMissionRunning = false
shared.gMissionEventFunction = nil
WeatherRelease()
PlayerSetControl(1)
PlayerSetPunishmentPoints(0)
end
main = function()
F_MissionSetup()
gMissionRunning = true
while gMissionRunning do
UpdateTextQueue()
Wait(0)
end
end
-
Thanks man and thats weird.
-
Thanks but how come they dont show up anywhere else? Is there a way to make it so they show up every where else just like the other peds? They only stay there and only there. I would like to see them at school and town as the others.
-
You havnt typed in something to do. The peds just stand there bucuse they have no order to do something.
PedAttack(gplayer, Ped1)
Will make Ped1 attack the player.
PedRecriutAlly(gplayer, Ped1)
Will make ped1 to your bodygaurd.
for example
-
Quite a bit of mistakes in this section:
You havnt typed in something to do. The peds just stand there bucuse they have no order to do something.
PedAttack(gplayer, Ped1)
Will make Ped1 attack the player.
You wrote the code wrong. It's actually PedAttack(Ped1, gPlayer, 0-3) Now, I know the 0-3 has something to do with aggression, but all I know is that 3 makes it so that the ped in question focuses on the ped they're attacking and ignores any attacks against him or her until they knock out the ped they're set to attack.
Thanks but how come they dont show up anywhere else? Is there a way to make it so they show up every where else just like the other peds? They only stay there and only there. I would like to see them at school and town as the others.
They stand there because they have no lua command to do something.
The thing is, these lua commands are for specific spawns. Not randomized spawning. That's done through Trigger.
This code will spawn 4 greasers there but somehow they don't walk around or do anything, just stand there and stare :(
GlobalImportScript("SObjTest.lua")
ImportScript("Library/LibTable.lua")
ImportScript("SZone.lua")
l_0_0 = 60
MissionSetup = function()
local l_1_0 = 515
local l_1_1 = 504
local l_1_2 = 19.60971009
AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2)
Ped1 = PedCreateXYZ(28, 516, 504, 19.60971009)
Ped2 = PedCreateXYZ(26, 517, 504, 19.60971009)
Ped3 = PedCreateXYZ(24, 518, 504, 19.60971009)
Ped4 = PedCreateXYZ(27, 519, 504, 19.60971009)
end
F_MissionSetup = function()
PlayerSetControl(1)
CameraFollowPed(gPlayer)
ClockSet(9, 30)
ClockSetTickRate(0.0060000000521541)
LaunchScript("SObjTest.lua")
end
MissionCleanup = function()
ClearTextQueue()
EnablePOI()
gMissionRunning = false
shared.gMissionEventFunction = nil
WeatherRelease()
PlayerSetControl(1)
PlayerSetPunishmentPoints(0)
end
main = function()
F_MissionSetup()
gMissionRunning = true
while gMissionRunning do
UpdateTextQueue()
Wait(0)
end
end
You forgot one thing:
Ped1 = PedCreateXYZ(28, 516, 504, 19.60971009)
Ped2 = PedCreateXYZ(26, 517, 504, 19.60971009)
Ped3 = PedCreateXYZ(24, 518, 504, 19.60971009)
Ped4 = PedCreateXYZ(27, 519, 504, 19.60971009)
Has to be like this
local Ped1 = PedCreateXYZ(28, 516, 504, 19.60971009)
local Ped2 = PedCreateXYZ(26, 517, 504, 19.60971009)
local Ped3 = PedCreateXYZ(24, 518, 504, 19.60971009)
local Ped4 = PedCreateXYZ(27, 519, 504, 19.60971009)
However, if you're writing a complex script, what you will want to do is first assign the locals in MissionSetup as follows:
local Ped1 = nil
local Ped2 = nil
local Ped3 = nil
local Ped4 = nil
and THEN write the spawn code later as follows:
Ped1 = PedCreateXYZ(28, 516, 504, 19.60971009)
Ped2 = PedCreateXYZ(26, 517, 504, 19.60971009)
Ped3 = PedCreateXYZ(24, 518, 504, 19.60971009)
Ped4 = PedCreateXYZ(27, 519, 504, 19.60971009)
-
All codes works.
-
The spawning code example I wrote is the safest example.
But the PedAttack code, you wrote it wrong. You set for Jimmy, not the other ped.
-
Yes but i think he understands that he shall have the peds name there.
But you dont need to type 0-3) you can just type in PedAttack(Ped, Ped)
Both one works :)
-
I know what you mean, but let me explain.
If you define the local name as nil in MissionSetup, you can then define it differently in separate functions without worrying about potential conflicts or glitches. It's the cleanest way.
As for PedAttack, I was just saying that 0-3 has an effect on their fight behavior (keep attacking until the ped is knocked out, or whether they can be distracted by another ped, etc.).
-
Is there a code to have the spawned ped do normal actions like walk around or talk with other clique members?
-
Look my Greasers vs Preppies video:
Bully Scholarship Edition Greasers vs Preppies - Final Showdown At The Basketball Court (http://www.youtube.com/watch?v=_y2yiSJUl-w#)
-
Is there a code to have the spawned ped do normal actions like walk around or talk with other clique members?
Yes. IIRC, PedWander makes them move around.
There is another code like PedisWantingToSocialize or something like that, which makes two peds talk to each other.
A group conversation though can only be done either through a combo of lua and trigger (easier way), or through a complex table (hard way).