English Turret types ?

9 replies
Goto Page
To the start Previous 1 Next To the start
20.10.13 10:35:45 pm
Up
Rainoth
Moderator
Offline Off
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
Code:
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.
20.10.13 10:41:55 pm
Up
Infinite Rain
Reviewer
Offline Off
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.
A thousand may fall at your side, ten thousand at your right hand, but it will not come near you. You will only look with your eyes and see the recompense of the wicked. - Psalm 91:7-8 ESV
21.10.13 04:49:51 am
Up
omg
User
Offline Off
theres no -easy- solution. turret bullets are all the same
will code for food
23.10.13 11:13:40 pm
Up
EP
User
Offline Off
i liek pie
23.10.13 11:14:23 pm
Up
Rainoth
Moderator
Offline Off
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.
23.10.13 11:23:39 pm
Up
MikuAuahDark
User
Offline Off
Code:
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
file cs2d LuaJIT for Dedicated Server (11) JIT POWER! | Know your Lua errors! | Draw stuff at Pixelize Art --xx-- server!
24.10.13 12:52:09 am
Up
EP
User
Offline Off
@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
24.10.13 12:54:44 pm
Up
Pagyra
User
Offline Off
http://www.unrealsoftware.de/forum_posts.php?post=327522&start=720#post363338
and check it for
object(i,"countdown") == -50 and object(i,"upgrade")
24.10.13 02:52:46 pm
Up
Rainoth
Moderator
Offline Off
@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)
24.10.13 03:38:26 pm
Up
Pagyra
User
Offline Off
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