Bully-Board

Bully Modding Section => Modding Questions/Help => Modding Questions/Help Archives => Topic started by: TrollFace on July 03, 2013, 11:12:40 AM

Title: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 03, 2013, 11:12:40 AM
Say for example I want to spawn Gary in a specific building in which he normally wouldn't appear, how can I do that?
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 03, 2013, 12:13:14 PM
Sorry, I don't think I explained my question clearly, I wasn't asking how to make Gary appear in free roam. I was asking how I can make him (or any other character) spawn in the building of my choice. Like the girls dorm or somewhere he could not normally enter. (It doesn't have to be Gary, I was just using him as an example).
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: Evolution on July 03, 2013, 12:15:34 PM
Please be sure to snoop around the Board before asking such questions, here is a thread filled with Bully Modding Tutorials. (Adding Boss Characters like Gary included)

http://www.bully-board.com/index.php?topic=14726.0 (http://www.bully-board.com/index.php?topic=14726.0)
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 03, 2013, 12:19:51 PM
Please be sure to snoop around the Board before asking such questions, here is a thread filled with Bully Modding Tutorials. (Adding Boss Characters like Gary included)

http://www.bully-board.com/index.php?topic=14726.0 (http://www.bully-board.com/index.php?topic=14726.0)

I've checked there, but I never found a mod which lets me spawn peds in areas where they are restricted from spawning. I just want to take a character and make it spawn at the coordinates of my choice.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: Red Blaster on July 03, 2013, 12:22:42 PM
Do you want them to spawn like they do in free roam, or do you want special spawns?
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 03, 2013, 12:23:03 PM
In free roam.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: Evolution on July 03, 2013, 12:23:23 PM
Shit, read your previous post in REVERSE. Thought you were saying you didn't mean that you wanted peds to spawn in places they wouldn't, but you wanted to know how to add them in free-roam. My mistake, anyways, I'm pretty sure this is done through MadMan's cord grabber.

There IS a tutorial on making cliques spawn in places they shouldn't (I would know as I have done it before, but it is limited to a few places) for example, spawning The Greasers on the Football field and other places (That I can't remember).... Although, I don't remember which thread it was. Best wait until someone else answers.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 03, 2013, 12:27:30 PM
Shit, read your previous post in REVERSE. Thought you were saying you didn't mean that you wanted peds to spawn in places they wouldn't, but you wanted to know how to add them in free-roam. My mistake, anyways, I'm pretty sure this is done through MadMan's cord grabber.

There IS a tutorial on making cliques spawn in places they shouldn't (I would know as I have done it before, but it is limited to a few places) for example, spawning The Greasers on the Football field and other places (That I can't remember).... Although, I don't remember which thread it was. Best wait until someone else answers.

Haha, okay :P Well since I already know the cords, I'm assuming the rest is done through LUA, right?
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: Red Blaster on July 03, 2013, 12:36:26 PM
Hmmm...if you want to do it like in free roam, you do that through trigger, I'm afraid, not lua.

And that...I never experimented with enough to know how to do.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 03, 2013, 12:39:52 PM
Do you think anyone on this forum would know?
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: c00ld0c26 on July 03, 2013, 03:20:40 PM
If u want him to spawn in an INTEROR, I suggest you take a visit at my LUA tutorial at Script modding section.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 03, 2013, 03:41:40 PM
If u want him to spawn in an INTEROR, I suggest you take a visit at my LUA tutorial at Script modding section.

Yes, that's it, thanks.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: c00ld0c26 on July 03, 2013, 04:03:21 PM
So, You want me to explain you right away?
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 03, 2013, 05:09:21 PM
Just the lines of code I need to add would be nice.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 03, 2013, 05:14:05 PM
Oh and one more thing, I was just trying to use Lua for the first time and when I try to compile my script I get the following error:

Luac: luascript.lua:13: ')' expected near '_1_0'

I assumed that mean I needed to add ")" next to this "_1_0" on line 13 but doing that did not change anything and gave me the same error.

Sorry if this isn't the right place to ask this but it's part of my problem.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: c00ld0c26 on July 03, 2013, 05:18:04 PM
K, Just tell me which interor u want them to spawn in cuz u need the area code, the area's name and also the coords, I can get those for you and fill them for u with the commands.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 03, 2013, 05:33:43 PM
Girls Dorm      35      -430.667999, 317.761993, -2.361660

Then if I decide to try it with another interior, it's the same idea with a different area code and cords, right?
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: c00ld0c26 on July 03, 2013, 05:49:55 PM
Yes.
So u just want the codes? I see u got all u need okey.

Command to tp the player :

AreaTransitionXYZ(0, -34, -92, 1.001125435)

Just fill in the area code (the 0) and the coords.

Command to create Peds there :

PedName = PedCreateXYZ(32,l_1_0 +1, l_1_1 +1, l_1_2)

Replace the 32 with the Ped's model (For example 32 is Chad)
Replace the l_1_0 and all of those with the coords.

Plus u may need to load the interor so here is the command :

DATLoad("SP_Girls_Dorm", 2)
  DATInit()


Hope I helped.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 03, 2013, 05:55:07 PM
Yes.
So u just want the codes? I see u got all u need okey.

Command to tp the player :

AreaTransitionXYZ(0, -34, -92, 1.001125435)

Just fill in the area code (the 0) and the coords.

Command to create Peds there :

PedName = PedCreateXYZ(32,l_1_0 +1, l_1_1 +1, l_1_2)

Replace the 32 with the Ped's model (For example 32 is Chad)
Replace the l_1_0 and all of those with the coords.

Plus u may need to load the interor so here is the command :

DATLoad("SP_Girls_Dorm", 2)
  DATInit()


Hope I helped.

Where do I place the code to load the interior?

DATLoad("SP_Girls_Dorm", 2)
  DATInit()
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 03, 2013, 06:01:15 PM
Actually.... could you just paste the whole lua script for me? I just want to make sure I put everything in the right place so I don't have to keep coming back to ask questions. Thanks :)
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: c00ld0c26 on July 03, 2013, 06:03:56 PM
I recommend in the mission setup, I usually do this

PlayerSetHealth(200) -- gives the player 200 health
  AreaTransitionXYZ(0, -34, -92, 1.001125435)
DATLoad("1_B.DAT", 2)
  DATInit()
Wait(2000)

Then write the teleport command to teleport to the other place.
Basicly what this does, that when the script is launched, it teleports you to another place, loads the area and then by the time that the place , giving the place time to get loaded and then teleports you to it.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 03, 2013, 06:41:51 PM
Bully.exe has stopped working...

I think I'm doing something wrong.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: c00ld0c26 on July 03, 2013, 07:15:29 PM
Send me the script and I will check it out.
(Did u compile the script? Did you delete ArcRace1.lur inside the script.img and put the compiled ArcRace1.lur file insted?)
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: deadpoolXYZ on July 03, 2013, 07:48:52 PM
I recommend in the mission setup, I usually do this

PlayerSetHealth(200) -- gives the player 200 health
  AreaTransitionXYZ(0, -34, -92, 1.001125435)
DATLoad("1_B.DAT", 2)
  DATInit()
Wait(2000)

Then write the teleport command to teleport to the other place.
Basicly what this does, that when the script is launched, it teleports you to another place, loads the area and then by the time that the place , giving the place time to get loaded and then teleports you to it.

It's not necessary to use the "DATLoad" command. Just write the correct area code in the "AreaTransitionXYZ" part and that's it.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 03, 2013, 10:02:38 PM
Yes, but after I put back the original Trigger.img I got the same message so I will just do a reinstall.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: c00ld0c26 on July 03, 2013, 10:14:41 PM
I didn't tell you to touch the Trigger.img files.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 03, 2013, 10:35:41 PM
I didn't tell you to touch the Trigger.img files.

Lol.... I just realized.... I had to replace the Script not the Trigger.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 05, 2013, 07:26:20 PM
Hey, sorry it took so long to get back to you but I ended up having to reinstall Bully. Could you just paste the full Lua script for me?
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: c00ld0c26 on July 05, 2013, 07:49:39 PM
There ya go  :cool:

Code: [Select]
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
   AreaTransitionXYZ(35, -430.667999, 317.761993, -2.361660)
  PlayerSetHealth(200) -- gives the player 200 health
  Test1 = PedCreateXYZ(23,-437.667999, 318.761993, -2.361660)
  Test2 = PedCreateXYZ(24, -435.667999, 317.761993, -2.361660)
end
MissionCleanup = function()
end -- end statement
main = function() -- Main mission function
end
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 05, 2013, 07:57:19 PM
Thank you very very very much.... but now I have another problem :(
Reinstalling it did not fix the problem. Right after the main menu the error comes up and the game crashes. I'm not sure if it's my computer or Bully.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: c00ld0c26 on July 05, 2013, 08:04:39 PM
Well...
I dont know how to fix that you need someone like Mad to help you with this.
You should have made backup.
Title: Re: How do I get specific peds to spawn in specific locations?
Post by: TrollFace on July 05, 2013, 08:07:16 PM
Everything IS backed up so that's okay. I just can't run the game...