Jump to content

Multiple scripts in an entity


Berken
 Share

Recommended Posts

I experimented with both approaches during development, and I decided to use a single script system because it made the scripting a lot simpler.  With our system you can just check to see if a function exists and call it if it does:

if world:Pick(p0,p1,pickinfo) then
	if type(pickinfo.entity.script.TakeDamage)=="function" then
		pickinfo.entity.script:TakeDamage(10)
	end
end

This greatly simplifies our scripting system and allows different scripted objects to work together more easily.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • Josh locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...