Spider Mastermind
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > Creating a torch in GZDoom
 
Author
All times are GMT. The time now is 22:47. Post New Thread    Post A Reply
Agentbromsnor
Member


Posts: 416
Registered: 04-12


Hello there!

I'm currently developing a survival horror mod for GZDoom that makes use of all its OpenGL features. One feature that I would like to implement in the game is the function to pick up torches that are placed on the wall, and the player can walk around with them for a while before burning out. The idea is that the torch has a dynamic light function, and I'm hoping that it would be possible to get the torch to work on the player (so walking around actually lits the dark envirements somewhat.

Since I'm terrible at DECORATE, I'm hoping that somebody can help me out with this, and that in turn I learn a little more about making my own objects for later use. :)

Old Post 12-13-12 14:04 #
Agentbromsnor is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Cacowad
Member


Posts: 272
Registered: 07-12


this is a quick-made actor that should do the work... i have not tested it so you may have to mess a bit with the frame duration and the frames number to get it work.

Actor torch : weapon
{
Weapon.AmmoGive 100
Weapon.AmmoType "torchammo"
Weapon.AmmoUse 4
Weapon.SlotNumber 1
inventory.pickupmessage "a torch"
inventory.pickupsound "optional sound lump name here"
+WEAPON.NOAUTOFIRE
+WEAPON.NOALERT
states
{
Spawn:
TORC A -1
stop
Ready:
TORC A 0 A_CheckReload
TORC ABCABC 5 bright A_WeaponReady
TORC A 0 A_TAKEINVENTORY ("torch", 1)
loop
Deselect:
TORC A 1 bright A_Lower
loop
Select:
TORC A 1 bright A_Raise
loop
Fire:
TORC CDEF 3 bright
TORC G 3 bright A_CustomMeleeAttack (7,"optional attack sound here", "optional miss sound here", "fire")
TORC A 0 A_CheckReload
goto Ready
}
}

actor torchammo : Ammo
{
inventory.pickupmessage ""
inventory.amount 100
inventory.maxamount 100
inventory.icon ""
ammo.backpackamount 100
ammo.backpackmaxamount 200
states
{
Spawn:
TORG A -1
stop
}
}

Old Post 12-13-12 17:15 #
Cacowad is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Agentbromsnor
Member


Posts: 416
Registered: 04-12


Thanks alot Cacowad! I'm trying to read the code a bit so I don't get confused.

The code specifies its own set of ammo, for which there is 100 by default. There's a pickup sound I can specify.

Also some very retarded DECORATE questions: If I just place the sound that I want in my WAD, can I link it to the pickup sound like that?

Edit: I also can't get the torch to show up in Doom Builder 2...

Last edited by Agentbromsnor on 12-13-12 at 18:15

Old Post 12-13-12 17:26 #
Agentbromsnor is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Krispy
Senior Member


Posts: 1089
Registered: 02-12


Post your wad.

Old Post 12-13-12 21:42 #
Krispy is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Agentbromsnor
Member


Posts: 416
Registered: 04-12



Krispy said:
Post your wad.


http://www.speedyshare.com/wyFmf/hal-textured.wad

I had alot of help with writing the code and doing the GLDEFS, but whenever I want to play it with GZDoom, GZDoom just says that the light is 250 (which it isn't), which is an invalid number or something like that.

Old Post 12-13-12 21:48 #
Agentbromsnor is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Cacowad
Member


Posts: 272
Registered: 07-12



Agentbromsnor said:
Thanks alot Cacowad! I'm trying to read the code a bit so I don't get confused.

The code specifies its own set of ammo, for which there is 100 by default. There's a pickup sound I can specify.

Also some very retarded DECORATE questions: If I just place the sound that I want in my WAD, can I link it to the pickup sound like that?

Edit: I also can't get the torch to show up in Doom Builder 2...



1: you are welcome, i do not know anything about gzdoom light settings, i just hope it work somehow.

2: yep, you can directly link your sound lump to the decorate.

3: just add a very large number ( > 14165 ) near the name of the actor.

es:

Actor torch : weapon 16000
{
[...]
}

Old Post 12-13-12 22:09 #
Cacowad is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Agentbromsnor
Member


Posts: 416
Registered: 04-12



Cacowad said:


1: you are welcome, i do not know anything about gzdoom light settings, i just hope it work somehow.

2: yep, you can directly link your sound lump to the decorate.

3: just add a very large number ( > 14165 ) near the name of the actor.

es:

Actor torch : weapon 16000
{
[...]
}



I had some help with the rest of the decorate, you can check it out above because I'm having some kind of error. I tried sticking an GLDEFS to it, for the dynamic light but its not working.

For the sound, I'm guessing I need to put in a sounddef lump to define it right?

Old Post 12-13-12 22:17 #
Agentbromsnor is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Cacowad
Member


Posts: 272
Registered: 07-12


code:
flickerlight FLICKER { color <RED> <GREEN> <BLUE> size <SIZE> secondarySize <SECSIZE> chance <CHANCE> [offset <X> <Y> <Z>] [subtractive <SUB>] [dontlightself <DLS>] } SECSIZE: The second size to flicker (will alternate between SIZE and SECSIZE). SECSIZE must be greater than SIZE. CHANCE: The chance, each frame, that it will flicker to the second size.


you missed some instructions. secsize must be greater than size and there must be a chance to get from one to another.

i'm trying to set it working properly, tomorrow i will retry it again.

also i made some errors in the decorate code, i will post the fixed version very soon.

another thingy thing: how do you want your torch? it have infinite time of usage or not? it will drop particles?

Old Post 12-13-12 23:25 #
Cacowad is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Agentbromsnor
Member


Posts: 416
Registered: 04-12



Cacowad said:
code:
flickerlight FLICKER { color <RED> <GREEN> <BLUE> size <SIZE> secondarySize <SECSIZE> chance <CHANCE> [offset <X> <Y> <Z>] [subtractive <SUB>] [dontlightself <DLS>] } SECSIZE: The second size to flicker (will alternate between SIZE and SECSIZE). SECSIZE must be greater than SIZE. CHANCE: The chance, each frame, that it will flicker to the second size.


you missed some instructions. secsize must be greater than size and there must be a chance to get from one to another.

i'm trying to set it working properly, tomorrow i will retry it again.

also i made some errors in the decorate code, i will post the fixed version very soon.

another thingy thing: how do you want your torch? it have infinite time of usage or not? it will drop particles?



My idea is to have the torch run for like 2 minutes or something before it runs out. From that point you can just pick another one. Particles? Will it look 'realistic'? I'm trying to make the mod as realistic as possible within the convines of GZDoom ofcourse, but if it looks nice like that then why not. :)

You are awesome! I'll make sure to credit your work when I'm reaching beta!

Old Post 12-13-12 23:29 #
Agentbromsnor is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
GreyGhost
Why don't I have a custom title by now?!


Posts: 8130
Registered: 01-08


Why not just borrow the Heretic torch and adapt it for your purposes?

Old Post 12-14-12 00:19 #
GreyGhost is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Agentbromsnor
Member


Posts: 416
Registered: 04-12



GreyGhost said:
Why not just borrow the Heretic torch and adapt it for your purposes?


Do you have to use it through inventory? Because I'd like to have the player use the torch as a 'weapon', not fondle though their inventory.

Old Post 12-14-12 13:40 #
Agentbromsnor is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Cacowad
Member


Posts: 272
Registered: 07-12



GreyGhost said:
Why not just borrow the Heretic torch and adapt it for your purposes?


i have already thinked about that, but it lit the whole map, probably Agentbromsnor want a limited-ranged one instead...

btw: i am studing gldef propertyes and dynamic object binding, i will post a quite correct code this evening.

Old Post 12-14-12 17:26 #
Cacowad is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Cacowad
Member


Posts: 272
Registered: 07-12


there is! a beta version of the torch, it have a ridiculus ammo usage (each ammo last 1/8 second on a total of 2 minutes duration), i will find out a way to make it work smooth enougth and reduce ammo.


code:
//this is a comment. //this is a comment too. Actor torch : weapon 6000 { Game Doom Weapon.AmmoGive 960 //is 120*8, this actor use 8 ammo units for second, for a total of 120 seconds usage. Weapon.AmmoType "torchammo" Weapon.AmmoUse 32 Weapon.SlotNumber 1 inventory.pickupmessage "a torch" inventory.pickupsound "optional sound lump name here" +WEAPON.NOAUTOFIRE +WEAPON.NOALERT //this weapon will not alert monsters states { Spawn: TORC A -1 stop Ready: TORC A 0 A_WeaponReady TORC A 4 bright A_spawnitemex ("torchlight", 0, 0,28, 0, 0, 0, 0, SXF_SETMASTER, 0) //spawn a dummy actor that light the area. TORC A 0 A_jump (256, "burning") loop Burning: TORC A 0 bright A_CheckReload //deselect the torch if there is no more ammo. TORC A 0 bright A_TakeInventory ("torchammo", 1) //take away 1 unit of ammo. Goto Ready Deselect: TORC A 1 bright A_Lower TORC A 1 bright loop Select: TORC A 1 bright A_Raise loop Fire: TORC CDEF 3 bright A_spawnitemex ("torchlight", 0, 0,28, 0, 0, 0, 0, SXF_SETMASTER, 0) //a dummy torch attak, just in case you want it. TORC A 0 bright A_Light2 TORC G 4 bright A_CustomMeleeAttack (7,"optional attack sound here", "optional miss sound here", "fire") TORC A 1 bright A_Light0 TORC A 0 A_CheckReload goto Ready } } actor torchammo : Ammo { Game Doom inventory.pickupmessage "" inventory.amount 960 inventory.maxamount 960 inventory.icon "" ammo.backpackamount 1920 ammo.backpackmaxamount 1920 states { Spawn: TORG A -1 stop } } ACTOR torchlight //this actor was needed in order to use dynamic ligthing, it seems that can be used only on spawned actors, not on the weapons of the player. { Game Doom Radius 1 Height 1 Speed 0 Damage 0 Projectile reactiontime 1 States { Spawn: TNT1 A 4 BRIGHT Light ("FLICKER3") A_CountDown //tnt1 is an invisible sprite native in (G)zdoom, this actor will vanish as long as it enter to fake the light of a moving torch. Loop Death: TNT1 A 0 BRIGHT Light ("FLICKER3") Stop } }


i will comment the code later, so you may learn something from it.

no particles added yet.

also i had to modify a bit the gldef. i will try after dinner the other options.

code:
pulselight FLICKER3 { color 0.30 0.21 0.12 size 800 secondarySize 900 interval 10 }

Last edited by Cacowad on 12-15-12 at 00:26

Old Post 12-14-12 19:50 #
Cacowad is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Agentbromsnor
Member


Posts: 416
Registered: 04-12


Did you test it out yet? I'm curious!


Cacowad said:


i have already thinked about that, but it lit the whole map, probably Agentbromsnor want a limited-ranged one instead...

btw: i am studing gldef propertyes and dynamic object binding, i will post a quite correct code this evening.



Indeed, I think the limited range is the better option.

If everything works out, I will ofcourse give you full credit! :)

Old Post 12-14-12 23:36 #
Agentbromsnor is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Cacowad
Member


Posts: 272
Registered: 07-12


yes i have tested it already, just copy the text to make it work.

WARNING: this actor NEED a dummy weapon (like non-damanging fist) to swict to in order to save ammo and/or when there is no more ammo to use.

also if there is something that you want to change, just ask, i will try to do it ;)

Old Post 12-15-12 00:23 #
Cacowad is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Agentbromsnor
Member


Posts: 416
Registered: 04-12


Gonna give it a try. :D I'm gonna warn you though; I really suck at DECORATE.

Old Post 12-15-12 12:08 #
Agentbromsnor is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Agentbromsnor
Member


Posts: 416
Registered: 04-12


Haha, it works like a charm! I love how it is subtle in a realistic way, but gives you enough light for it to be helpfull!

Are you on MSN perhaps, so I can consult you more often for DECORATE in my mod?

Old Post 12-16-12 23:18 #
Agentbromsnor is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Cacowad
Member


Posts: 272
Registered: 07-12


glad you liked it ;)

you mean messenger? i never really used it, but i log on doomworld every day nowaday, just pm me if you need something, i will be glad to help (even if i am still a newbye here...).

Old Post 12-17-12 13:09 #
Cacowad is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Agentbromsnor
Member


Posts: 416
Registered: 04-12



Cacowad said:
glad you liked it ;)

you mean messenger? i never really used it, but i log on doomworld every day nowaday, just pm me if you need something, i will be glad to help (even if i am still a newbye here...).



I'm logged on MSN almost all day, but if you don't use it then this will work too. :)

Did you say that this torch was just a beta?

Old Post 12-17-12 13:20 #
Agentbromsnor is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Cacowad
Member


Posts: 272
Registered: 07-12


oh, well, yes, it has a ridiculus ammo amount/usage that's all, but it is fully effective, also it is in fact a beta until you decide to make it definitive :P i will mess a bit on the code now.

regarding MSN i am usually out all day long without an internet connection, so i don't know how much it could be effective (also i had forgot what was my account, so i probably have to redo it).

Old Post 12-17-12 22:02 #
Cacowad is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Agentbromsnor
Member


Posts: 416
Registered: 04-12


Well, you don't perse need MSN, but I figured it would be handy for communication since I'm pretty much online on there all the time. :) I don't mind posting here though.

I'm contemplating a bit on if I should do a HUD sprite for the torch. Probably not because I don't want to make the game seem 'cartoony'. It does need a pick up actor though, and I think I would need to make a 3D model for that. I could go with a sprite but again, it would make the game look cartoony and I don't want to throw the atmosphere out the window.

I can make the model in Wings 3D and use MilkShape to export it to MD3 format. Would you know how to use this as a pick up representation for the torch, in DECORATE?

I also noticed that the torch doesn't seem to run out. I think it would be nice to have it run out in 2 minutes or so, and present the player with a short message "Torch burned up" or something like that, so that the player knows whats going on.

I hope I'm not overwhelming you with requests here, haha! :)

Old Post 12-19-12 00:24 #
Agentbromsnor is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Cacowad
Member


Posts: 272
Registered: 07-12



Cacowad said:

WARNING: this actor NEED a dummy weapon (like non-damanging fist) to swict to in order to save ammo and/or when there is no more ammo to use.



code:
ACTOR UselessFist : Fist replaces Fist { +WEAPON.NOALERT States { Fire: Goto Ready } }


that's it. you may add this as a "sister weapon" to the torch, or add it trought ACS. if you want the torch totally removed after it's use, you have once again to rely on ACS.


I can make the model in Wings 3D and use MilkShape to export it to MD3 format. Would you know how to use this as a pick up representation for the torch, in DECORATE?


yes, surely.


a message can be done with a little modification of the code. just replace the old "burning" state with this one.

code:
Burning: TORC A 0 bright A_JumpIfNoAmmo ("Noammo") //deselect the torch if there is no more ammo. TORC A 0 bright A_TakeInventory ("torchammo", 1) //take away 1 unit of ammo. Goto Ready Noammo: TORC A 0 A_Print ("the torch burned up") Goto Deselect



I hope I'm not overwhelming you with requests here, haha! :)


i don't mind, you are welcome ;) yes msn would be handy, if i only remember what was my account... i will send it to you when i will find it .-. until that there is a pm function on the forum (that i never used btw) tht will supply for now.

Old Post 12-19-12 14:50 #
Cacowad is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Agentbromsnor
Member


Posts: 416
Registered: 04-12


The message part worked perfectly. As soon as it ran out though, the torch started flickering (the white block placeholder started going up and down).

Could it be that there's some kind of loop in the code that causes this?

Also, if you remember your MSN account let me know. :) I can send you the texture WAD through PM if you like? Makes testing a bit smoother I think.

Old Post 12-19-12 15:00 #
Agentbromsnor is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Cacowad
Member


Posts: 272
Registered: 07-12


you added the dummy weapon at the start of the map or when you pickup the torch? it is VERY important until i find a way to remove the torch itself from the inventory [oh, well i have already found it, the command is A_TakeInventory ("torch",1) i just need to test it].
regarding the texture pack, if you already have the torch's sprites it could help.

OT: man, your project could be a lot more interesting than the slenderman series, there is very simple code behind it, only fixed points; if you don't alredy know, take a look at "ImScared".

Old Post 12-19-12 23:34 #
Cacowad is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Agentbromsnor
Member


Posts: 416
Registered: 04-12



Cacowad said:
you added the dummy weapon at the start of the map or when you pickup the torch? it is VERY important until i find a way to remove the torch itself from the inventory [oh, well i have already found it, the command is A_TakeInventory ("torch",1) i just need to test it].
regarding the texture pack, if you already have the torch's sprites it could help.

OT: man, your project could be a lot more interesting than the slenderman series, there is very simple code behind it, only fixed points; if you don't alredy know, take a look at "ImScared".



Ah! I've put the "takeinventory" command in the ACS of my level to make sure you start with no weapons. I think you can also turn off cheating with a mapinfo lump, so that should prevent players from running around with a shotgun. :)

I don't have any sprite for the torch, but I have made a basic model for it. I hope I'm not making it too difficult for you to make a modeldef? I've made the model with a ring around the torch that attaches to the wall. My idea is to make two seperate models, one with both the torch and the ring, and one with just the ring, so it will look as if you picked the torch out of the ring. Would that be possible to do?

Thanks alot, and yes, I've seen a lets play of ImScared and it looked great! :) My mod was somewhere in the 700 spot of most popular mods on ModDB today, so that makes me anxious to get a beta out and see how well people will pick it up.

Also, you've got PM! :)

Last edited by Agentbromsnor on 12-20-12 at 00:24

Old Post 12-20-12 00:12 #
Agentbromsnor is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Agentbromsnor
Member


Posts: 416
Registered: 04-12


Send you another PM, Cacowad.

Edit: I also now added dynamic sound to my WAD!

Last edited by Agentbromsnor on 12-22-12 at 00:28

Old Post 12-21-12 16:55 #
Agentbromsnor is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 22:47. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Doom Editing > Creating a torch in GZDoom

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Message Board Statistics