Forum

> > CS2D > Scripts > Strider lua [EntityList()]
Forums overviewCS2D overview Scripts overviewLog in to reply

English Strider lua [EntityList()]

6 replies
To the start Previous 1 Next To the start

old Strider lua [EntityList()]

kalis
User Off Offline

Quote
hey all!
I want to know :
+How to change map("xsize") , map("ysize") to orther value !
1
2
3
4
5
6
7
8
9
10
11
for x = 20, 
function EntityList()
	for x = 1, map("xsize") do
		for y = 1, map("ysize") do
			if entity(x,y,"exists") then
				table.insert(EntityTable,{x = (x*32)+16,y = (y*32)+16})
			end
		end
	end
end
EntityList()
example :
i had local x2,y2
1
2
x2 = my value "x" in map
	  y2 = my value "y" in map
here : about size of "x" and "y"
v[1][1],v[2][1] in config ! like tibia lua
1
if (x2 >= v[1][1] and x2 <= v[2][1] and y2 >= v[1][2] and y2 <= v[2][2]) then
help me ?

old Re: Strider lua [EntityList()]

DannyDeth
User Off Offline

Quote
Quote
How to change map("xsize") , map("ysize") to orther value !

Re-write the map function. DUH.
1
2
3
4
oldmapfunc = map
map = function(arg)
	--ur code here
end

old Re: Strider lua [EntityList()]

kalis
User Off Offline

Quote
@danny deth <thank you>
hey all!
i get more a error :

+my code after edit in strider.lua (i wont post this lua)
+I knew , the error in local angle (after else)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
if not tile(tilex, tiley, 'wall') and Strider[str].ent > 0 and math.sqrt((Strider[str].x-EntityTable[Strider[str].ent].x)^2 + (Strider[str].y-EntityTable[Strider[str].ent].y)^2) > 20 then
                              local angle = -math.atan2(Strider[str].x-EntityTable[Strider[str].ent].x,Strider[str].y-EntityTable[Strider[str].ent].y)     
                              walk_rots = {10,-10}     
                              Strider[str].x = Strider[str].x + math.sin(angle) + (math.random(-1,1)*32+16)/8
                              Strider[str].y = Strider[str].y - math.cos(angle) + (math.random(-1,1)*32+16)/8
                              if time == 4 then Strider[str].rot = 90 + math.random(1,360) end
                              if time == 14 then Strider[str].turot = (Strider[str].turot - 10)*(math.pi*10) end
                              imagepos(Strider[str].img,Strider[str].x,Strider[str].y,Strider[str].turot)
    
                         else

this local give me error-->   local angle = -math.atan2(Strider[str].x-EntityTable[Strider[str].ent].x,Strider[str].y-EntityTable[Strider[str].ent].y)     
                              walk_rots = {10,-10}          
                              Strider[str].x = Strider[str].x + math.sin(angle) - (math.random(-1,1)*32-16)/28
                              Strider[str].y = Strider[str].y + math.cos(angle) - (math.random(-1,1)*32-16)/28
                              imagepos(Strider[str].img,Strider[str].x,Strider[str].y,math.random(1,50) + 50)          
                              Strider[str].ent = math.random(1,#EntityTable)
                         end

but it give me error, In local angel = ...
i dont know why appear error !

1
2
error line : 128
attempt to index field '?' (a nil value)

pls help=.=
(sorry i'm bad english)
edited 1×, last 08.07.11 04:12:18 am

old Re: Strider lua [EntityList()]

EngiN33R
Moderator Off Offline

Quote
http://unrealsoftware.de/rules.php

Rules has written
× It is forbidden to edit posts just to mark these as being new (pushing)


Rruh. And why are you posting another error in a thread completely irrelevant to it? That is a completely different error which goes in a completely separate thread.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview