Forum

> > CS2D > Scripts > Turret types ?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Turret types ?

9 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Turret types ?

Rainoth
Moderator Off Offline

Zitieren
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.

alt Re: Turret types ?

Infinite Rain
Reviewer Off Offline

Zitieren
cs2d.com hat geschrieben
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.

alt Re: Turret types ?

Rainoth
Moderator Off Offline

Zitieren
user omg hat geschrieben
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.

alt Re: Turret types ?

MikuAuahDark
User Off Offline

Zitieren
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

alt Re: Turret types ?

EP
User Off Offline

Zitieren
@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

alt Re: Turret types ?

Rainoth
Moderator Off Offline

Zitieren
@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)

alt Re: Turret types ?

Pagyra
User Off Offline

Zitieren
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 >
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht