Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, VoroneTZ), 831 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
First Person Shooter Shoot System #474913
11/12/18 17:38
11/12/18 17:38
Joined: Nov 2018
Posts: 1
G
gokhanuck Offline OP
Guest
gokhanuck  Offline OP
Guest
G

Joined: Nov 2018
Posts: 1
Hi Guys,

I just join the coummunity and started to work on a project trying to create a simple Fps shooter game demo. I created fps style character and added all the movement system succesfully im working on littlecity map. I was looked and worked but coundt find a way to attack like Fps game style. I added a crosshair middle of the screen thats all.

Also created an attack method but its not working.. Map slide and character dissappering when i try to implement workshop 24 basic shooter wizard attack system to me. There is my codes:


In player action function:

if(mouse_left )
{

fps_camera();

ent_create("spell.dds",vector(my.x+40,my.y,my.z+20),spell_fly);
ent_animate(me, "attack", my.skill12, ANM_CYCLE);
}


And this is my spell_fly function:

action spell_fly()
{
my.ambient = 50; // medium bright
my.lightrange = 300; // activate dynamic light
set(me,BRIGHT); // additive blending
vec_scale(my.scale_x,0.15); // small size
my.STATE = 1;

while(1)
{
// state 1: flying ///////////////////////////////////////////
if (my.STATE == 1)
{
my.roll += 20*time_step;
c_move(me,vector(40*time_step,0,0),NULL,IGNORE_YOU);
if (HIT_TARGET) // collided?
my.STATE = 2; // go to next state

}

// state 2: exploding ////////////////////////////////////////
if (my.STATE == 2)
{
// appear in front of close objects
my.roll = random(360);
my.lightrange *= 1+0.5*time_step; // increase light range
vec_scale(my.scale_x,1+0.5*time_step); // inflate size
if (my.scale_x > 1) { // explosion finished?
ent_remove(me);
return;
}
}

wait(1);
}
}


How can i fix this problem = how can i use fps style shooting system?

Best Regards..

Last edited by gokhanuck; 11/12/18 19:55.
Re: First Person Shooter Shoot System [Re: gokhanuck] #474917
11/13/18 09:56
11/13/18 09:56
Joined: Oct 2008
Posts: 679
Germany
Ayumi Offline
User
Ayumi  Offline
User

Joined: Oct 2008
Posts: 679
Germany
You should use an Event, not states for flying objects. (EVENT_ENTITY)


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1