ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Programming and Scripting
forum topic indicator How to make an asset more like the Player?
person icon
luposian
Registered User
Quote
2023-09-03 01:10:01

My character has a collision sphere, which rolls across the terrain. But the Clerk asset doesn't seem to. If I set him to look level with the ground, when I set him to walking (patrol), he stays at the same level and will either be higher than the terrain (floating) or lower than the terrain (sinking) in different areas. He doen't collide with anything and doesn't travel along the terrain as a normal. I've simply made him stationary, presently. But he's still not solid. I can walk right through him (or he through me). When I imported an actual .fbx image, it was solid.

I'm presently working on Stage 2 of my game.

person icon
sven
Registered User
Quote
2023-09-03 12:56:30

I recommend you to read coppercube manual..
Coppercube has probably best manual i have seen on any game engine.. its simple and straight to the point and with examples.


If you klick on your character then look behavior tab and you see how it has collision sphere added
[CollideWhenMoved]

Now klick clerk and you see its empty.. now press + and you get options to add behaviors.

To make them collide with each other -its advanced topic.


Clerk is just a animated 3d model in this case..
But with actions and behaviors you can make it to be whatever you want.

person icon
luposian
Registered User
Quote
2023-09-04 00:31:33

wrote:
I recommend you to read coppercube manual..
Coppercube has probably best manual i have seen on any game engine.. its simple and straight to the point and with examples.


If you klick on your character then look behavior tab and you see how it has collision sphere added
[CollideWhenMoved]

Now klick clerk and you see its empty.. now press + and you get options to add behaviors.

To make them collide with each other -its advanced topic.


Clerk is just a animated 3d model in this case..
But with actions and behaviors you can make it to be whatever you want.

Ok, I didn't realize one of the options was for creating a collision sphere around the asset character.

However, I've noticed something really weird. After a few saves, the Clerk totally disappears and can no longer be made visible, even though "visible" is checked. He shows up on the .ccb, but no longer has his collision sphere. It's like something breaks and it makes me question whether or not more than just him is affected. I literally went back to a much earlier .ccb build, to get back to something I knew (or at least figured) still worked.

Any idea what would cause this type of corruption/breakage? Seems nothing I do can fix it, when it happens. I could try to reboot my computer and see if that would solve the problem.

person icon
luposian
Registered User
Quote
2023-09-04 00:55:30

Sure enough, this is a repeatable issue. It just happened again, after about 6 saves, he's no longer visible and the .ccb only shows him and not his collision sphere.

I was able to "restore him", by deleting him and then reinserting him (and then I have to redo all the collision sphere things and whatnot). But any idea why the corruption occurs in the first place?

person icon
loop-poser
Guest
Quote
2023-09-04 07:19:27

Have you tried running System Care Free (iobit) on your system? Have you made sure Windows is happy (Windows will ruin your life, if it wants to do an update and you refuse to)? Made sure you have the latest drivers for your video card? Or did you make any changes since the last time you played the previous version? Try running the previous version and see if it still runs ok. If it doesn't, then you know its something in your system. If it does, then it's something with the game or some small glitch or something.

person icon
luposian
Registered User
Quote
2023-09-04 08:02:18

loop-poser wrote:
Have you tried running System Care Free (iobit) on your system? Have you made sure Windows is happy (Windows will ruin your life, if it wants to do an update and you refuse to)? Made sure you have the latest drivers for your video card? Or did you make any changes since the last time you played the previous version? Try running the previous version and see if it still runs ok. If it doesn't, then you know its something in your system. If it does, then it's something with the game or some small glitch or something.

AHAHAHAHA! NOT!

Thankfully, if no other answer is forthcoming, I have at least found a "fix" that works. And I'll just need to make sure I don't mess with the clerk any more than absolutely necessary, to prevent it from happening again, if possible.

person icon
luposian
Registered User
Quote
2023-09-04 08:16:45

However, I'm trying to figure out how to get him to stop moving and just stand there, once I've enter his proximity. He's classified as a "Game Actor with Health", and he walks around in a patrol pattern and I've got it to where he changes his animation to Standing, but he keeps moving, so he's essentially floating forward in a standing pose. How do I change his inital "Game Actor" state? Would I override it by doing a "Do something later" and call that same behavior with different parameters?

person icon
sven
Registered User
Quote
2023-09-04 10:16:21

I wouldnt leave buggy component into a project..
Must make sure what makes bug happen.

Game actor has options:
RandomlyPatrol
StandStill
ThisIsPlayer
(Its patrol by default)

To make AI its best to use custom script than built in AI..
(Depends on your needs oc)

On my itch page there are action scripts to build AI that needs some understanding of logic but result is better than built in one.
Also there are many AI scripts by many users that does very good job.


To check bug.. make new project and add clerk and behavior.. check is bug still there - if not then bug is project specific and somewhere in your project is a bug that needs to be find.. sometimes some script errors can make these bugs but without saying anything about the errors.

person icon
luposian
Registered User
Quote
2023-09-04 10:42:42

wrote:
I wouldnt leave buggy component into a project..
Must make sure what makes bug happen.

Game actor has options:
RandomlyPatrol
StandStill
ThisIsPlayer
(Its patrol by default)

To make AI its best to use custom script than built in AI..
(Depends on your needs oc)

On my itch page there are action scripts to build AI that needs some understanding of logic but result is better than built in one.
Also there are many AI scripts by many users that does very good job.


To check bug.. make new project and add clerk and behavior.. check is bug still there - if not then bug is project specific and somewhere in your project is a bug that needs to be find.. sometimes some script errors can make these bugs but without saying anything about the errors.

I don't need AI. The clerk doesn't need to follow the player or anything. I just want him to walk around until I walk up to him (proximity) and then he stops and says something and then fades away.

I want him to be a little more "real" than just standing there the entire time, like a statue/mannequin. But, if push comes to shove, I'll compromise. It won't be as nice as the end part of Stage 1, but... I'll make it work. emoji icon_grin

person icon
sven
Registered User
Quote
2023-09-04 11:04:44

One option is just switch one clerk to another..
If on proximity.. set ai that walks invisible and place another standing ai into his position and make him visible.

To make it more real create path where ai walks..not just random.

I am not used built in ai alot but maybe stopAi command will also stop him walking on path..( year ago i tested then ai kept doing his stuff so i made my own AI )
Or maybe path can be deleted and AI stops by this way..(may result error)

There is many ways so probably you will find a way to make it work for sure.

person icon
luposian
Registered User
Quote
2023-09-04 21:24:53

wrote:
One option is just switch one clerk to another..
If on proximity.. set ai that walks invisible and place another standing ai into his position and make him visible.

I'm having trouble visualizing how you mean this. I can create a clerk that is stationary (standing, not moving) and I can create a clerk that walks around (in either case, either will be visible once another condition is met). But how do I make the moving one stop moving, period, once I touch him? I have no idea where he will be when I go up to him, so how can I position the stationary one exactly where the moving one was, once I've touched him (proximity)?

I know I'd destroy the moving one (node), but how to get the stationary one exactly where the moving one was at that exact moment? If there was a way to change the behavior of the moving one at that exact moment, that would work great, but I don't see how or I can't visualize how I'd do that.

person icon
Dieter
Guest
Quote
2023-09-04 22:36:30

I was trying to use the CC path tools, but quickly decided to write my own path code.

What I do is I walk around in the level, and I record my position and my Yaw / Y angle every second, write it to an array. Then I save that array to a file. Then the game can load this list of positions and angles, an make an NPC follow it.

I then recognize idle states by same repeated positions, can switch the animation between walk and idle.
I particularly like idle animations where the soldier checks his fingernails and hums a melody ^^

Implementation is relatively simple, just move the NPC towards the next waypoint, by delta*walkspeed. Recognize when he has past by a point and move him to the next one, or rather increase the index of the point he should head towards.

Slightly more complicated is to make him leave his track for some reason, and then later find it again. But it's doable. Each NPC has his own track, or could have multiple ones that share a start point, and could be choosen randomly.

This looks as organic, as I was walking around in the level.

person icon
luposian
Registered User
Quote
2023-09-04 23:36:29

Dieter wrote:
I was trying to use the CC path tools, but quickly decided to write my own path code.

What I do is I walk around in the level, and I record my position and my Yaw / Y angle every second, write it to an array. Then I save that array to a file. Then the game can load this list of positions and angles, an make an NPC follow it.

I then recognize idle states by same repeated positions, can switch the animation between walk and idle.
I particularly like idle animations where the soldier checks his fingernails and hums a melody ^^

Implementation is relatively simple, just move the NPC towards the next waypoint, by delta*walkspeed. Recognize when he has past by a point and move him to the next one, or rather increase the index of the point he should head towards.

Slightly more complicated is to make him leave his track for some reason, and then later find it again. But it's doable. Each NPC has his own track, or could have multiple ones that share a start point, and could be choosen randomly.

This looks as organic, as I was walking around in the level.

So, literally, there is no way to simply turn off/change the animation of the "Game Actor with Health" at a specific instance? No way to simply change animation from "patrol" to "stand" once I've touched him via proximity? I can make him visible when a certain condition is met, but I can't seem to make him just stop moving. That's the frustrating part. Of course a bit of story change would make it easy. I'm trying to match the storyline I've written, rather than having to change the storyline to meet software conditions I probably can't (at least easily) get around.

Is there a "patrol until" option? emoji icon_grin

person icon
VP
Guest
Quote
2023-09-05 08:40:15

Why do you ignore people's solutions and then ask the same questions over and over again?

Of course node-movement can be controlled using CopperCube/Javascript.There are several ways to stop movement of a character.

1- two have been suggested for you already - use the specific A.i. commands to directly dictate behaviour of the actor-node, or...2- swap the moving character with a static one or a billboard, on proximity. Both of these are solid/simple solutions.

For some reason, you said "I don;t need A.i." (although changing the built-in A.i. settings is probably the simplest way to directly access the actor behaviour for animation and movement) - but if you're adamant that you don't want to use the simple built-in A.i. commands/options, there are other ways to control node movement....

3- Read the manual - specifically look at the "special variables", you can set movement speed to zero and set animation to standing/idle (this is the manual equivalent of setting the movement speed in the actor-behaviour settings).

4- You could use "Every Few Seconds" (30ms)> "set absolute position" of Character-Node and "Set animation" to Standing/Idle.

5- or Use 'activation radius' in the game-actor behaviour settings (or on enter spherical proximity), on activation>do something (ie. set movement speed to zero or set absolute position).

6- or Place a static "collision cage" (inverted cube scale= (X-1, Y1,Z1) - with "collision check-box enabled") over your character's "collide when moved" ellipsoid, to restrain all movement.

7- or use a 'stopper': (any collision enabled-node) dynamically 'childed' to the character-node and positioned in such a way as to interfere with the terrain and prevent movement (then delete it to allow movement again) - you can child it with 2 lines of code form the online API guide.

8- You can dynamically adjust special variable for an individual node's small-collision-distance), using a single command to force a node to collide with the terrain.

9- A more professional approach is to use "switch-scene" to swap to a pre-defined "cut-scene" with "follow path" for camera and character animations to dictate actor movement - triggered by "on-proximity".

10- Use a video animation or a sprite animation to play a pre-rendered filmatic sequence, this would be better used for events that can't easily be achieved using the game engine - such as luposian morphing into a human or detailed fur blowing in the wind etc.

11- Use the "Search" button on the forum and type to find the answers already provided in this post. A quick search of "movement" pulled up special variable movement speed.

12- Download any of the demos/tutorial ccb files from itch.io (and other sources) and delve into script/non-code solutions that others have already generously provided.

You can use on activation/on proximity and variables to control the timing of the aforementioned events. There are also several other ways to stop character movement; you just need to read and think for a while; take on-board what people have already suggested as a first solution.

person icon
Dieter
Guest
Quote
2023-09-05 18:17:31

So, literally, there is no way to simply turn off/change the animation of the "Game Actor with Health" at a specific instance? No way to simply change animation from "patrol" to "stand" once I've touched him via proximity?

I didn't say that.
For me it was just easier to pprt my existing npc system to JS than to learn CC Ai NPC control.
That spares me from having to do a documentation investigation, each time I want to change something. That said, you get a lot of answers, where I often just got crickets, which was also why I write my own "Ai" etc.

But my approach here, for NPC path patrol, is an entirely different one. It allows however to pause patroling, simply by knowing a bit of javascript.


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |