Page 1 of 1

new entity suggestion: firing guns

Posted: Thu Oct 23, 2014 2:29 pm
by Broken
This may be a bit difficult to implement, idk, but you could make a ton of cool parts with it.

A weapon firing entity, that fires at a given angle and timing. For grenades, you could specify the speed as well.

So like a "turret" entity that simply fires grenades. Example idea: you have to use several of them to jump obstacles

The idea then is not giving the player the weapon to use anywhere, but forcing them to use these instead.

Re: new entity suggestion: firing guns

Posted: Thu Oct 23, 2014 3:45 pm
by Cyberpunk
Very good idea. And to trigger one of them you can shoot a button with your pistol. That is probably impossible to implement but your idea isnt I am sure.

Re: new entity suggestion: firing guns

Posted: Sat Oct 25, 2014 2:16 pm
by timakro
nothing of that is impossible to implement. but cyberpunks idea is weired. i like brokens idea. if nobody wants to implement it i would give it a try when im back home. but i cant promise anything.

Re: new entity suggestion: firing guns

Posted: Sat Oct 25, 2014 2:40 pm
by deen
Go ahead, DoNe. I think it's fine, but don't want to implement it.

Re: new entity suggestion: firing guns

Posted: Thu Oct 30, 2014 12:30 am
by timakro
It's done. Get source to test here: https://github.com/timgame/ddnet

Re: new entity suggestion: firing guns

Posted: Thu Oct 30, 2014 1:44 pm
by Broken
Awesome love it !!!

Re: new entity suggestion: firing guns

Posted: Sat Nov 08, 2014 9:39 am
by timakro
Because of a dump mistake i made there is a big bug. I don't have much time and motivation to fix it. Maybe I will fix it in the future.

Re: new entity suggestion: firing guns

Posted: Sat Nov 08, 2014 12:22 pm
by Broken
Ok thanks for trying anyway

Re: new entity suggestion: firing guns

Posted: Wed Nov 12, 2014 7:50 pm
by timakro
Autofire should be a mapping tile that spawns a grenade, rifle or shotgun every x seconds in an angle of 45*y degrees. The tiles are in switch layer. The tileflags of the switchlayer are Number = x and Delay = y. The index are 226 = shotgun, 227 = grenade and 338 = rifle.

If somebody is interested in fixing this feature I give some information here. The newest code can be found at https://github.com/timgame/ddnet. The code in entities/autofire.cpp in CAutofire::Tick() in the condition "if (m_Time >= m_Delay) {" will be executed when a projectile/laser has to be spawned. I created a switch for the different weapon types. Everything that happens before the spawning of the projectiles and lasers works fine. You don't have to care about that. The problem is that im spawning one projectile for all teams at the moment. For example if a player in team 0 stops a projectile it will also be stopped for the player in team 5. I modified some code in laser.cpp and projectile.cpp to make this happen when i create a laser/projectile for the clientID -1. To fix this bug a projectile/laser for every team would be necessary. I found no solution because CLaser and CProjectile are made for a clientID and not for a teammask. I tried to modify it and make it work for teammasks but thats really a pain. Especially the projectile.cpp contains really ugly code in my opinion. I would be very interested in the solution if anybody can find one. If you have questions about my code add me in skype: "bschutim".