ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Help with CopperCube
forum topic indicator Magazine and ammo workout
person icon
Monks
Guest
Quote
2024-08-10 16:53:58

To sven, vp, okeoke and all other members,can someone please help me in making a magazine and ammo system either by an extension or use of variables and values

person icon
Monks
Guest
Quote
2024-08-10 16:55:27

Secondly, can someone help me in applying wall run and sliding along slopes to my fps camera

person icon
okeoke
Registered User
Quote
2024-08-10 18:18:43

I've made a code along video on that https://m.youtube.com/watch?v=yZGsagRd78Q&pp=ygUWTWFjaGluZSBndW4gY29wcGVyY3ViZQ%3D%3D.

If you don't want to watch the whole thing, there is demo scene link in the description. You can get the extension from it.

person icon
Monks
Guest
Quote
2024-08-10 20:00:00

Thanks okeoke, so what about the wall run and slide thing can you do that too or you would need some time

person icon
okeoke
Registered User
Quote
2024-08-10 23:07:28

I have no idea how to make wall walk.

I would probably start with implementing custom jump mechanics, so I can control how player node is controlled by gravity independently from other nodes. Than detect if there are any walls around using raycasting, and disable/lower the gravity. You can also introduce some stamina value or something similar, so the value lowers while player is in "wall walk" state, and if it runs down to 0 - apply full gravity.

For slides something like that can do:
// The following embedded xml is for the editor and describes how the behavior can be edited:
// Supported types are: int, float, string, bool, color, vect3d, scenenode, texture, action
/*
<behavior jsname="behavior_SlideTest" description="Slide test">
</behavior>
*/

var behavior_SlideTest = function () {
this.lastTime = null;
this.isSliding = false;

this.slideCoolDownTime = Date.now();
this.slideEndTime = null;
this.slideDirection = null;

this.slideSpeed = 0.3;

// Child node 1 unit forward on z axis, i.e. (0, 0, 1);
// Used to define slide direction based on current direction
this.forwardVecNode = ccbGetSceneNodeFromName('player__forward_vec');
};

behavior_SlideTest.prototype.onAnimate = function (node, timeMs) {
if (!this.lastTime) {
this.lastTime = timeMs;
this.node = node;
return false;
}

var delta = timeMs - this.lastTime;
this.lastTime = timeMs;
if (delta > 200) delta = 200;

var now = Date.now();

if (this.isSliding ) {
// if sliding update x and z position
// it's also required to update camera target position on the same value
if (now < this.slideEndTime) {
var pos = ccbGetSceneNodeProperty(node, 'Position');
var tarPos = ccbGetSceneNodeProperty(node, 'Target');
var dx = this.slideSpeed * delta * this.slideDirection.x;
var dz = this.slideSpeed * delta * this.slideDirection.z;
pos.x += dx;
pos.z += dz;
tarPos.x += dx;
tarPos.z += dz;
ccbSetSceneNodeProperty(node, 'Position', pos);
ccbSetSceneNodeProperty(node, 'Target', tarPos);
} else {
this.isSliding = false;
}
}
}

behavior_SlideTest.prototype.onKeyEvent = function(key, pressed) {
if (pressed && key === 162) {
var now = Date.now();
if (now >= this.slideCoolDownTime) {
this.slideCoolDownTime = now + 550;
this.slideEndTime = now + 500;
this.isSliding = true;

var forwardVecNodePos = ccbGetSceneNodeProperty(this.forwardVecNode, 'PositionAbs');
var playerPos = ccbGetSceneNodeProperty(this.node, 'Position');

this.slideDirection = forwardVecNodePos.substract(playerPos);
}
}
}

// 3, 2
behavior_SlideTest.prototype.onMouseEvent = function (event) {

}

project:https://drive.google.com/file/d/...
If you also want crouch at the same time, try searching the forum. It is apparently also an issue to implement crouching properly in coppercube, but I believe, there is an extension which does it more or less ok. You can get logic from it and combine with the code above.

person icon
Guest
Guest
Quote
2024-08-11 04:35:32

@okeoke

Why post a behavior that accepts no parameters? You cray cray, son?

This is not effective problem solving. Stop it.

You are doing yourself a disservice. You're too handy in the wrong way. It comes off as needy.

Do better.

If you want to make a real game, let us know...

Don't be a weirdo, otherwise.

emoji icon_blink

person icon
okeoke
Registered User
Quote
2024-08-11 05:53:45

Lol. How your mario project goes?

person icon
Monks
Guest
Quote
2024-08-13 02:48:50

Thanks again, so okeoke, whats your source of zombie models used in your zombie shooter game

person icon
okeoke
Registered User
Quote
2024-08-13 07:25:31

It's one fps creator packs. I don't think it is being sold separately nowadays. I got them along with gameguru.

person icon
Monks
Guest
Quote
2024-08-14 03:39:45

Some few questions more,
1 how do I vary blur intensity post processing with is
2 how to clone an arrow in an obstacle when I shoot an arrow into it
3 how do I get .X files which do not work in cc6 working

person icon
okeoke
Registered User
Quote
2024-08-14 07:27:50

1. Set scene root scene properties "Blur", "Blur_Iterations", check api reference for details
3. Download free version of fragmotion, import .x file, and resave it. Then import as usual

person icon
Monks
Guest
Quote
2024-08-15 01:00:36

Thanks a lot okeoke you are one of the guys who keep me still using copper cube


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 |