Doom3world

The world is yours! Doom 3 - Quake 4 - ET:QW - Prey - Rage
It is currently Wed May 22, 2013 10:43 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Toggle fire modes through scripts. Possible?
PostPosted: Mon Jun 25, 2012 12:10 am 
Offline
picked up the chaingun
User avatar

Joined: Mon Jul 18, 2011 5:58 am
Posts: 193
Hi there!
I wonder if it's possible to add a secondary fire mode to the pistol, so that when I press a previously assigned key, it'll toggle between 3 round burst fire mode/semi-auto (normal mode)
I'm useless at scripting, but I suppose this could be done by scripts.
A few days ago someone asked for help on how to add a flashlight to a weapon and how to then toggle it on/off. He seemed to make it work. Is this anything like that?
Help is appreciated, and thanks in advance!

_________________
FFYL
------
Doom 3: S.T.A.R 1088


Top
 Profile E-mail  
 
 Post subject: Re: Toggle fire modes through scripts. Possible?
PostPosted: Mon Jun 25, 2012 3:02 am 
Offline
picked up 75 health

Joined: Mon Feb 07, 2011 4:19 am
Posts: 81
Hi,

there are plenty of mods with secondary fire via scripting, a quick google search in this site will return tons of results.

Anyway, take a look here, you can see how to get your new alt fire button via scripting, http://www.doom3world.org/phpbb2/viewtopic.php?p=235993#p235993

Then it's just a matter of making the thing you want when the button is detected.

Oh and keep in mind that you have to bind your new button to a key, e.g. you could put something like this in the autoexec.cfg,
Code:
bind "MOUSE2" "_button5"


Vanilla D3 actually has 3 unused button ( "_button5, "_button6" and "_button7" ) which can be detected via scripting by using the approach you see in the post I linked, you don't need the SDK at all.

Also, Ivan_the_B found a good trick to gain access to unlimited keys, http://www.doom3world.org/phpbb2/viewtopic.php?p=218719#p218719

Hope this help you, BTW I think I've already made something like that ( the 3 rounds burst ), let me know if you need the code :wink:


Top
 Profile E-mail  
 
 Post subject: Re: Toggle fire modes through scripts. Possible?
PostPosted: Mon Jun 25, 2012 4:26 am 
Offline
picked up the chaingun
User avatar

Joined: Mon Jul 18, 2011 5:58 am
Posts: 193
Thank you for your reply doomtrinity, I've found and downloaded a mod that makes exactly what I want: A 3 round burst-fire pistol. But unfortunately it doesn't include any toggle action, which makes the pistol fire ONLY in burst mode.
My question: Do you know how to tell the engine (via scripting language, which I don't understand!) to detect a button and whenever I press it, If the pistol is in normal mode, change to burst, and if it's in burst, change back to normal (semi-auto).
If you need the script this mod includes I'll send it to you. By the way, this mod was created by a guy "Kamikazi Fred", he wrote in the readme file we can make changes to the script if needed. Or if you need the pistol script I'm currently using (which in fact is the semi-auto pistol script you provided me in another post) I'll send it to you too.
Again, thanks.

_________________
FFYL
------
Doom 3: S.T.A.R 1088


Top
 Profile E-mail  
 
 Post subject: Re: Toggle fire modes through scripts. Possible?
PostPosted: Mon Jun 25, 2012 1:25 pm 
Offline
picked up 75 health

Joined: Mon Feb 07, 2011 4:19 am
Posts: 81
chimueloeldragon2011 wrote:
My question: Do you know how to tell the engine (via scripting language, which I don't understand!) to detect a button and whenever I press it, If the pistol is in normal mode, change to burst, and if it's in burst, change back to normal (semi-auto)


The best thing to understand how these things work is to watch how scripts are done, you just need to be patient and make some tests, take some scripts from other mods and try to understand what they do :wink:

By the way, I attach my script.

Cheers


Attachments:
pistol_mod.rar [1.75 KB]
Downloaded 36 times
Top
 Profile E-mail  
 
 Post subject: Re: Toggle fire modes through scripts. Possible?
PostPosted: Mon Jun 25, 2012 7:51 pm 
Offline
picked up the chaingun
User avatar

Joined: Mon Jul 18, 2011 5:58 am
Posts: 193
Thank you very much, it worked fine and as I expected it to work. I must say I wouldn't have figured it out by myself :( I took a quick look at your script and identified the new lines but every time I look at a script file I'm like what? The only thing I understand about scripts are basic functions called from triggers in the maps (with the call function) and how to start a sound shader from a script.
My respects..

_________________
FFYL
------
Doom 3: S.T.A.R 1088


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group