Forum

> > CS2D > Scripts > Turret types ?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Turret types ?

9 replies
To the start Previous 1 Next To the start

old Turret types ?

Rainoth
Moderator Off Offline

Quote
Hello, fellow unrealsoftware users. I'd like to ask if anyone knows or knows how to get turrets types ids or whatever that actually distincts them.

The problem I'm facing is that since turrets don't always work, I decided that I would create a system that would replace the non-working one. I also need it for a mod I'm making. Anyways, the issue is : I tried to use hit hook and get information about them so I could later check
if weapon == 253 then

however the results for
Single,Double,Triple Turrets were
Source : 0
Weapon : 253
so I don't know what else I could use to check if it's a certain type of turret that hit me.

If any of you know a solution to my problem, I'd be very thankful if you could post it here.

old Re: Turret types ?

Infinite Rain
Reviewer Off Offline

Quote
cs2d.com has written
weapon: weapon type / source type id

If im not mistaking, that 253 is actually the type id of a turret, so you can do this:
object(weapon, 'type') to get the type of the building.
Edit: OH nvm, it actually the type of the bullet, my bad.

old Re: Turret types ?

omg
User Off Offline

Quote
theres no -easy- solution. turret bullets are all the same

old Re: Turret types ?

Rainoth
Moderator Off Offline

Quote
user omg has written
theres no -easy- solution. turret bullets are all the same


I don't need an easy solution. I need a solution. Any kind of solution.

old Re: Turret types ?

MikuAuahDark
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
-- Just place it at where your script triggers. Edit if necessary
-- variable "id" already defined here. so for example it's already on hit hook
for _,o in pairs(object(0,"table")) do
	local t=object(o,"type")
	if t==8 or t==11 or t==12 then
		if object(o,"target")==id then
			-- It's shooting to player
		end
	end
end
Idunno if it works

old Re: Turret types ?

EP
User Off Offline

Quote
@user MikuAuahDark: the target does not mean the turret/object is shooting at the player, an object can be targetting the last target even if he's not around there

old Re: Turret types ?

Rainoth
Moderator Off Offline

Quote
@user Pagyra: If I do it without object countdown the single turret is fine but double spams me "turret1"+"turret2"/-_- +"turret3"

and if I use cooldown, it doesn't work at all. I tried with -50 and it didn't work. I tried with 50,500,-50 too and it didn't work at all (no messages)

old Re: Turret types ?

Pagyra
User Off Offline

Quote
You are lazy and do not want to search solve for your problem.
Try check object values when turret shoot at you or somethin else...

all turret shoots 4 bullets (hits 4 times)
countdown of 1 bullet(hit) = 15
countdown of 2 bullet(hit) = 14
countdown of 3 bullet(hit) = 13
countdown of 4 bullet(hit) = 12
so check :
object(i,"countdown") == 15

final code
Spoiler >
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview