Forum

> > CS2D > Scripts > Is it possible to change entities string with LUA?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Is it possible to change entities string with LUA?

12 replies
To the start Previous 1 Next To the start

old Re: Is it possible to change entities string with LUA?

Apache uwu
User Off Offline

Quote
I'm pretty sure entity names and trigger strings are stored in the map. And during gameplay is probably read-only. Even if you could change it client side, a parse(trigger) command won't affect them because you can't change the entity names for them...

This was actually one of my suggestions.

> Dynamic Entities

     It would allow you to create any entity at will and change their parameters. That means you can insert a dynamic wall seamlessly.

old Re: Is it possible to change entities string with LUA?

Vectarrio
User Off Offline

Quote
user Infinite Rain has written
Something like
Func_Message

entity(x, y, 'str0') - string of the message possible to edit it?

I don't think so, but you could make:
1
2
3
4
5
6
7
addhook("trigger","lol")
function lol(name)
	if name=="yourtriggernamehere" then
		parse("trigger \"yourchangednamehere\"")
		return 1
	end
end
so, it doesn't triggers "yourtriggernamehere", but triggers "yourchangednamehere" instead

old Re: Is it possible to change entities string with LUA?

Apache uwu
User Off Offline

Quote
Yeah it's a function. Unless you change the function. Will be useless anyways.

COMPLETELY USELESS JUST PROOF OF CONCEPT
1
2
3
4
5
6
7
8
9
10
11
_entity=entity
function entity(x,y,value)
	if x=="1" and y=="1" then
		if value=="str0" then
			return "mystr"
		end
	end
return _entity(x,y,value)
end

--entity(1,1,"str0") = mystr
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview