Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Sentry Gun system

behroz-khan
Registered User
Quote
2018-08-17 12:03:32

I wanna make a game in wich there would be some sentry guns on walls or ceilings. So how to do that?
When we come closer to it they rotate toward us and start shooting us.
And when we get far from it they will get to their previous position and stop shooting us.

Is it possible without script? If no please give me the script.

And as always:
Thanks in advance...


behroz-khan
Registered User
Quote
2018-08-19 07:11:23

No one answering the most awesome question... Why???


faith_254
Registered User
Quote
2018-08-20 08:14:23

you would want to make it so that the sentry would start attacking in a radious
like when active camera in proximity, shoot, then add bullets, and also add aditional rotation so it looks at you before shooting
no script needed
also it would be cool if you could destroy the sentries, give them game actor and health


behroz-khan
Registered User
Quote
2018-08-20 08:35:39

wrote:
you would want to make it so that the sentry would start attacking in a radious
like when active camera in proximity, shoot, then add bullets, and also add aditional rotation so it looks at you before shooting
no script needed
also it would be cool if you could destroy the sentries, give them game actor and health

I am doing so... But you said that on proximity shoot bullets, it's awesome but how to start rotating sentry guns if he player is in a greater radius than shooting radius....
I hope you understood.


faith_254
Registered User
Quote
2018-08-20 10:15:56

you want to add this code to it on proximity
var Player = ccbGetSceneNodeFromName("MainCharacter");

var Enemy = ccbGetSceneNodeFromName("enemy");

var PositionOfPlayer = ccbGetSceneNodeProperty(Player, "Position");

ccbAICommand(Enemy, "moveto", PositionOfPlayer);

and if you want it to shoot out of radius
assign your player a tag
in the game actor behavior
then go to the game actor behavior on the sentry and set attack tags
to player tags
then copy on proximity shoot behaviors to the activation attack


faith_254
Registered User
Quote
2018-08-20 10:34:34

btw the code is for rotation to player
you can add it to tags attack to


behroz-khan
Registered User
Quote
2018-08-20 14:18:02

On proximity execute javascript and then paste this code? That's it???


just_in_case
Moderator
Quote
2018-08-20 20:10:06

If you want the guns to shoot at you... Simply use the game Ai and health behaviour aatched to the guns... And change the value of move speed to 0 so that they won't move at all.... Rest of all is done automatically.. When the player gets into its activation radius...

Or you can use a proximity behavior... And then script the guns to rotate towards player on proximity and perform the shoot action.... By using...
Ccbaicommand for shoot..

No need to get positon of player and move to player position... As sentry guns or mounted guns are fixed and cant be moved they can only be rotated....hence no need to use position of player...


faith_254
Registered User
Quote
2018-08-20 23:10:20

thats what i meant btw they wont move to you if the movement is reset every few seconds


faith_254
Registered User
Quote
2018-08-20 23:27:36

also can i plz have the object/ prefab your using as the sentry


behroz-khan
Guest
Quote
2018-08-24 20:49:34

I dont really have a prefab for sentry gun, i will download it.
but how to rotate the sentry gun to player, please give me the code for it.


behroz-khan
Registered User
Quote
2018-08-27 18:04:01

behroz-khan wrote:
I dont really have a prefab for sentry gun, i will download it.
but how to rotate the sentry gun to player, please give me the code for it.

No one answering... why???


behroz-khan
Guest
Quote
2018-08-29 09:48:19

wrote:
behroz-khan wrote:
I dont really have a prefab for sentry gun, i will download it.
but how to rotate the sentry gun to player, please give me the code for it.

No one answering... why???

No answer yet..


just_in_case
Moderator
Quote
2018-08-29 11:54:25

Had already answered to your question, but if you want that other people will do the hard work for you like scripting or provide you with a cooked and backed source file for the thing you want.... You can hire some freelancer to do the job for you... We can only tell you the recipe... We can't serve you the cooked food...

If you found this thing difficult you can pay some amount to other user or to me to develop this thing for you..


behroz-khan
Registered User
Quote
2018-08-29 22:12:22

I am not into programming (I hate it) so I don't want to program so I just want you to give me the simplest code to rotate the sentry gun towards player....

Please???


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internation?l" (you are not logged in)


Text:

 

  

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


   






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