Advanced Search

Author Topic: How do "I" do THAT in Doom Builder?  (Read 218345 times)

0 Members and 1 Guest are viewing this topic.

December 07, 2011, 08:56:30 PM
Reply #165

Offline Asd967

  • MM8BDM MM8 Contributor
  • *
  • Date Registered: November 01, 2010, 03:59:45 AM

    • View Profile
Re: How do "I" do THAT in Doom Builder?
« Reply #165 on: December 07, 2011, 08:56:30 PM »
Not really.
Just make sure you don't use Par on the level's information.
Then make another script with a different number.
For instance:

Code: [Select]
script 1 OPEN
{
   if(GetCvar("ctf")==1){
      if(BlueScore() == GetCVar("pointlimit") - 1 || RedScore() == GetCVar("pointlimit") - 1){
      SetMusic("MM1BOSS");
      }
   }
   if(GetCvar("oneflagctf")==1){
      if(BlueScore() == GetCVar("pointlimit") - 1 || RedScore() == GetCVar("pointlimit") - 1){
      SetMusic("MM1BOSS");
      }
   }
   if(GetCvar("ctf")==0){
   if(GetCvar("oneflagctf")==0){
   terminate;
   }
   }
   Delay(35*2);
   restart;
}

Just put this on every CTF map you make and change the Music if you want.

December 08, 2011, 12:51:28 AM
Reply #166

Offline Knux

  • Standard Member
  • *
  • Date Registered: September 04, 2009, 06:56:01 AM

    • View Profile
Re: How do "I" do THAT in Doom Builder?
« Reply #166 on: December 08, 2011, 12:51:28 AM »
I just tested the script, and nothing happened until I figured out I had to click Compile Scripts. This is exactly what I was looking for, so thanks very much!  :D

December 08, 2011, 12:53:30 AM
Reply #167

Offline Duora Super Gyro

  • A Nightmare before Christmas

  • The neighborhood instant moe otaku.
  • **
  • Date Registered: January 19, 2011, 06:55:02 PM

    • View Profile
    • My Tumblr
Re: How do "I" do THAT in Doom Builder?
« Reply #167 on: December 08, 2011, 12:53:30 AM »
thanks Asd967. I got exactly what I was looking for out of this.

December 08, 2011, 02:06:37 AM
Reply #168

Offline Asd967

  • MM8BDM MM8 Contributor
  • *
  • Date Registered: November 01, 2010, 03:59:45 AM

    • View Profile
Re: How do "I" do THAT in Doom Builder?
« Reply #168 on: December 08, 2011, 02:06:37 AM »
Quote from: "Knux"
I just tested the script, and nothing happened until I figured out I had to click Compile Scripts. This is exactly what I was looking for, so thanks very much!  :D
Well, yeah, that's one thing ACS likes to trick you over. It saves nothing until you compile it, differently from your usual DECORATE coding that is actually implemented as soon as you click save...

No problem. I like to help.

December 08, 2011, 03:37:11 AM
Reply #169

Offline Joseph Collins

  • MM8BDM Contributor

  • Lv. 33 Pogo Fan
  • *
  • Date Registered: October 09, 2010, 04:47:35 AM

    • View Profile
    • http://josephlithius.tumblr.com
Re: How do "I" do THAT in Doom Builder?
« Reply #169 on: December 08, 2011, 03:37:11 AM »
Okay!  It took about an hour-and-a-half of dinking around, but I think I've refined the code Asd967 provided to allow each team to have both their own "point limit warning" theme as well as their own victory ditty.  Check it out:
(click to show/hide)
The tricky part was figuring out how to make the two music messages not collide with each other in the likely event the teams are tied.  The simple solution for that is to simply have the script restart if that happened.  I'm not sure how it manages to do so, but it still manages to hop over the restart and read if either team has a score equal to the point limit, then play the victory ditty and terminate itself (to avoid any potential music mishaps as per the IX Pack.).  I also merged the "if game mode is CTF/1FCTF" codes together up top.  I couldn't do that below because that's not an if/else sort of thing, but rather "if the game mode is not CTF and not 1FCTF".

You know, I'm very happy with this scripting.  It's compact, neat, and doesn't use a million unnecessary variables.  I'm sure it could be edited further to allow such conditional music for "close victory" or "both teams are tied" situations, but for now, I think this works.

December 08, 2011, 04:24:18 AM
Reply #170

Offline Asd967

  • MM8BDM MM8 Contributor
  • *
  • Date Registered: November 01, 2010, 03:59:45 AM

    • View Profile
Re: How do "I" do THAT in Doom Builder?
« Reply #170 on: December 08, 2011, 04:24:18 AM »
Actually, your ACS code will generate a lot of lag if you use Delay(1); and Restart; simply because it'll run checks so much times.
Admitted, your code is good for the checks, but I'd use this one:

(click to show/hide)

This code makes less checks run per second, and eliminates the checks that are unneded. Therefore, less lag.
By the way, if you're using this on a per map basis, you don't need to check if the game's CTF or not since the map is only playable in CTF itself.
This code is untested, but by theory, it should work.
The only downside is that it needs 3 ACS Scripts slots. But for maps you have near 100 scripts, so that's not much troubling.

December 08, 2011, 04:53:18 AM
Reply #171

Offline Joseph Collins

  • MM8BDM Contributor

  • Lv. 33 Pogo Fan
  • *
  • Date Registered: October 09, 2010, 04:47:35 AM

    • View Profile
    • http://josephlithius.tumblr.com
Re: How do "I" do THAT in Doom Builder?
« Reply #171 on: December 08, 2011, 04:53:18 AM »
Eh.  I personally like the delay to be miniscule.  Something seems odd about triggering the music, then having to wait up to 2 seconds for it to actually start playing.  But that's just me.  I also see you went ahead and added one of my possibilities in there; the "if teams are tied" coding.  That's a nice touch.

So... yeah.  A little playtesting and it would appear as though your code is even more streamlined than what I came up with, not to mention it works just as well, if not better due to the further optimizations.  And on top of that, it's even smaller thanks to the lack of a map-type check. (Which is a good point.  Most people don't make multi-purpose maps.)  Well done, sir.  Well done.

December 08, 2011, 04:59:12 AM
Reply #172

Offline Asd967

  • MM8BDM MM8 Contributor
  • *
  • Date Registered: November 01, 2010, 03:59:45 AM

    • View Profile
Re: How do "I" do THAT in Doom Builder?
« Reply #172 on: December 08, 2011, 04:59:12 AM »
Thanks. Feel free to use it on your maps, no credit needed.
By the way, I like helping, so, if you need some help, just ask...
Coding optimization is very important to use since MM8BDM already uses a lot of checks like the Jump Cancelling script, which is run for every player, every tic and has a lot of checks and inventory management going on.

December 08, 2011, 12:04:15 PM
Reply #173

Offline Duora Super Gyro

  • A Nightmare before Christmas

  • The neighborhood instant moe otaku.
  • **
  • Date Registered: January 19, 2011, 06:55:02 PM

    • View Profile
    • My Tumblr
Re: How do "I" do THAT in Doom Builder?
« Reply #173 on: December 08, 2011, 12:04:15 PM »
Quote from: "Asd967"
Not really.
Just make sure you don't use Par on the level's information.
Then make another script with a different number.
For instance:

Code: [Select]
script 1 OPEN
{
   if(GetCvar("ctf")==1){
      if(BlueScore() == GetCVar("pointlimit") - 1 || RedScore() == GetCVar("pointlimit") - 1){
      SetMusic("MM1BOSS");
      }
   }
   if(GetCvar("oneflagctf")==1){
      if(BlueScore() == GetCVar("pointlimit") - 1 || RedScore() == GetCVar("pointlimit") - 1){
      SetMusic("MM1BOSS");
      }
   }
   if(GetCvar("ctf")==0){
   if(GetCvar("oneflagctf")==0){
   terminate;
   }
   }
   Delay(35*2);
   restart;
}

Just put this on every CTF map you make and change the Music if you want.

Wow. I just made a simple edit and copy so both teams could have a theme.

(click to show/hide)

EDIT: And then I changed the Music code...thing...

December 08, 2011, 05:24:20 PM
Reply #174

Offline Asd967

  • MM8BDM MM8 Contributor
  • *
  • Date Registered: November 01, 2010, 03:59:45 AM

    • View Profile
Re: How do "I" do THAT in Doom Builder?
« Reply #174 on: December 08, 2011, 05:24:20 PM »
Uuh... in the last page, the last code submitted has each team with its own theme, as ewll as victory music and tie theme...

It's this one, in case you are wondering:
(click to show/hide)

December 08, 2011, 09:06:06 PM
Reply #175

Offline Duora Super Gyro

  • A Nightmare before Christmas

  • The neighborhood instant moe otaku.
  • **
  • Date Registered: January 19, 2011, 06:55:02 PM

    • View Profile
    • My Tumblr
Re: How do "I" do THAT in Doom Builder?
« Reply #175 on: December 08, 2011, 09:06:06 PM »
Oh... wish I checked the last page now.

December 08, 2011, 11:29:40 PM
Reply #176

Offline Joseph Collins

  • MM8BDM Contributor

  • Lv. 33 Pogo Fan
  • *
  • Date Registered: October 09, 2010, 04:47:35 AM

    • View Profile
    • http://josephlithius.tumblr.com
Re: How do "I" do THAT in Doom Builder?
« Reply #176 on: December 08, 2011, 11:29:40 PM »
It's never too late!  Unless, you know, you already submitted your WAD to Fathax or something.  X3

December 09, 2011, 11:01:17 PM
Reply #177

Offline Duora Super Gyro

  • A Nightmare before Christmas

  • The neighborhood instant moe otaku.
  • **
  • Date Registered: January 19, 2011, 06:55:02 PM

    • View Profile
    • My Tumblr
Re: How do "I" do THAT in Doom Builder?
« Reply #177 on: December 09, 2011, 11:01:17 PM »
Does anybody have any idea how to change Myrocs KOTH into a an awsome domination map(3 hills instead of 1).
I know this would be pretty hard.

December 10, 2011, 11:08:04 AM
Reply #178

Offline Myroc

  • MM8BDM MM8 Contributor

  • Tyst! Jag ser på TV!
  • *****
  • Date Registered: October 13, 2010, 08:35:35 PM

    • View Profile
Re: How do "I" do THAT in Doom Builder?
« Reply #178 on: December 10, 2011, 11:08:04 AM »
Quote from: "Duora Super Gyro"
Does anybody have any idea how to change Myrocs KOTH into a an awsome domination map(3 hills instead of 1).
I know this would be pretty hard.
Actually, this is quite simple. Or at least, it is in the latest unreleased version I'm carrying around, whose code is mostly finalized, it just needs optimization. I can't remember if the currently released one supports multiple points yet, but I know this version does. I'll release it in a few and cross-reference the rather simple method in that thread.

First of all, open up the code and track down these lines. They're in the beginning of the script, but not next to each other.

Code: [Select]
#DEFINE controlpoints 1
...
str pointname[controlpoints] = {"Control Point 1"};
str pointname2[controlpoints] = {"Point 1"}; //I don't have the old code at hand so I don't remember exactly what I named these.

The first line is basic, this defines how many control points there are. The second and third line are the names for the control points themselves, although they are ignored in my code if there's only one point (It's simply called "the point" when captured). You want to add names to the second and third control point here like this:

Code: [Select]
#DEFINE controlpoints 3
...
str pointname[controlpoints] = {"Control Point 1", "Control Point 2", "Control Point 3"}; //These names are mentioned when the points change owners, eg "Dr. Wily Team took control of Control Point 1"
str pointname2[controlpoints] = {"Point 1", "Point 2", "Point 3"}; //These names are located on the HUD, and state which team controls which point at the present moment.

Now you need to add the points to the map themselves. Make a small sector that constitues the point, and then make a small 64x64 sector centered inside this sector. You need to repeat this and the following steps for each point you want to add. Here's two screenshots to demonstrate how I myself make the points.

(click to show/hide)
The one to the right is the old point, the left is the one we want to add. Note the CRYSFLR4 texture in the middle of these, this is the 64x64 sector you made. The game changes this texture to reflect which team controls the respective points.

Select the outer 8 octagonal lines. Edit their action special to Script Execute (80), referincing script number 1 and where script argument 1 is point number - 1. E.g, the first point is 0, the second is 1, and so on and so forth. Also check the box that says "repeatable action". Whenever a player crosses this line, the game runs the script, where the script argument is used to determine which point it is. The team of the player who activated the script is checked and compared to the current controller, and if it differs, changes the controlling team and prints out a message saying that the point has been captured.

Now, select the inner 64x64 sector, and give it the tag corresponding to it's point number (not point number - 1, as before). Then select the lines that the sector consists of, give them the Line Identification action special (121), and assign them the same tag. Also check "lower unpegged", set the Y-texture offset to 128 to both sides, and assign them the same CRYSFLR4 texture as the point itself. These textures are changed to reflect whoever controls the point. The script technically works without them, you can capture the point all the same without this step, but you wouldn't be able to know who controls the point by looking at it.

That should be the gist of it. I'd add more explanation as to how the code works, although you'd require some basic knowledge of programming logic to fully understand how it works, and I myself am not that used to english coding terminology, being taught in swedish and all.

Anyway, I'll go release that updated version right away.

December 31, 2011, 03:40:49 AM
Reply #179

Offline -FiniteZero-

  • Standard Member

  • I'm somwhere.
  • Date Registered: March 06, 2011, 04:34:30 PM

    • View Profile
    • http://s4.zetaboards.com/Mega_Storm/index/
Re: How do "I" do THAT in Doom Builder?
« Reply #179 on: December 31, 2011, 03:40:49 AM »
Bump, but whatever.

How would you get it so that pressing use on a line gets you ammo or health?