Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Lua Scripts/Questions/Help

6.770 Antworten
Seite
Zum Anfang Vorherige 1 2108 109 110338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

Vibhor
User Off Offline

Zitieren
Blazzingxx hat geschrieben
Vibhor hat geschrieben
how to make tiles for maps?
and how to decide whether it will be an obstacle,floor or a wall?

Is that about Lua or mapping? It's Lua tread, not maps...

DC haven't added tile(x,y) function so you should get script something on your own.


this thread is LUA/questions/help
so it means i can ask that here
so how to make tiles for maps?
and how to decide whether it will be an obstacle,floor or a wall?

alt Re: Lua Scripts/Questions/Help

KimKat
GAME BANNED Off Offline

Zitieren
Blazzingxx hat geschrieben
@Vibhor
Read first post of this tread!

http://www.unrealsoftware.de/forum_posts.php?post=120848&start=0

I'm helping you from marks...

Anyway, I will show how to decide tiles type.
http://img28.imageshack.us/img28/1576/21973629.png

It's clear?

By the way, you can add tiles in this folder "gfx/tiles/[your tile setname].bmp"

It supports image format, BMP.
The PNG format is also supported from what I've seen. I guess it makes tileset less huge, or perhaps even better I'm still not sure. Since I always use BMP format... I once tried png, but on old cs2d 0.1.0.4... the map kind of failed after a while, or perhaps that was just a cs2d (M.A.V.) that I experienced.

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
@KimKat:
Yes, that's true, the portable networks graphics format is much better than the old bit map format. PNG has alpha channels, it is ALSO lossless (Unlike JPG or GIF) and it's images tend to be smaller in file size.

@Blazzing:
I think you missinterpreted Vibhor, he wants to do a script that automatically generates a map with some weirdshit algorithm.

@Vibhor:
That is not possible because you can't make a wall or obstacles not even using lua. The nearest thing you can do is using some buildings like wall III to make walls.

alt Re: Lua Scripts/Questions/Help

Vectarrio
User Off Offline

Zitieren
Flacko hat geschrieben
The nearest thing you can do is using some buildings like wall III to make walls.

And you can make image on wall. and close it if wall dies

alt Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Zitieren
Vectar666 hat geschrieben
I mean make wall, and then make image on them

Ah yea, good idea.
But there shoul be also script for that action when wall get destroyed - image removing.

alt Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Zitieren
Flacko hat geschrieben
But since sprites are dynamic objects or sumshit like that they will dissapear when an explosion accurs near them

Yea, I had that explosions problem with flashlight until I haven't found other way...

alt Dynamic Object Values

Toa Hero 92
User Off Offline

Zitieren
Hello People, I want to start off with displaying these values:(dynamic objects are used for buildings, mines etc.!)

- object(id,"value")          Return a value of a dynamic object:
                    exists, typename, type,
                    health, mode, team, player,
                    x, y, rot, tilex, tiley,
                    countdown, rootrot, idle,
                    rotvar, target, upgrade
                    Moreover there is:
                    object(0,"table"): table with all dynamic object IDs


In this script :
1
2
3
4
5
6
7
addhook("build","buildmessage")
	function buildmessage(p,type,x,y,mode,objectid)
	--object = (objectid)
	--id=(type)
		print("You have built building type: "..type.." At X="..x.." At Y="..y.." With Mode: "..mode.." And With Object Id:"..objectid.."")
		--print("Object type "..object(id,"typename").."")
	end

As you can see I have tried to fix this error:LUA ERROR: sys/lua/samples/toainstabuild.lua:58: attempt to call global 'object' (a nil value)

& this error: LUA ERROR: sys/lua/samples/toainstabuild.lua:59: attempt to call local 'object' (a number value)

and this error too:LUA ERROR: sys/lua/samples/toainstabuild.lua:60: attempt to call global 'object' (a number value)

So.... how can i fix it please help because I'm stumped

alt Re: Lua Scripts/Questions/Help

CmDark
User Off Offline

Zitieren
leegao hat geschrieben
go to amx2d/core/mods.lua

Make the following revision

Line 72, change to

local n = string.split(g, "_")


Lee....

It becomes error:

attempt to call field 'split' (a nil value)

alt Re: Lua Scripts/Questions/Help

Vibhor
User Off Offline

Zitieren
Flacko hat geschrieben
@Blazzing:
I think you missinterpreted Vibhor, he wants to do a script that automatically generates a map with some weirdshit algorithm.


he got it right really
i am no lua wizard that would do that thing

alt have a problem!

justinlehnen
COMMUNITY BANNED Off Offline

Zitieren
i make a mod and i have a problem with the script:i will that the CT's can't go in the T classe's!like zombie plaque!sit on this script 2 months!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
--------------------------------------------------
-- Player Classes Script by Unreal Software     --
-- 28.02.2009 - www.UnrealSoftware.de           --
-- Adds Player Classes to your server           --
--------------------------------------------------

if sample==nil then sample={} end
sample.classes={}

-----------------------
-- INITIAL SETUP     --
-----------------------
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end
sample.classes.class=initArray(32)
function sample.classes.classmenu(id)
	menu(id,"Select your Character,1|for CT,2|for 

CT,3|for CT,4|for CT,5|for CT,6|for 

CT,7|for CT,8|for T")		
end


-----------------------
-- TEAM -> CLASS     --
-----------------------
addhook("team","sample.classes.team")
function sample.classes.team(id,team)
	if (team>0) then
		sample.classes.classmenu(id)
	end
end


-----------------------
-- SERVERACTION      --
-----------------------
addhook("serveraction","sample.classes.serveraction")
function sample.classes.serveraction(id)
	sample.classes.classmenu(id)
end


-----------------------
-- CLASS SELECTION   --
-----------------------
addhook("menu","sample.classes.menu")
function sample.classes.menu(id,menu,sel)
	if (menu=="Select your Character") then
		if (sel>=0 and sel<=8) then
			sample.classes.class[id]=sel
			if (player(id,"health")>0) then
				parse("killplayer "..id)
			end
		end
	end
end


-----------------------
-- SPAWN             --
-----------------------
addhook("spawn","sample.classes.spawn")
function sample.classes.spawn(id)
	if(player(id,"team") == 2) then
		if (sample.classes.class[id]<=1) then
       			parse ("setmaxhealth "..id.."75")
			parse ("speedmod "..id.." 6")    
			return "5,80";
	 	end
		if (sample.classes.class[id]==2) then
			parse ("setmaxhealth"..id.."100")
			parse ("setarmor "..id.." 125")
			parse ("speedmod "..id.." 5")
			return "4,10";
		end
		if (sample.classes.class[id]==3) then
			parse ("setmaxhealth"..id.."150")
               		parse ("setarmor "..id.." 50")
			return "3,54";
		end
		if (sample.classes.class[id]==4) then
			parse ("setmaxhealth"..id.."50")
			parse ("speedmod "..id.." 2")
			return "4,82";
		end
		if (sample.classes.class[id]==5) then
			parse ("setarmor "..id.." 25")
			parse ("speedmod "..id.." -2")
			return "11,79";
		end
		if (sample.classes.class[id]==6) then
			parse ("setmaxhealth"..id.."80")
			parse ("speedmod "..id.." 1")
        		return "51,3";
                end
		if (sample.classes.class[id]==7) then
			parse ("setmaxhealth"..id.."175")
			parse ("speedmod "..id.." 8")         		

         		parse("mp_wpndmg "..id.." Five-Seven 12")
                        return "6,81,1,59";
                end
	
	endif(player(id,"team") == 1) then
	        if (sample.classes.class[id]==8) then
			parse ("setmaxhealth"..id.."50")
			parse ("speedmod "..id.." -5")
                        return "78";
                end
	end
end

-----------------------
-- NO BUYING         --
-----------------------
addhook("buy","sample.classes.buy")
function sample.classes.buy()
	return 1
end


-----------------------
-- NO COLLECTING     --
-----------------------
addhook("walkover","sample.classes.walkover")
function sample.classes.walkover(id,iid,type)
	if (type>=61 and type<=68) then
		return 0
	end
	return 1
end


-----------------------
-- NO DROPPING       --
-----------------------
addhook("drop","sample.classes.drop")
function sample.classes.drop()
	return 1
end


-----------------------
-- NO DEAD DROPPING  --
-----------------------
addhook("die","sample.classes.die")
function sample.classes.die()
	return 1
end

alt my problem

Toa Hero 92
User Off Offline

Zitieren
Toa Hero 92 hat geschrieben
Hello People, I want to start off with displaying these values:(dynamic objects are used for buildings, mines etc.!)

- object(id,"value") Return a value of a dynamic object:
exists, typename, type,
health, mode, team, player,
x, y, rot, tilex, tiley,
countdown, rootrot, idle,
rotvar, target, upgrade
Moreover there is:
object(0,"table"): table with all dynamic object IDs

In this script : Code:
addhook("build","buildmessage")
function buildmessage(p,type,x,y,mode,objectid)
--object = (objectid)
--id=(type)
print("You have built building type: "..type.." At X="..x.." At Y="..y.." With Mode: "..mode.." And With Object Id:"..objectid.."")
--print("Object type "..object(id,"typename").."")
end


As you can see I have tried to fix this error:LUA ERROR: sys/lua/samples/toainstabuild.lua:58: attempt to call global 'object' (a nil value)

& this error: LUA ERROR: sys/lua/samples/toainstabuild.lua:59: attempt to call local 'object' (a number value)

and this error too:LUA ERROR: sys/lua/samples/toainstabuild.lua:60: attempt to call global 'object' (a number value)

So.... how can i fix it please help because I'm stumped


Flacko hat geschrieben
You can't.
That means that object hasn't been declared as a function.


Well If I Can't Then How can I Make it So?

And, If no-one can answer me with a solution, I will seriously consider Private Messaging DC with the question.
Mostly because no-one seems to have any clue as to how to find and manipulated those values...

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
@Toa Hero:
Dude, fuck you. I ansewered your question, what else do you want? There is no fix for that. Do not despise the help you get from us if the answer isn't the one you wished. If you want to PM DC do it, no one here will die because of that.
1× editiert, zuletzt 02.12.09 22:27:21
Zum Anfang Vorherige 1 2108 109 110338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht