Tinkering with different ways to make a lit thrown torch as a way to get back into Grimrock editing. Did anyone ever make one?
Is there a way to get the pos of a thrown item? If I am thinking straight, using the LoG framework you'd be able to move a light spawned on the torch in real time, more or less.
That would create a pretty good lit thrown torch. Unfortunately I realise I'm too rusty to create the code from scratch.
Getting the position of a thrown item in-air
- DesperateGames
- Posts: 90
- Joined: Sun Oct 06, 2013 1:54 pm
Re: Getting the position of a thrown item in-air
I made something similar with a lot of trickery in my "Prison Ward" dungeon:
You could do the same with your torch, although I would not know for sure how to create / start the effect when the torch is thrown. Maybe the following could work: There is the "onDrawGui"-Scripting hook. Whenever it gets called, you could analyze whether
-The player has a torch under his mouse cursor
-If the player has just clicked the mouse button
-If the mouse cursor position is high enough (relative to the screen resolution )so the click will result in throwing the torch.
If the above conditions are met, you could start the effect. A bit of trickery involved, but this could work.
SpoilerShow
There is a scene at the beginning where skeletons play ball with a glowing, holy orb. The orb is created by the "shootProjectile"-function. At the same time, a fx entity is being spawned and moved along together with the orb by using Diarmuds genius fxTranslator solution, see here: viewtopic.php?f=14&t=5801
Here you can see the effect in action (at 13:12 onward in the video):
http://www.youtube.com/watch?v=N5Syf0YqxFE#t=791
The "trick" is that the fx does not "know" the position of the thrown item, it is simply moved in the same speed as the orb. I am afraid I don't know any method to obtain the coordiantes of a thrown item. If this would be possible, the effect would be even better.
Here you can see the effect in action (at 13:12 onward in the video):
http://www.youtube.com/watch?v=N5Syf0YqxFE#t=791
The "trick" is that the fx does not "know" the position of the thrown item, it is simply moved in the same speed as the orb. I am afraid I don't know any method to obtain the coordiantes of a thrown item. If this would be possible, the effect would be even better.
-The player has a torch under his mouse cursor
-If the player has just clicked the mouse button
-If the mouse cursor position is high enough (relative to the screen resolution )so the click will result in throwing the torch.
If the above conditions are met, you could start the effect. A bit of trickery involved, but this could work.
- Dr.Disaster
- Posts: 2876
- Joined: Wed Aug 15, 2012 11:48 am
Re: Getting the position of a thrown item in-air
It might be a bit far fetched but these advanced throwing weapons (the "Chakram" from Ralzakark and "The Glaive of Krull" from Pat Ferguson) had to deal with this too. Their scripts might brighten things up a bit.
Re: Getting the position of a thrown item in-air
hey guys, while implementing something for the orrr2, I realized that "glitterEffect" can attach any particle system to an object, including when it's thrown. No light with it, but you can always attach the "torch" particle directly to the object and send a light without particle to go with it with the fxTranslator: if the flame is in the exact place but the light is approximate it won't show.
glitterEffect seems to center the particle system on the object, but you can adjust the placement by cloning the particle system def and tinkering with the boxMin / boxMax properties.
glitterEffect seems to center the particle system on the object, but you can adjust the placement by cloning the particle system def and tinkering with the boxMin / boxMax properties.
Re: Getting the position of a thrown item in-air
Thanks, just the solution I was hoping for!Diarmuid wrote:hey guys, while implementing something for the orrr2, I realized that "glitterEffect" can attach any particle system to an object, including when it's thrown. No light with it, but you can always attach the "torch" particle directly to the object and send a light without particle to go with it with the fxTranslator: if the flame is in the exact place but the light is approximate it won't show.
glitterEffect seems to center the particle system on the object, but you can adjust the placement by cloning the particle system def and tinkering with the boxMin / boxMax properties.