Flashlights possible
by Ilidrake · in Torque 3D Professional · 09/22/2009 (5:17 pm) · 12 replies
Is it possible to create flashlights with scripts only? Are there any resources available for this yet? Thanks in advance.
#2
Where 1 is, that would be the mountpoint on the player or vehicle.
09/23/2009 (2:42 pm)
To actually mount the light object to the player you do this:%obj.mountobject(%light, 1);
Where 1 is, that would be the mountpoint on the player or vehicle.
#3
simply add
nothing else required.
09/23/2009 (3:23 pm)
to add a flashlight to any weapon,simply add
lightType = SpotLight;into the datablock ShapeBaseImageData of the weapon
nothing else required.
#5
09/23/2009 (5:08 pm)
well, i've tried just deepscrath advice and it works fine. how can i add a switch on/off function? i think i need a full funktion in my weapons datablock? i just started to study software development, so i have to ask around and anoy you with my confused questions.
#6
Have a question regarding deepscratch's method. Is there any way to access the lights options/dynamic fields? Trying to do the same as Arne, switching on/off flashlight by enabling/disabling the light.
Thanks.
04/05/2010 (10:54 am)
reviving old threadHave a question regarding deepscratch's method. Is there any way to access the lights options/dynamic fields? Trying to do the same as Arne, switching on/off flashlight by enabling/disabling the light.
Thanks.
#7
%weapon.setFieldValue("lightType", "");
*note: This is untested by me
04/05/2010 (12:52 pm)
I would assume you could just change the fieldvalue from script.%weapon.setFieldValue("lightType", "");
*note: This is untested by me
#8
For people with the same question, this is how you turn on/off flashlight:
to turn on
EDIT: Will only work singleplayer.
04/05/2010 (1:05 pm)
Thank you Jacob, worked perfectly.For people with the same question, this is how you turn on/off flashlight:
%player.getMountedImage($WeaponSlot).setFieldValue("lightType", "SpotLight"); to turn on
%player.getMountedImage($WeaponSlot).setFieldValue("lightType", "");to turn offEDIT: Will only work singleplayer.
#9
So everyone one who used this datablock will have the light or not and not just your player.
This can work for you, but just in case I warned :D
04/05/2010 (11:45 pm)
Please note that you are modifying a datablock and not an instance of an object.So everyone one who used this datablock will have the light or not and not just your player.
This can work for you, but just in case I warned :D
#11
and can the spotlight be rotated in a way to make it more like a lantern light on the player so it lights a sperical area around the player?
04/06/2010 (9:14 am)
also what all lighttypes are available or is it just spotlight.and can the spotlight be rotated in a way to make it more like a lantern light on the player so it lights a sperical area around the player?
#12
Then you can use "ConstantLight". In your lantern ShapeBaseImage file just add
04/06/2010 (9:19 am)
@ DonaldThen you can use "ConstantLight". In your lantern ShapeBaseImage file just add
lightType = "ConstantLight"; lightRadius = 2; //If you want to control the radius
Torque Owner Adam Beer
Ignition Games Inc.