Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by 7th_zorro. 04/20/24 07:29
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, henrybane, flink, Edgar_Herrera), 758 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 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: 681
Germany
Ayumi Offline
User
Ayumi  Offline
User

Joined: Oct 2008
Posts: 681
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