Forum

> > CS2D > Scripts > Get button's settings
Forums overviewCS2D overview Scripts overviewLog in to reply

English Get button's settings

3 replies
To the start Previous 1 Next To the start

old Get button's settings

Mami Tomoe
User Off Offline

Quote
How to get a button's settings?
Like to know if it's CT/T only or everyone and more things?

1
2
3
4
for i = 0, 9 do
		msg(tostring(entity(x, y, "int["..i.."]")))
		msg(tostring(entity(x, y, "str["..i.."]")))
	end

This leads to a whole bunch of
false
s.

old Re: Get button's settings

DC
Admin Off Offline

Quote
See cs2d entity trigger_use (bottom section).

It's indeed without the [] so this should work:
1
2
3
4
for i = 0, 9 do
	msg(tostring(entity(x, y, "int"..i)))
	msg(tostring(entity(x, y, "str"..i)))
end

If it's returning just "false" it either means that
:x: the parameter you passed in (intX, strX) is unknown
:x: or the entity does not exist (x, y must be the tile position of an existing entity)

Otherwise strX should return an empty string and intX just 0 even if the value is not set/used for that specific entity type.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview