07-06-2001, 04:40 PM | #1 |
Guest
|
Sniper rifle
Ok I know I saw this before but I dont remember how to do it. I think they used night vision if I remember correctly. Can someone tell me? Thanks
|
07-07-2001, 12:51 AM | #2 |
Re: Sniper rifle
[edit]GOD I AM A MORON!! I TOTALLY FORGOT WHAT YOU ASKED AND WROTE THIS WHOLE THING WRONG .. I DIDN'T EXPLAIN HOW TO MAKE IT ZOOM WHILE NV GOGGLES WERE ON.. JUST E-MAIL ME.
ok. I made this once before I believe, although it was jump boots, that doesn't matter. In the APLAYER actor, you want to detect if the player has a certain inventory item, i.e. - nv goggles. ifpinventory <INVENTORY_ITEM> 0 This may look confusing because there's a 0, well, when you write 'ifpinventory blah blah' then it checks to see if the statement is FALSE, so in other words, 0 = yes 1 = no. now, I am assuming you want to zoom? you do this by sizing the player very large.. like so: sizeto 1024 1024 Note that this is just one gradual sizing effect, so if you want different set zoom magnitudes you would increment these like saying: sizeto 512 512 ifhitspace { sizeto 1024 1024 } The 'ifhitspace' checks to see if the player hits the 'open' key. To add some cool effects, you can add some messages like "Hit OPEN to 2x zoom." Of course the bad thing about the above code is that right when someone gets the sniper rifle it'll start to zoom, you can get around that by saying: ifpinventory <INVENTORY_ITEM> 0 { ifhitspace { sizeto 1024 1024 } } that basically says that if the user has the <INVENTORY_ITEM> and then hits the 'OPEN' key, they will "zoom" in. Now you want to be able to make this all work when you get some weapon. Find the weapon pickup code, and for the sake of it being an exmaple let's use the RPG. You'll then need to search for "actor RPGSPRITE" In that code you'd put "addpinventory <IVENTORY_ITEM> 1". I don't really feeel like ripping code to show you where it goes, so I'm sure you'll be able to figure it out [img]smilies/images/icons/smile.gif[/img]. Also take notice that with this example, once the user has picked up the sniper rifle he/she will be able to zoom whenever they want to, try using the holoduke.. that's a hint. [img]smilies/images/icons/wink.gif[/img]. One last thing before I write some quick code, I didn't include a way for the player to get back to normal size.. um.. I forgot what the normal player size was anyway, and this is mainly to help you learn so.. Ok, there is more than likely a syntax error in here, I haven't coded for Duke3d in soooo long. Here goes... // In the APLAYER actor, very bottom... ifpinventory GET_HEATS 0 { ifhitspace { sizeto 1024 1024 } } ifpinventory GET_HEATS 1 { } // in RPGSPRITE addinventory GET_HEATS 1 And that's it.. if you email me I'll give you some better code with better explanations. UBB post won't cut it. Hope that gave you a little bit of help, -matt [edit]fixed a few mistakes [img]smilies/images/icons/smile.gif[/img] [ 07-07-2001: Message edited by: sir_plague ] [ 07-07-2001: Message edited by: sir_plague ]
__________________
"They don't go to school to be taught what balls not to touch." - Moises Alou, Cubs "Unfortunately I have calculated that I probably won't be able to eat all life before I die. But I intend do to as much damage as possible." - IHerman |
|
07-07-2001, 05:05 PM | #3 |
Guest
|
Re: Sniper rifle
Thanks for the help! I emailed you for a little more help. Later
|
07-07-2001, 05:21 PM | #4 |
Guest
|
Re: Sniper rifle
Umm ok well I did the size at thing like i said in the email but the thing is that it checks all the ifhitspace lines so quickly it just goes back to normal! How can I make it wait a second before it checks the next ifhitspace? There's a counter right? Would that be what I should use. If so how?
|
07-07-2001, 05:51 PM | #5 |
Re: Sniper rifle
Well, you can use resetcount and ifcount primitives to make everything wait a bit, I didn't get your email, maybe the one in my profile is out of date - try [email protected] .
__________________
"They don't go to school to be taught what balls not to touch." - Moises Alou, Cubs "Unfortunately I have calculated that I probably won't be able to eat all life before I die. But I intend do to as much damage as possible." - IHerman |
|
07-07-2001, 06:40 PM | #6 |
Guest
|
Re: Sniper rifle
Well then I'll just put it here. First off, since we're enlarging Duke does that mean he'll look huge in multiplayer? Secondly, I'm setting it so when you zoom it goes up by 1/3 full zoom until its at 1024 but I cant figure out how to make it go from one to the next and not just the first one over and over. Secondly I'm probably just gonna have it as a built in feature of night vision. That would probably work better. Can I change the code of night vision so you can only zoom when using night vision? Thanks
|
07-07-2001, 06:58 PM | #7 |
Re: Sniper rifle
"You've got mail!"
[ 07-07-2001: Message edited by: sir_plague ]
__________________
"They don't go to school to be taught what balls not to touch." - Moises Alou, Cubs "Unfortunately I have calculated that I probably won't be able to eat all life before I die. But I intend do to as much damage as possible." - IHerman |
|
Bookmarks |
|
|