playMaker

Author Topic: Npc Jumping Agent  (Read 5894 times)

RICK

  • Playmaker Newbie
  • *
  • Posts: 39
Npc Jumping Agent
« on: October 17, 2019, 03:05:58 PM »
Hi

 I'm working on some Npc AI. I want my agent to jump across, up and down navmeshes. I currently use Unity personal version, so I don't have the off mesh
link function. On YouTube I found a video by Mdotstrange. He made a c# script that enables the agent to do this and provided a link to download the project.

I played around with it, controlling it with Playmaker. Has anyone seen this and used it in a project? It works but I have a problem after the first jump. The start
of the jump does not reset to its current jump, it always starts at the first jump.
For instance, if it makes 4 jumps, it will start at the first jump and follow the paths
through the other jumps to the last jump. I don't know how to script so I don't
Know how to fix it.

I contacted Mdotstrange about 5 weeks ago and he said he would make a playmaker action to fix the problem. About 4 weeks ago I sent him a link to
download my JumpingAgent project to look at, and asked him if he had any luck with fixing the script. I have not heard from him since then. I don't want to pester him about a free asset. It would be very useful if I could get it to work.


Thanks,

Rick C
 

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Npc Jumping Agent
« Reply #1 on: November 13, 2019, 03:03:10 AM »
Hi,

 can you send me the project you are testing withm and I'll see what I can do.

It's likely because you simply need to reset the start and end position before you jump or something like that.

 Bye,

 Jean

RICK

  • Playmaker Newbie
  • *
  • Posts: 39
Re: Npc Jumping Agent
« Reply #2 on: November 14, 2019, 09:04:17 AM »
Hello,

Thanks Jean, I would appreciate the help. I will send you a PM with a link to my
dropbox where you can get the project file.

Rick C

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Npc Jumping Agent
« Reply #3 on: November 21, 2019, 02:55:08 AM »
Hi,

 haven't forgot your case :) just lack of time, will check either tomorow or monday.

please bump if you haven't heard back from me on tuesday, ok?

Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Npc Jumping Agent
« Reply #4 on: November 27, 2019, 02:19:29 AM »
Hi,

 ok, I'll need direction, I got your project, but it's just too big... Which scene shall I open?

Bye,

 Jean

RICK

  • Playmaker Newbie
  • *
  • Posts: 39
Re: Npc Jumping Agent
« Reply #5 on: November 27, 2019, 03:30:44 PM »
Hi Jean,

I think I gave you the project. My computer crashed and I'm going to have to reload Windows and Unity.  I will get back to you tomorrow when I get everything straight.

Thanks,

Rick C

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Npc Jumping Agent
« Reply #6 on: December 02, 2019, 03:33:44 AM »
Hi,

The target for your jump is the capsule. how do you move this target for your next jump?

It would help if your scene was easier to play, right now the camera is not pointing to the player, and I don't have a x box controller, so I hacked around and I could play the jump, move the capsule and try to jump again, and I could see it was buggy, but wether it's buggy because of your logic or the logic inside the AgentJumpToTarget, I am not sure.

 Did mdotstrange provided some samples with this script that works across multiple jumps?

Bye,

 Jean

RICK

  • Playmaker Newbie
  • *
  • Posts: 39
Re: Npc Jumping Agent
« Reply #7 on: December 02, 2019, 02:31:07 PM »
Hi Jean,

Sorry, I should have used get mouse button down.  I use the scene view in play mode. After the first jump, I grab the target in the scene view and move it. The JumpingAgent game object is the original JumpingAgent that came with the project. I only added a Playmaker FSM to call the needed methods to make it work. As you can see in the FSM, it loops back to the start state after the jump is complete. For some reason after the first completed jump, all additional jump paths are stacked and the agent will follow all the paths. the only thing I did to the script was: 1  // delete the using.SirenX.Odin.. above if you don't have it and 2 delete the lines with [Button] . After the jump cycle I would think the next jump cycle calculations would start new calculations.

The Playmaker FSM I added to the Unreal Female Rigged Game Object has extra states that only controls the walking and jump animations. Walk animation stops when the agent gets to the edge and the walk animation will stop when it gets to the target. 

Thanks,

Rick C


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Npc Jumping Agent
« Reply #8 on: December 13, 2019, 07:38:34 AM »
Hi,

 Did you check if there was some samples for this system? I would contact the author again, I looked at the code, but it's very unclear to me where the problem could be, it could either be because you are missing something in the setup or a problem indeed in the script itself, but to make sure of that, I need a sample where it works ( or at least made by the author claiming it works)

Bye,

Jean

RICK

  • Playmaker Newbie
  • *
  • Posts: 39
Re: Npc Jumping Agent
« Reply #9 on: December 13, 2019, 08:51:07 AM »
Hi,

I had initial contact with Mdotstrange in September, he said he would make some playmaker action to fix the problem. After a couple of weeks, I sent a follow up email and didn't get a response. Here is the link where I got his project.

https://github.com/mdotstrange/MyUnityScripts/blob/master/JumpingAgent.unitypackage

Thanks,

Rick C
« Last Edit: December 16, 2019, 10:55:11 AM by RICK »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Npc Jumping Agent
« Reply #10 on: December 16, 2019, 02:49:25 AM »
Hi,

 does it features a working sample?

Bye,

 Jean

RICK

  • Playmaker Newbie
  • *
  • Posts: 39
Re: Npc Jumping Agent
« Reply #11 on: December 16, 2019, 10:27:29 AM »
Hi,

Mdotstrange used Odin- Inspector Serializer in his project which provided him a way to customize windows in the inspector. He had 2 buttons in the Agent Jump to Target script in the inspector window, Get Start Point And Move To Position and Perform Jump buttons. I didn't have that asset so I followed the instructions to remove certain lines of code, then I set up a Playmaker FSM to call the 2 methods to make it work.

Thanks,

Rick C

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Npc Jumping Agent
« Reply #12 on: December 17, 2019, 12:56:57 AM »
Hi

 But did you get a working sample at all?

Bye,

 Jean

RICK

  • Playmaker Newbie
  • *
  • Posts: 39
Re: Npc Jumping Agent
« Reply #13 on: December 17, 2019, 02:58:40 AM »
Hi,

When I first opened the project, there was no means for me to activate the JumpingAgent in play mode without the Odin Serializer asset, so per the instructions in the script, I deleted certain lines of code, then I set up a playmaker FSM to call the appropriate methods. It worked except for jumps after the initial jump.

Rick C

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Npc Jumping Agent
« Reply #14 on: December 17, 2019, 03:11:49 AM »
Hi,

 That's problematic, because we have no way to know if this system works to begin with...

I don't think it's wise to use this system.

could you not do it manually? you know the start and end of the offmesh link, you can then animate from start to end, and have a curve for the jump height.

I would cut this problem in two,

1: make a cube jump from A to B ( with different height between A and B)
2: use offmeshlink to get A and B and apply the jump made in 1.)


Bye,

 Jean