Home : Downloads : Forums : Contact Us Copyright

AMC Web Forums

  • February 23, 2019, 05:26:31 PM *
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4] 5

Author Topic: (Eduke) example code archive  (Read 49950 times)

Trooper Dan

  • Mario Nukem Team
  • Member
  • Offline Offline
  • Posts: 4243
  • EDuke32 Special Forces -- Code Ops
    • MSN Messenger - deeper-thought@hotmail.com
    • View Profile
    • Email
Re: (Eduke) example code archive
« Reply #45 on: January 26, 2008, 04:31:54 AM »
The worst is when the typo doesn't cause any compiler error, but it makes things not work right, and you don't notice a problem until much later and you have no idea what part of the code is fucking up.
Logged
"Democracy never lasts long. It soon wastes, exhausts and murders itself. There was never a democracy that did not commit suicide." John Adams


Fissile Materials

Lord Misfit

  • Member
  • Offline Offline
  • Posts: 97
  • Naferia's Reign Creator! :D
    • ICQ Messenger - 558371243
    • MSN Messenger - clint20@neo.rr.com
    • AOL Instant Messenger - Mlabs2001
    • Yahoo Instant Messenger - lordmisfit2003@yahoo.com
    • View Profile
    • WWW
    • Email
Re: (Eduke) example code archive
« Reply #46 on: January 26, 2008, 12:37:04 PM »
The worst is when the typo doesn't cause any compiler error, but it makes things not work right, and you don't notice a problem until much later and you have no idea what part of the code is fucking up.

Like accidentally placing a letter in the middle of a label number for example, causing an object to cause all sorts of screwy effects when spawned[such as instantly changing a sector's floor height or making it rise and fall when everytime you walk into that sector for no reason]. I know that's happened to me before in the past as well.

I really really hate those kinds of errors. >_<;
Logged

http://naferia.duke4.net/ - Naferia's Reign: Invasion of the Dark Mistress (For Duke Nukem 3D w/ EDuke32) Version: 5.22.12242012

Version 5.23 will be released sometime after: ?

James

  • Administrator
  • Member
  • Offline Offline
  • Posts: 13835
    • MSN Messenger - Jstanf36@ntlworld.com
    • View Profile
    • WWW
    • Email
Re: (Eduke) example code archive
« Reply #47 on: July 05, 2008, 06:59:32 PM »
Bumping time!

This bit of code I just made up changes underwater movement a bit so that Duke can swim 'up and down' to where the mouse is pointing like modern FPS (not that I can recall any recent modern FPS apart from HL2:EP2 that actually lets you swim in water; even Bioshock, set in a fucking underwater city, doesn't feature any submergible water after the opening :P ) If you think you move up/down too fast simply change the -20 to a slightly lower value or something.
Code: [Select]
ifinwater
ifp prunning
{
getinput[THISACTOR].extbits TEMP2
ifvarand TEMP2 1
{
getplayer[THISACTOR].horiz TEMP
subvar TEMP 100 // 100 horiz equals straight ahead, so take away 100 and make 0 'straight ahead' for this
mulvar TEMP -20
setplayer[THISACTOR].poszv TEMP
}
}
Logged

DavoX

  • Paradise worlds mod
  • Member
  • Offline Offline
  • Posts: 2543
  • Level Designer
    • View Profile
    • WWW
Re: (Eduke) example code archive
« Reply #48 on: July 05, 2008, 10:16:57 PM »
Thanks! Your binary amount of posts mean "22" and with BASE64 it means fg== hopefully that doensn't mean fag hehe...huge offtopic for no reason, I just woke up.

Logged

XTHX2

  • Member
  • Offline Offline
  • Posts: 267
    • MSN Messenger - doruk.aksoy@hotmail.com
    • View Profile
Re: (Eduke) example code archive
« Reply #49 on: August 14, 2008, 06:30:18 PM »
I don't know if this code would be useful but would anyone need a Doom Key Lock system? Anyway I'll still post it :D

Code: [Select]
action IDLE 0 1 1 1

eventloadactor SMARTACTIVATOR
cstat 32768
getactor[THISACTOR].lotag lotag // CHECK'S THE KEY TYPE
getactor[THISACTOR].hitag hitag // OPERATES
getactor[THISACTOR].extra extra
setactor[THISACTOR].lotag 0
setactor[THISACTOR].hitag 0
setactor[THISACTOR].extra 0
enda

useractor notenemy SMARTACTIVATOR 0 IDLE
 
 ifp pfacing
 ifcount 15
 ifpdistl 1200
 ifhitspace
 {
 ifvare lotag 1
 {
 ifvare GOTRED 1
 {
 operateactivators hitag 12
 operaterespawns hitag
 }
 else
 ifvare GOTRED 0
 quote 250
 }
 else
 ifvare lotag 2
 {
 ifvare GOTYELLOW 1
 {
 operateactivators hitag 12
 operaterespawns hitag
 }
 else
 ifvare GOTYELLOW 0
 quote 252
 }
 else
 ifvare lotag 3
 {
 ifvare GOTBLUE 1
 {
 operateactivators hitag 12
 operaterespawns hitag
 }
 else
 ifvare GOTBLUE 0
 quote 251
 }
 }
 
enda

That's a simple code I've written to simulate the doom lock effect. The best part is it is suitable with how many keys you want. Just put these lines to the actor you want it to be a key;
Code: [Select]
getplayervar[THISACTOR].GOTSOMETHINGKEY GOTIT
setvar GOTIT 1
setplayervar[THISACTOR].GOTSOMETHINGKEY GOTIT

That shall make players be able to open that door. A few suggestions for the door that you're going to use;

* Add a Sector Effector of 10 that way you'll prevent people who don't have the key being able to open the door.
* Use an ACTIVATOR to do that effect, as ACTIVATORLOCKED will ruin the effect.
* Put the SMARTACTIVATOR in front and behind of the door as wall-aligned. The Hitag of the SMARTACTIVATOR will activate the thing. The Lotag of it, however will define which key it needs to open, and needs additional editing if you'll add your own keys.

EDIT : Forgot to point out, the quote numbers are for "THIS DOOR REQUIRES X KEY" and such variations...

The ONLY bug I've noticed is that if you keep pressing space while the door is OPENING, NOT CLOSING, it goes back to it's normal height. If somebody could tell me how to fix that, than this code will be flawless... (Also any suggestions are always welcome.)
« Last Edit: August 14, 2008, 07:30:06 PM by XTHX2 »
Logged
---HELLDUKE TC---

Maartn likes to edit his signature. I don't know why, nobody does. His doctor said " Behave good to him, it may turn out that he is back to normal someday "... Everyone is hoping that now :D

Gameplay Footage Video of my Mod.

Daedolon

  • Member
  • Offline Offline
  • Posts: 1394
    • View Profile
    • WWW
Re: (Eduke) example code archive
« Reply #50 on: August 14, 2008, 07:29:50 PM »
This bit of code I just made up changes underwater movement a bit so that Duke can swim 'up and down' to where the mouse is pointing

Really useful code, have to store it somewhere if I'd suddenly feel like working on a mod that has underwater sequences.
Logged

Cody

  • Member
  • Offline Offline
  • Posts: 3196
  • Ling Ling Into Battle Go!
    • MSN Messenger - codynz3000@hotmail.com
    • View Profile
    • WWW
    • Email
Re: (Eduke) example code archive
« Reply #51 on: August 14, 2008, 08:32:24 PM »
I just noticed a few of these examples wernt posted on the Eduke32 wiki so I added them, I hope you dont mide James, feel free to edit them if you think it isnt right.
Logged

Cody

  • Member
  • Offline Offline
  • Posts: 3196
  • Ling Ling Into Battle Go!
    • MSN Messenger - codynz3000@hotmail.com
    • View Profile
    • WWW
    • Email
Re: (Eduke) example code archive
« Reply #52 on: August 14, 2008, 11:56:11 PM »
I just noticed a few of these examples wernt posted on the Eduke32 wiki so I added them, I hope you dont mide James, feel free to edit them if you think it isnt right.

If you were really concerned about whether he wanted his code posted under your name then why didn't you just suggest to him that he do it himself before you posted it?

Uhhh, his name is on it??? Im sure I say his name twice on each example and I dont take any creidt.
Logged

XTHX2

  • Member
  • Offline Offline
  • Posts: 267
    • MSN Messenger - doruk.aksoy@hotmail.com
    • View Profile
Re: (Eduke) example code archive
« Reply #53 on: August 15, 2008, 12:13:50 AM »
I just noticed a few of these examples wernt posted on the Eduke32 wiki so I added them, I hope you dont mide James, feel free to edit them if you think it isnt right.

If you were really concerned about whether he wanted his code posted under your name then why didn't you just suggest to him that he do it himself before you posted it?

Uhhh, his name is on it??? Im sure I say his name twice on each example and I dont take any creidt.

Hey, you were the one who said "I hope you dont mind James" and now you are going to act like you had no reason to be concerned?  James is a nice guy, a lot nicer than me, and he gives his code away freely without complaining, so maybe he doesn't mind that in the example code list, each of his examples are listed as "by The Commander".  But some people would mind.

Hmm... Well that's true so he should change it IMO as well. Since the names right next to the subject is for the owner of the code :P
Logged
---HELLDUKE TC---

Maartn likes to edit his signature. I don't know why, nobody does. His doctor said " Behave good to him, it may turn out that he is back to normal someday "... Everyone is hoping that now :D

Gameplay Footage Video of my Mod.

Cody

  • Member
  • Offline Offline
  • Posts: 3196
  • Ling Ling Into Battle Go!
    • MSN Messenger - codynz3000@hotmail.com
    • View Profile
    • WWW
    • Email
Re: (Eduke) example code archive
« Reply #54 on: August 15, 2008, 12:19:25 AM »
Man, If its that much of a damn problem,
Fuck, I wasnt taking no claim to fame on it...
Logged

XTHX2

  • Member
  • Offline Offline
  • Posts: 267
    • MSN Messenger - doruk.aksoy@hotmail.com
    • View Profile
Re: (Eduke) example code archive
« Reply #55 on: August 15, 2008, 12:20:26 AM »
Man, If its that much of a damn problem,
Fuck, I wasnt taking no claim to fame on it...

We know you don't.... it's just to prevent odd things from happening... Just put your name in the article as, Posted by The Commander and let it be.
Logged
---HELLDUKE TC---

Maartn likes to edit his signature. I don't know why, nobody does. His doctor said " Behave good to him, it may turn out that he is back to normal someday "... Everyone is hoping that now :D

Gameplay Footage Video of my Mod.

Cody

  • Member
  • Offline Offline
  • Posts: 3196
  • Ling Ling Into Battle Go!
    • MSN Messenger - codynz3000@hotmail.com
    • View Profile
    • WWW
    • Email
Re: (Eduke) example code archive
« Reply #56 on: August 15, 2008, 12:22:24 AM »
Nope, I wont have my name any where, seems to make people "pissy"
Logged

DavoX

  • Paradise worlds mod
  • Member
  • Offline Offline
  • Posts: 2543
  • Level Designer
    • View Profile
    • WWW
Re: (Eduke) example code archive
« Reply #57 on: August 15, 2008, 01:32:56 AM »
No one here is pissed off. It's about avoiding n00bs that might think it's your code. We know you don't want to take credit for it. Don't get "pissy" about it ^_^
Logged

Cody

  • Member
  • Offline Offline
  • Posts: 3196
  • Ling Ling Into Battle Go!
    • MSN Messenger - codynz3000@hotmail.com
    • View Profile
    • WWW
    • Email
Re: (Eduke) example code archive
« Reply #58 on: August 15, 2008, 01:50:54 PM »
Ok, Lets end this topic now please. It fixed and changed.  (y)
Logged

James

  • Administrator
  • Member
  • Offline Offline
  • Posts: 13835
    • MSN Messenger - Jstanf36@ntlworld.com
    • View Profile
    • WWW
    • Email
Re: (Eduke) example code archive
« Reply #59 on: September 18, 2008, 04:33:06 PM »
I added a tutorial to the wiki on how to make a sprint key :o
Logged
Pages: 1 2 3 [4] 5
 

(C) 2009, Alejandro Glavic. http://www.amcwebforums.com Go top