Data Realms Fan Forums
http://45.55.195.193/

Ineffective checking and other questions
http://45.55.195.193/viewtopic.php?f=73&t=23983
Page 1 of 1

Author:  Xery [ Thu May 26, 2011 6:32 pm ]
Post subject:  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 137 times

Author:  zoidberg [ Fri May 27, 2011 3:26 pm ]
Post subject:  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

Author:  Xery [ Sat May 28, 2011 8:12 am ]
Post subject:  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 165 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.

Author:  Xery [ Mon Jun 06, 2011 8:25 am ]
Post subject:  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 247 times

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/