Announcement

Collapse
No announcement yet.

How to gather/mine a recourse for a rts game?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Yeah just add a bigger collision area around the object that you want so that the character can actually walk up to the object rather than navmesh stopping him from being able to get there.

    Leave a comment:


  • replied
    I seem to accidentally post 3 of my camera sorry lol

    Leave a comment:


  • replied
    OMG why didnt I think of that, now Im using the navmesh so that I can move my character around with the mouse. Ive set the character as an ai, and used an interface to move him with my custom rts camera I made with an objectClick image for larger version

Name:	ai controler.PNG
Views:	1
Size:	102.1 KB
ID:	1079972Click image for larger version

Name:	camera.PNG
Views:	1
Size:	210.4 KB
ID:	1079973Click image for larger version

Name:	camera.PNG
Views:	1
Size:	210.4 KB
ID:	1079973Click image for larger version

Name:	camera.PNG
Views:	1
Size:	210.4 KB
ID:	1079973Click image for larger version

Name:	character.PNG
Views:	1
Size:	112.9 KB
ID:	1079974

    Leave a comment:


  • replied
    Originally posted by Beaverboy View Post
    For Jamendxman3 who asked what happens, depends on where I click onto the rock, sometimes he would walk near it and unable to go any further other times he would not move to it.
    This is the root of your problem ... I am assuming you are using a NavMesh and it sounds like the player can't plot a route to the rock and therefore can't walk to it or can only walk to it until the NavMesh ends.

    You need to not use the NavMesh for this step, rather add a sphere trigger to your rock ... on click get the location of the rock in world space ... and make the player walk to that world space. The trick here is to use the NavMesh until you can't anymore and then let the player walk straight until the player collides with the rock and then starts mining.

    Another option would be to have the rock not block the NavMesh, but this could cause other issues ... you will probably find that is why the community RTS went the route it did.

    Obviously if you are not using a NavMesh, then this is a pointless response and I apologise.

    Leave a comment:


  • replied
    Ill post some pictures soon, just need to do some house work. Instead of putting into a box trigger and have my character(s) walk into the area, I would like once I select my character(s) if I right click on an object ie a rock, he would walk up to it. He would collect say 4 metal from the rock then it would destroy. For Jamendxman3 who asked what happens, depends on where I click onto the rock, sometimes he would walk near it and unable to go any further other times he would not move to it. I tried adding oncolide event to the static mesh of my rock, then it would emit a effect then be destroyed. But when my character would touch the rock it wouldn't do anything. Sorry if my answers give some difficulty reading, Im still quite new to unreal and I have been making other projects to get the feel and how to use blueprints.

    Leave a comment:


  • replied
    What is wrong with the method done in the RTS community project too then if you don't like that way?

    Leave a comment:


  • replied
    What code do you currently have that isn't working? Please post a snippet or picture of the corresponding blueprint.

    Leave a comment:


  • replied
    Out of curiosity, what does the character do when you right-click on the rock?

    Leave a comment:


  • started a topic How to gather/mine a recourse for a rts game?

    How to gather/mine a recourse for a rts game?

    Hey guys I am trying to make a rts game and I am having trouble with making my character mine a rock when right clicked on the rock while selecting the character. Now my character can be selected and moves around when i right click but I am so troubled on how to get him to mine the rock when I right click onto it. Ive looked at the rts community project for help and the blueprint for it is set out in a way I dont want it to go.
Working...
X