View unanswered posts | View active topics It is currently Sun Apr 28, 2024 11:38 am



Reply to topic  [ 4 posts ] 
 Ineffective checking and other questions 
Author Message
User avatar

Joined: Sat Feb 26, 2011 10:29 am
Posts: 163
Reply with quote
Post Ineffective checking and other questions
1.It works like: if A find target, A create B and attach it to the target. When B is created, it'll check the target, if find, check if there's already another B here, if yes then delete itself.
problem happened on "checking if there's already another B", it didn't work, so if there're two B attach at the same target, the target'll die immediately if it lose health(even if losing only 1 point).

can anyone tell why or fix it for me?

2.What's the difference between NormalRand, PosRand, RangeRand, SelectRand and math.random?


Attachments:
NanoR.lua.rar [951 Bytes]
Downloaded 128 times
Thu May 26, 2011 6:32 pm
Profile

Joined: Fri Feb 25, 2011 3:52 pm
Posts: 39
Reply with quote
Post Re: Ineffective checking and other questions
PosRand returns a vector, afaik.

try to store B's parent's id in B's sharpness (update function), and check it on B's create function
like:
if drug.Sharpness == self.target.ID then
self.ToDelete = true
end


Fri May 27, 2011 3:26 pm
Profile
User avatar

Joined: Sat Feb 26, 2011 10:29 am
Posts: 163
Reply with quote
Post Re: Ineffective checking and other questions
I've already used sharpness to judge the target team, and, it might not work because there're not only a single A spawned by the gun. Thanks, though.

I might not be able to draw you a better picture of the situation, so:
Attachment:
X-Region.rte0.751.rar [854.46 KiB]
Downloaded 155 times

It's the second mode of X-Puncturer. I wanna make it judge target's team then attach to it. For teammate: lock health, return 75% of the damage taken after duration. For enemy: take double damage, can't be healed, bonus damage depend on target's traveling distance & speed. If two or more "B" working on one enemy, even just a tiny damage will be doubled again and again, and the target soon dead.


Sat May 28, 2011 8:12 am
Profile
User avatar

Joined: Sat Feb 26, 2011 10:29 am
Posts: 163
Reply with quote
Post Re: Ineffective checking and other questions
New problem. I added the 3rd shoot mode of the X-Sniper gun, make the bullet check if there's another from the same gun on the map when created. If so, the old one will be gibbed.

But the code seems not work. I do think this' the same problem as the one in OP.
Attachment:
X-Region.rte0.789.rar [874.13 KiB]
Downloaded 232 times


Mon Jun 06, 2011 8:25 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.090s | 18 Queries | GZIP : Off ]