The "How do I..." Thread

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
juizzysquirt
Posts: 126
Joined: Sun Jan 04, 2009 3:29 pm
Location: Knee-Deep in L.A. Meltdown

Re: The "How do I..." Thread

Post by juizzysquirt »

Apothem wrote:How do I triangulate a camera again? I remember figuring this out previously, but I forgot how the math works. Funny part is I'm pretty sure I was the one who originally came up with it. :?

I've been messing with the following snippet:

SetActorPosition(2, x-cos(a)*xyr, y-sin(a)*xyr, z+512.0, 0);

I havent been able to figure out what exactly is going on with cos(a)*xyr and what exactly it's doing there. It's been so long since I've messed with this.

In case anyone is wondering where that snippet is from it's located in the article about the [wiki]Cleaned-up_third_person_camera[/wiki]
Does this help at all? [wiki]Cos[/wiki]

I'm referring to the example in that article. So basically :

Code: Select all

SetActorPosition(2, x + cos (angle + 0.5) * 80, y + sin (angle + 0.5) * 80, z + 80.0, 0);
That should keep the actor behind the player, not sure about the actual distance. It should be 80 units away and same amount in air, I guess?
User avatar
Apothem
Posts: 2070
Joined: Sat Nov 29, 2003 7:13 pm
Location: Performing open heart surgery on an ACS compiler.

Re: The "How do I..." Thread

Post by Apothem »

The end result I understand it's what the actual math behind the cos() and sin() that I'm having trouble with. I'm trying to understand the mathematical concept behind why that works the way it does. I need to adapt the code to something else, but I forgot how the actual math behind it works :(

You're on the right track with it. I just need to understand what exact formula is being used.
User avatar
Lioyd_Irving
Posts: 427
Joined: Fri Dec 07, 2007 1:47 am
Location: Southtown

I need a hand

Post by Lioyd_Irving »

And I might mean that literally. I want to implement an "unarmed" weapon, but it seems the Deselect state won't end unless there's an actual sprite to lower. So I'm looking for a decent sprite of a hand. The thing is, I haven't seen any that isn't a combat stance, which I can't use because my thing is supposed to pass you off as a civilian to nearby guards.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: I need a hand

Post by NeuralStunner »

Lioyd_Irving wrote:The thing is, I haven't seen any that isn't a combat stance, which I can't use because my thing is supposed to pass you off as a civilian to nearby guards.
Have you considered a blank sprite? If you're not in combat ready stance, unlikely you're going to have your hands up like that. If you really need a visual cue, a slight bit of a knuckle would probably do.
User avatar
Lioyd_Irving
Posts: 427
Joined: Fri Dec 07, 2007 1:47 am
Location: Southtown

Re: The "How do I..." Thread

Post by Lioyd_Irving »

I did try TNT1 and just tried with an original blank sprite, but it still won't do.

I thought about using no sprite, but taking it from the inventory altogether as "deselection", and giving it back right at the selection of every other weapon.

Edit: Aaaaand it didn't work. Guess I'm gonna use that knuckle.

Edit²: I'm an idiot. I'd just forgotten to put A_WeaponReady. :oops:
User avatar
Lioyd_Irving
Posts: 427
Joined: Fri Dec 07, 2007 1:47 am
Location: Southtown

bump

Post by Lioyd_Irving »

We might as well rename the thread after me. Anyway, I need to force autoswitch off at pickup and Weapon.SelectionOrder won't do the trick.
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: The "How do I..." Thread

Post by FDARI »

Apothem wrote:The end result I understand it's what the actual math behind the cos() and sin() that I'm having trouble with. I'm trying to understand the mathematical concept behind why that works the way it does. I need to adapt the code to something else, but I forgot how the actual math behind it works :(

You're on the right track with it. I just need to understand what exact formula is being used.
Did anybody answer this?
I'm not an able teacher, but I understand cos and sin well enough to use them.

All points in a circle are them same distance from the centre (distance = radius).
A circle is a two-dimensional figure, so we'll be working with the "length" and "width" (x,y) coordinates. (Names and uses may vary.)
Given any one angle "A", COS(A) scales the "length" of the angle, and SIN(A) scales the width. Together, they give a point in the circle.
Multiplying both values by 2 gives the same point in a circle of radius 2.

You could also try wikipedia, but I have never understood their instructions. I'd sooner write a demonstration program than expect you to dig that.
The_Funktasm
Posts: 612
Joined: Tue Mar 17, 2009 5:12 am
Location: done making ZDF free sprites

Re: The "How do I..." Thread

Post by The_Funktasm »

Does anyone know how to export a model from blender to use in gzdoom?

Edit: Never mind, figured it out...
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: The "How do I..." Thread

Post by FDARI »

Quick followup on trigonometry. Once I got the idea into my head I could not leave it be.
Basic trigonometry for ZDoom II: http://files.drdteam.org/index.php/file ... ssroom.pk3
Just go talk to the teacher.
Will it help anybody? I don't know.
Features ridiculously complex menu system.

EDIT: Fixed a minor glitch (scripts not loaded... eh.)
Note: I haven't bothered to do anything about the aspect ratio. Blackboard trigonometry will most likely be distorted.
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Re: The "How do I..." Thread

Post by Ryan Cordell »

How do I get the Superlaser_trail model to work?

For some reason, using The_Funktasm's laser model on the Superlaser projectile itself works fine. However, it outright refuses to work on an actor which serves as the Superlaser's trail. I'm really not sure why. The model is defined correctly, the trail actor is defined to be as close to the projectile itself and yet, nothing.

EDIT: Apparently, said trail actor requires the Speed property and the MISSILE flag.

Now I'm trying to use A_SetUserVar in junction with A_SetScale to make it dynamically scale down in it's lifetime.
User avatar
Killar
Posts: 240
Joined: Mon Feb 09, 2009 12:15 pm
Location: Always one step behind

Re: The "How do I..." Thread

Post by Killar »

How do I use USDF dialogs in a mod?
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: The "How do I..." Thread

Post by NeuralStunner »

Killar wrote:How do I use USDF dialogs in a mod?
For actual creation of the dialogs, read the [wiki]USDF[/wiki] article. To make them work, you'll need [wiki=Actor_properties#ConversationID]ConversationID[/wiki]s.
User avatar
Killar
Posts: 240
Joined: Mon Feb 09, 2009 12:15 pm
Location: Always one step behind

Re: The "How do I..." Thread

Post by Killar »

NeuralStunner wrote:
Killar wrote:How do I use USDF dialogs in a mod?
For actual creation of the dialogs, read the [wiki]USDF[/wiki] article. To make them work, you'll need [wiki=Actor_properties#ConversationID]ConversationID[/wiki]s.
Can you show me an example script, or actor definition? The wiki doesn't have example USDF scripts.

And here's my actor definition and dialog script:
Spoiler:
User avatar
Apothem
Posts: 2070
Joined: Sat Nov 29, 2003 7:13 pm
Location: Performing open heart surgery on an ACS compiler.

Re: The "How do I..." Thread

Post by Apothem »

FDARI wrote:You could also try wikipedia, but I have never understood their instructions. I'd sooner write a demonstration program than expect you to dig that.
I tried wikipedia as well with no luck, HOWEVER, I did manage to find the solution to my problem (with a big thanks to a math dedicated forum). Link below.

http://www.mathisfunforum.com/viewtopic.php?id=14682
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: The "How do I..." Thread

Post by NeuralStunner »

Killar wrote:Can you show me an example script, or actor definition? The wiki doesn't have example USDF scripts.
I don't know of an example script, no. Sorry.
Locked

Return to “Editing (Archive)”