|
| 01 May 2012 01:01 PM |
So, you want to learn the basics of making an RPG do ya? Well I got a load of information for you! This will be a step by step guide into making a fairly good Role Play Game. The key to any game is patience, do not expect your game to get fame quickly. Do not expect to be finished with your RPG in a few days. You can break up this forum and read it over the course of a few days, it is fairly long. Now, lets begin!
What do all RPGs need? A shop? Enemies? Good GUIs? All of these are correct.
1. Enemies.
First of all you want to have a lot of variety with enemies because if you kill the same opponent over and over again it gets kind of boring. Add some character meshes, think of crazy colors, or somehting that will be really interesting and makes the player want to strive to fight it.
The best way to get a character is to get a character from freemodels. (I know I know) But heres an alternate way to get one.
1a. Tools/Test/Play Solo 2a. Now find your characters name in Workspace. Copy everything inside the model. 3a. Close the window. 4a. Paste it into explorer. 5a. Delete contents, heres a list of stuff you want to delete from the model: [] Body Colors Shirt -Might not have Pants -Might not have Health HealthScript v3.1 RobloxTeam Any hats you have Sound Animate Charactermeshes Delete anything inside the Humanoid. Delete anything inside the Head. []
Great! You have a blank character template! Now imagine all the things that could be, maybe an Orc or maybe an Angry Villager! Or maybe a man eating bird! Ok, now slow down, we still have somethings to do to get this character fighting!
Now you need to insert six scripts into your character. (I know, this may seem like a lot. But remember it will all pay off.) Rename one Animate Rename one Follow Rename one Health Rename one Respawn Rename one StatGive Rename one SwordCarrier
Open up the Animate script and paste this into it:
function waitForChild(parent, childName) while true do local child = parent:findFirstChild(childName) if child then return child end parent.ChildAdded:wait() end end
local Figure = script.Parent local Torso = waitForChild(Figure, "Torso") local RightShoulder = waitForChild(Torso, "Right Shoulder") local LeftShoulder = waitForChild(Torso, "Left Shoulder") local RightHip = waitForChild(Torso, "Right Hip") local LeftHip = waitForChild(Torso, "Left Hip") local Neck = waitForChild(Torso, "Neck") local Enemy = waitForChild(Figure, "Enemy") local pose = "Standing"
local toolAnim = "None" local toolAnimTime = 0
local isSeated = false
function onRunning(speed) if isSeated then return end
if speed>0 then pose = "Running" else pose = "Standing" end end
function onDied() pose = "Dead" end
function onJumping() isSeated = false pose = "Jumping" end
function onClimbing() pose = "Climbing" end
function onGettingUp() pose = "GettingUp" end
function onFreeFall() pose = "FreeFall" end
function onFallingDown() pose = "FallingDown" end
function onSeated() isSeated = true pose = "Seated" print("Seated") end
function moveJump() RightShoulder.MaxVelocity = 0.5 LeftShoulder.MaxVelocity = 0.5 RightShoulder.DesiredAngle = 3.14 LeftShoulder.DesiredAngle = -3.14 RightHip.DesiredAngle = 0 LeftHip.DesiredAngle = 0 end
function moveFreeFall() RightShoulder.MaxVelocity = 0.5 LeftShoulder.MaxVelocity = 0.5 RightShoulder.DesiredAngle = 1 LeftShoulder.DesiredAngle = -1 RightHip.DesiredAngle = 0 LeftHip.DesiredAngle = 0 end
function moveClimb() RightShoulder.MaxVelocity = 0.5 LeftShoulder.MaxVelocity = 0.5 RightShoulder.DesiredAngle = -3.14 LeftShoulder.DesiredAngle = 3.14 RightHip.DesiredAngle = 0 LeftHip.DesiredAngle = 0 end
function moveSit() print("Move Sit") RightShoulder.MaxVelocity = 0.15 LeftShoulder.MaxVelocity = 0.15 RightShoulder.DesiredAngle = 3.14 /2 LeftShoulder.DesiredAngle = -3.14 /2 RightHip.DesiredAngle = 3.14 /2 LeftHip.DesiredAngle = -3.14 /2 end
function getTool() kidTable = Figure:children() if (kidTable ~= nil) then numKids = #kidTable for i=1,numKids do if (kidTable[i].className == "Tool") then return kidTable[i] end end end return nil end
function getToolAnim(tool)
c = tool:children() for i=1,#c do if (c[i].Name == "toolanim" and c[i].className == "StringValue") then return c[i] end end return nil end
function animateTool() if (toolAnim == "None") then RightShoulder.DesiredAngle = 1.57 return end
if (toolAnim == "Slash") then RightShoulder.MaxVelocity = 0.5 RightShoulder.DesiredAngle = 0 return end
if (toolAnim == "Lunge") then RightShoulder.MaxVelocity = 0.5 LeftShoulder.MaxVelocity = 0.5 RightHip.MaxVelocity = 0.5 LeftHip.MaxVelocity = 0.5 RightShoulder.DesiredAngle = 1.57 LeftShoulder.DesiredAngle = 1.0 RightHip.DesiredAngle = 1.57 LeftHip.DesiredAngle = 1.0 return end end
function move(time) local amplitude local frequency
if (pose == "Jumping") then moveJump() return end
if (pose == "FreeFall") then moveFreeFall() return end
if (pose == "Climbing") then moveClimb() return end
if (pose == "Seated") then moveSit() return end
RightShoulder.MaxVelocity = 0.15 LeftShoulder.MaxVelocity = 0.15 if (pose == "Running") then amplitude = 1 frequency = 9 else amplitude = 0.1 frequency = 1 end
desiredAngle = amplitude * math.sin(time*frequency)
RightShoulder.DesiredAngle = desiredAngle LeftShoulder.DesiredAngle = desiredAngle RightHip.DesiredAngle = -desiredAngle LeftHip.DesiredAngle = -desiredAngle
local tool = getTool()
if tool ~= nil then animStringValueObject = getToolAnim(tool)
if animStringValueObject ~= nil then toolAnim = animStringValueObject.Value animStringValueObject.Parent = nil toolAnimTime = time + .3 end
if time > toolAnimTime then toolAnimTime = 0 toolAnim = "None" end
animateTool()
else toolAnim = "None" toolAnimTime = 0 end end
Enemy.Died:connect(onDied) Enemy.Running:connect(onRunning) Enemy.Jumping:connect(onJumping) Enemy.Climbing:connect(onClimbing) Enemy.GettingUp:connect(onGettingUp) Enemy.FreeFalling:connect(onFreeFall) Enemy.FallingDown:connect(onFallingDown) Enemy.Seated:connect(onSeated)
local nextTime = 0 local runService = game:service("RunService");
while Figure.Parent~=nil do time = runService.Stepped:wait() if time > nextTime then move(time) nextTime = time + 0.1 end end
Great! Now open up the Follow script and paste this into it.
local larm = script.Parent:FindFirstChild("Left Arm") local rarm = script.Parent:FindFirstChild("Right Arm")
function findNearestTorso(pos) local list = game.Workspace:children() local torso = nil local dist = 8 local temp = nil local human = nil local temp2 = nil for x = 1, #list do temp2 = list[x] if (temp2.className == "Model") and (temp2 ~= script.Parent) then temp = temp2:findFirstChild("Torso") human = temp2:findFirstChild("Humanoid") if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then if (temp.Position - pos).magnitude < dist then torso = temp dist = (temp.Position - pos).magnitude end end end end return torso end
while true do wait(0.1) local target = findNearestTorso(script.Parent.Torso.Position) if target ~= nil then script.Parent.Enemy:MoveTo(target.Position, target) end end
Ok great. Now put this into the Health script.
while true do script.Parent.Name = "Villager (Level 1) Health: " .. script.Parent.Enemy.Health .. "/" .. script.Parent.Enemy.MaxHealth wait(0) end
You need some info on this health script. See the part in quotes that says Villager (Level1) Health: Well you will want to change that to whatever you want the models name to be. So if my model was an Orc it would be...
while true do script.Parent.Name = "Orc (Level 2) Health: " .. script.Parent.Enemy.Health .. "/" .. script.Parent.Enemy.MaxHealth wait(0) end
Ok, were half way done with the scripts. The next one is Respawn. Copy and paste this into the script.
name = "Enemy"
robo = script.Parent:clone()
while true do
wait(1)
if script.Parent.Enemy.Health<1 then
wait(3)
robot = robo:clone()
robot.Parent = game.Workspace
robot:makeJoints()
script.Parent:remove()
end
end
Now, were taking this step by step. Rename the Humanoid in your model "Enemy" without the quotes. This makes it so weapons only damage this character not another player.
The next script is StatGive. Copy and paste this into the script.
local Humanoid = script.Parent.Enemy function PwntX_X() local tag = Humanoid:findFirstChild("creator") if tag ~= nil then if tag.Value ~= nil then local Leaderstats = tag.Value:findFirstChild("leaderstats") if Leaderstats ~= nil then Leaderstats.Gold.Value = Leaderstats.Gold.Value + 5 wait(0.1) script:remove() end end end end Humanoid.Died:connect(PwntX_X)
local Humanoid = script.Parent.Enemy function PwntX_X() local tag = Humanoid:findFirstChild("creator") if tag ~= nil then if tag.Value ~= nil then local Leaderstats = tag.Value:findFirstChild("leaderstats") if Leaderstats ~= nil then Leaderstats.Exp.Value = Leaderstats.Exp.Value + 1 wait(0.1) --* script:remove() end end end end Humanoid.Died:connect(PwntX_X)
*SideNote: The part where it says Leaderstats.Exp.Value = Leaderstats.Exp.Value + 1 is how much Exp you will get for killing the enemy. Above that there is a part just like that but instead of adding Exp it gives gold. It is a good match to give Exp and Gold at the same time. You can change the amounts by changing 1 or 5 to whatever the amount is you want to give.*
Now the last script is SwordCarrier. Paste this into it.
possibleAnims = { "Lunge", "Slash", "Slash" }
miked=script.Parent
itlh=miked.Torso:findFirstChild("Left Hip") itlh.Part0=miked.Torso itlh.Part1=miked:findFirstChild("Left Leg") itlh.C0=CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
itrh=miked.Torso:findFirstChild("Right Hip") itrh.Part0=miked.Torso itrh.Part1=miked:findFirstChild("Right Leg") itrh.C0=CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
itls=miked.Torso:findFirstChild("Left Shoulder") itls.Part1=miked.Torso itls.C0=CFrame.new(2, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) itls.Part0=miked:findFirstChild("Left Arm")
itrs=miked.Torso:findFirstChild("Right Shoulder") itrs.Part1=miked.Torso itrs.C0=CFrame.new(-2, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) itrs.Part0=miked:findFirstChild("Right Arm")
miked.Head:makeJoints()
while true do local p = game.Players:GetChildren() for i = 1,#p do if p[i].Character~=nil then if p[i].Character:findFirstChild("Torso")~=nil then if (p[i].Character.Torso.Position - script.Parent.Torso.Position).magnitude < 5 then local anim = Instance.new("StringValue") anim.Value = possibleAnims[math.random(1, #possibleAnims)] anim.Name = "toolanim" anim.Parent = script.Parent.LinkedSword end end end end wait(0.5) end
Awesome! All the scripts are done! Now here comes the hard part. We are going to (drum roll please) MAKE YOUR CHARACTER HOLD A SWORD AND FIGHT!!! OOooooo -dies- :P Ok.
Get this model from me:
http://www.roblox.com/Sword-for-RPGs-item?id=79043130
Now put that model into workspace. Then put it into your character. Move it towards the characters Right Arm. (It doesn't matter where the sword goes, it's just for space purposes) Great! Your Humanoid is done.
Now for the decoration part of Enemies. You will need some Charactermeshes. No, you create these. Get a set of character meshes from freemodels. Now you can put these character meshes into your character and they will transform the character into a knight or make him an elf or any of the Packages Roblox has made. Or if you get them from a retexturer they will be different and cooler.
You just made your very first Enemy!
Now lets go to Step two.
2. Leaderboard
This is the primary part of your RPG. Insert a script into Workspace. Put this into the script:
function onChanged(exp, lvl, left) a = lvl.Value * 2 * lvl.Value if exp.Value == a or exp.Value > a then print("lvl up") lvl.Value = lvl.Value +1 exp.Value = exp.Value - a end print("exp gained") left.Value = a - exp.Value end
function onPlayerEntered(newPlayer)
local stats = Instance.new("IntValue") stats.Name = "leaderstats"
local lvl = Instance.new("IntValue") lvl.Name = "Level" lvl.Value = 1
local xp = Instance.new("IntValue") xp.Name = "Exp" xp.Value = 0
local gold = Instance.new("IntValue") gold.Name = "Gold" gold.Value = 0
local left = Instance.new("IntValue") left.Name = "Exp Left" left.Value = lvl.Value * 0.5 * lvl.Value
lvl.Parent = stats xp.Parent = stats gold.Parent = stats left.Parent = stats
stats.Parent = newPlayer
xp.Changed:connect(function() onChanged(xp, lvl, left) end)
end
function onChildAdded(child) c = game.Players:GetChildren() for i = 1, #c do if c[i].Character == child then char = c[i].Character if char:findFirstChild("Humanoid") ~= nil then local stats = c[i]:findFirstChild("leaderstats") if stats ~= nil then local lvl = stats:findFirstChild("Level") if lvl ~= nil then char.Humanoid.MaxHealth = 20 + (lvl.Value * 10)--donta touch adam! char.Humanoid.Health = char.Humanoid.MaxHealth end end end end end end
game.Players.ChildAdded:connect(onPlayerEntered)
game.Workspace.ChildAdded:connect(onChildAdded)
Now you have a leaderboard. Your RPG is looking good!
3. Terrain and Level Design
This part is very important, and is limited only to your imagination. You want a very big RPG world so people can explore. Spread harder enemies to farther reaches of the map. Make a big starting room with easy enemies because this where most people traffic is going to be going on. Make a variety of places to go, a monster cave, ice kingdom, bear mountain, lava valley etc. This will be the most time consuming part of making your RPG.
4. Saving
You always want your stats to be saved. This is a script that autos saves stats. Insert a script into workspace and put this into it:
function onPlayerEntered(player) wait() player:WaitForDataReady() repeat wait() until player:FindFirstChild("leaderstats") if player.DataReady then if player:findFirstChild("leaderstats") then local score = player.leaderstats:GetChildren() for i = 1,#score do local ScoreLoaded = player:LoadNumber(score[i].Name) wait() if ScoreLoaded ~= 0 then score[i].Value = ScoreLoaded end end end end end function onPlayerLeaving(player) if player:findFirstChild("leaderstats") then local score = player.leaderstats:GetChildren() for i = 1,#score do player:SaveNumber(score[i].Name,score[i].Value) end end end game.Players.PlayerAdded:connect(onPlayerEntered) game.Players.PlayerRemoving:connect(onPlayerLeaving)
Great! Your almost done.
5. GUIs
GUIs make a game look professional. Try adding stat GUIs (I am too bored to give you the code, sorry.) and maybe some Help GUIs.
6. Shops
You want a variety of shops and a variety of weapons. Here is a link to the model I made. In the script you might need to change how many parents the script needs to link itself to the stats.
http://www.roblox.com/GUI-for-RPG-Guide-item?id=79058176
Ok, you are done! This took a long time to make and I hope it helps you! Give links to this please so it gets some views!
~thedestroyer115, the most helpful builder!~ |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 01 May 2012 01:06 PM |
| sorry can you tell that again? :P |
|
|
| Report Abuse |
|
|
|
| 01 May 2012 01:09 PM |
lol. No...was it a good guide?
~thedestroyer115, the most helpful builder!~ RPG Guide: http://www.roblox.com/Forum/ShowPost.aspx?PostID=67308851 |
|
|
| Report Abuse |
|
|
DawgINC
|
  |
| Joined: 27 Apr 2012 |
| Total Posts: 156 |
|
| |
|
DawgINC
|
  |
| Joined: 27 Apr 2012 |
| Total Posts: 156 |
|
|
| 01 May 2012 01:49 PM |
| And something didn't work it would not follow me in solo mode was one of your scripts messed up? |
|
|
| Report Abuse |
|
|
Blackplug
|
  |
| Joined: 06 Dec 2010 |
| Total Posts: 1714 |
|
|
| 01 May 2012 02:05 PM |
I have this already, I used it to make a Paint Ball Player that dosen't team kill :D
Logic is wonderful. |
|
|
| Report Abuse |
|
|
|
| 01 May 2012 02:11 PM |
I believe that every RPG should have a storyline. Running around hitting things seems incredibly boring.
Other useful stuff: Special class abilities, Quests (I'd say this is essential), Professions, PVP, Cutscenes and other special effect goodies, and equipment.
Just sayin |
|
|
| Report Abuse |
|
|
|
| 01 May 2012 03:05 PM |
| Ok, you give us the scirpts for that. :3 |
|
|
| Report Abuse |
|
|
MrMcAero
|
  |
| Joined: 21 Apr 2012 |
| Total Posts: 671 |
|
|
| 01 May 2012 03:07 PM |
Sad to know someone is taking freemodel's, reading their instruction's, and then posting about them here. What a fail.
- Cheers! |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 May 2012 03:10 PM |
| It's sad that you can't be happy that theres someone whos sharing his scripts to help people. >.< |
|
|
| Report Abuse |
|
|
|
| 01 May 2012 04:00 PM |
| thedestroyer, it's not my tutorial, it's yours. I'm just saying that you need more than what you listed for a "good" RPG in my opinion (and that of anyone else with a good taste in games). I'm too selfish to post scripts that I have worked for days on so that the lazies can make their half hour RPGs. |
|
|
| Report Abuse |
|
|
|
| 01 May 2012 04:21 PM |
| You did not even read the thing did you. If you read it you would think your post sounds stupid. |
|
|
| Report Abuse |
|
|
|
| 01 May 2012 04:23 PM |
| And you know what? I admit it, I am not the best scripter. But it took my about a month to get the skill I needed to make an RPG that I think is fairly good. Now I don't want others to go through suffering when I can give them answers. Now be quiet, I don't know how to make quest scripts. And if you don't want to share them then this Guide is fair enough? Eh? |
|
|
| Report Abuse |
|
|
|
| 01 May 2012 04:53 PM |
It took me several years to get the skill to make an RPG that I think is fairly good. Maybe that will make it easier for you to understand why I think something made with those scripts is trash.
You're just giving people the exact same thing as what they would find in free models. Your "Guide" doesn't teach them anything more than how to use other peoples' code. |
|
|
| Report Abuse |
|
|
|
| 01 May 2012 04:56 PM |
| Oh, and on my first RPG about 2 years ago I used those EXACT scripts from free models. I recognize the "PwntX_X" and the "miked" |
|
|
| Report Abuse |
|
|
|
| 01 May 2012 05:09 PM |
It was a good attempt for sure, so thank you for helping the RPG making community, because as we RPG creators know it's a hard thing to do it without any guidance.
However, I think that my guide doesn't give people the things to make the RPG, but the means of how to make one. Making mine a tad more useful to RPG creators, in my bias opinion. |
|
|
| Report Abuse |
|
|
X2F9LRT
|
  |
| Joined: 18 Jan 2012 |
| Total Posts: 293 |
|
|
| 01 May 2012 05:20 PM |
| I read that whole entire post. The majority of it was scripts you can easily find on free models. Even if someone were to make an rpg with a system like this it wouldn't be even half decent. |
|
|
| Report Abuse |
|
|
|
| 01 May 2012 06:26 PM |
Yes the majority you can find in freemodels. Who would go out and create the scripts themselves and post them here? And they all would look fairly the same.
|
|
|
| Report Abuse |
|
|
|
| 02 May 2012 08:56 AM |
| Stop hatin. Stop sending me PMs. I don't know how this flamed the Roblox community enough to send me hatemail... |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 04 May 2012 05:47 AM |
| Awesome guide, thanks for save and load, i needed that >:3 |
|
|
| Report Abuse |
|
|
|
| 04 May 2012 08:07 AM |
Yea, thanks. No problem. It's sad because scripters who are well already know about this and leave a bad comment but think about the people who do not know about this stuf. It might really help them. So stop with the bad comments and be glad there is someone who is willing to take an hour to make a guide for people.
~thedestroyer115, the most helpful builder!~ |
|
|
| Report Abuse |
|
|