RPG movement

ok first im sorry if this has been discussed already, i searched and searched and couldn’t find it.

I am beginning work on an rpg and would like to know if it is possible to control the character by clicking somewhere and having him/her move there, kinda rts style?

Yes, you’ll need to use Python though. You could either do it very simply where your character turns to where you clicked and begins walking immediately, or you could script path finding which may be a bit more complicated.

Ok Zack, Firstly Welcome to the Forums!
As you’re new to the forums and asking about this type of thing i’m going to ask if you are experienced with using blender?

If you are, none of this below applies to you

(Eterniam has answered your thread here…but erm, RPG games are some of the hardest games to make, well…a proper one anyway. you could make some very simple RPGs with little experience but anyways.

Not many people on this forum have managaed an RPG…here are a few but the creators are good with blender.
You could make on with like…enemies that have basic logic brick AI, and possibly a basic customisation factor (weapons & armour)

But yeah, don’t expect a the new Legdend of Zelda or FiInal Fantasy :wink: )

/Radman

thanks, i am fairly good with blender (about 1-2 years) and have a team of three friends who are very new but will mostly be doing the concept and storyline. Would you know how to do the pathfinding script or should i just search around?

No, I’m new to Python and the closest I have to path finding is wandering around. I’ll post a demo of wandering in a second, I just need to isolate the movement script.

Edit: I’ve attached the script. You probably won’t be able to use this in your project - it’s very dumb and needs a lot of optimization. It begins to slow waaaaay down when you put in too many nodes/enemies.

Edit 2: Maybe you’ll want an explanation of how it works. The “Brain” object at the top generates a list of all the nodes and makes it a global variable. The bots then look for the 2nd or 3rd (random via an actuator) nearest node, and move to it. When they’re moving their “move” property is set to true, stopping them from constantly recalculating their path. It is then set back to false once they’re -through- the node. It then repeats. It’s all multi-instance, as you can probably see.

Attachments

movement demo.blend (441 KB)

thanks, i am fairly good with blender (about 1-2 years) and have a team of three friends who are very new but will mostly be doing the concept and storyline. Would you know how to do the pathfinding script or should i just search around?

I think I might be able to help you out here. Just give me a second…

Simple directional AI. That is most likely what Eterniam’s file is based off of.
http://blenderartists.org/forum/showthread.php?t=100512

http://blenderartists.org/forum/showthread.php?t=152594

That’s all I can find for right now.

peace,
-nick

BTW i liked your file i might be able to use this type of thing later on for npcs but do you know how to make a script where the character turns and moves to where i clicked, that way i have a basis and can improve later?

P.S i know you do not know pathfinding

http://blenderartists.org/forum/showthread.php?t=104564

This could be useful… tough I dunno if it still work with the newest version of blender…

I have a demo of this as well. Strangely enough this is the second time today I’ve shown this to someone.
http://www.johnwallie.com/Downloads/pathfinder.blend

More information available on the Resources page.

Just a note plantperson, that you may want to make that circle a ghost :slight_smile: I had an awful lot of fun sending things flying with it.

But why are you using

own.distance = (((pos[0]-targetpos[0])**2)+((pos[1]-targetpos[1])**2)+((pos[2]-targetpos[2])**2))**0.5

instead of .getDistanceTo()? Is it faster?