[NSFW/Question/Code] RV-007's Noob Mapping/ACS Disaster!

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

Re: RV-007's Noob Mapping Disaster! Code Check.

Post by cocka »

Hold on! I am noob at mapping!
Well, I'm just trying to understand how your mind works. :)

For example:

Code: Select all

!y <= 0 * 65536
When you wrote this what did you have in mind?

!y means that if y was not equal to zero then !y will be. But if y was zero then !y will be 1. (it's similar like saying: y is true if it has a value other than 0, otherwise it's false. !y is true if y is zero, (1 represents the bool value true), otherwise it's false.
Or when you wrote:

Code: Select all

continue;
without knowing what it does. Otherwise it is here: [wiki]Continue[/wiki]

It's almost the same as break except it jumps back to the condition and starts examining it again.
User avatar
RV-007
Posts: 1501
Joined: Fri Sep 02, 2011 9:00 pm
Location: Dying w/ civilization or living after it
Contact:

Re: RV-007's Noob Mapping Disaster! Code Check.

Post by RV-007 »

Don't ask me about the !y. My first attempt was so pathetic. ! was meant for operands, not variables or values. As for loops, that's a different story.
http://zdoom.org/wiki/A_quick_beginner's_guide_to_ACS#Conditional_repeating_loops_.28while.29 wrote:NOTE ABOUT UNTIL LOOPS:
To do an until loop, simply add a ! (not) sign at the beginning (eg. while(!(i>0))
I should have read the Continue article more carefully.
http://zdoom.org/wiki/Continue wrote:continue is used in a for, do, or while loop to end the current iteration, returning to the start of the loop.
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

Re: RV-007's Noob Mapping Disaster! Code Check.

Post by cocka »

My first attempt was so pathetic.
Never mind. :)
simply add a ! (not) sign at the beginning (eg. while(!(i>0))
But that's an expression. ! is a logical NOT operator. So it's exactly the same as if you wrote until(i<=0).

while loop: It jumps to the { block } part if the condition in round brackets is true, the block repeats itself while the condition is true. If it's false, the block will be omitted and the loop stops. The condition can also be a compound expression.

until loop: It jumps to the { block } part if the condition in round brackets is false, the block repeats itself while the condition is false. If it's true, the block will be omitted and the loop stops.

So the main idea here is:

while: entering into the loop when the condition is true and remaining there unless the condition is false. So exiting happens when the condition is false.
until: entering into the loop when the condition is false and remaining there unless the condition is true. So exiting happens when the condition is true.
User avatar
RV-007
Posts: 1501
Joined: Fri Sep 02, 2011 9:00 pm
Location: Dying w/ civilization or living after it
Contact:

Re: RV-007's Noob Mapping Disaster! Code Check.

Post by RV-007 »

I can see that there are many ways to place variables (and the same goes the exclusive rule). There are variables (outside script, script parameters [useful for script dependent on other scripts/variables/etc {example is multiple transactions of different things between different accounts}]), and inside script. What I am trying to get at is the many uses a variable can do just by being placed around the script name.

As for the Elevator (Inside) Menu Interface script, I have to challenge the proposed solution. If the solution was based on the old elevator up/down menu, then you can forget on what I would say (like I had say, my first attempt was pathetic [oh yeah! B-)]).
Spoiler: blah stuff about choices
There are other errors that can found in my file. I don't know about DoomBuilder so my apologies in advance. I will try to rework DIALOGUE and libraries (need to find some noob practice excuse [I got ideas, but it's too far fetched at the moment). I am a ACS scripting noob.
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

Re: RV-007's Noob Mapping Disaster! Code Check.

Post by cocka »

So far, I see no values being defined.
It's simple. You can always set parameters where you set the acs_execute itself and its derivatives.

First option: Have a look at the picture attached, it shows that you can define arguments/parameters in a thing or a linedef window.

Second option is to set parameters in another script.. for example you have a script containing

Code: Select all

ACS_Execute(scriptnum, mapnum, parameter1, parameter2, parameter3);
Third option is to set parameters in a DIALOGUE.

Code: Select all

special = 80; // what is that damn special? damn ACS.
arg0 = 10; // on the following condition(s)
arg1 = 1; // on the following condition(s)
arg2 = 0; // on the following condition(s)
arg3 = 0; // on the following condition(s)
arg4 = 0; // on the following condition(s)
Here arg2 is the first parameter, arg3 is the second and arg4 is the third.

Fourth option is to set them in DECORATE.
User avatar
RV-007
Posts: 1501
Joined: Fri Sep 02, 2011 9:00 pm
Location: Dying w/ civilization or living after it
Contact:

Re: RV-007's Noob Mapping Disaster! Code Check.

Post by RV-007 »

In respect to programming language compared to scripting language, anyone can always create and define their own parameters (with a library or no library).

I have set the parameter values in the DIALOGUE lump. I was hoping that the choices will be able to affect parameters. Somehow, I think still have to define the argument as s_arg# = choice (from DIALOGUE lump). s_arg# seems like an argument for string values. Unfortunately, I don't think I have the current intelligence to do that definition. Of course, the code for ZDoom is mostly for scripting language, hence ACS.
Spoiler: Script and s_arg# parameters
Spoiler: Dialogue and s_arg# parameters
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

Re: RV-007's Noob Mapping Disaster! Code Check.

Post by cocka »

I was hoping that the choices will be able to affect parameters.
Nope, when you are in game. If you haven't set any parameters in builder's DIALOGUE editor, then why do you expect that it will work?

Oh dear! Have you looked at the image I attached earlier?!

Code: Select all

Script 6 (int scriptnum, int map, int s_arg1)
The script number and map number ARE NOT considered to be script parameters! All the action specials have in fact 6 arguments, each consisting of 1 byte.

1: the number of action special (if it's ACS_Execute then this number will be 80)
2: in this case if the first arg is 80, then this will be the script number and you set that number after the word "script" in the header of your script!
3: this will be the map number where the script would actually run
4: this is the FIRST parameter you can set after the script number in round brackets
5: this is the SECOND parameter you can set after the script number in round brackets
6: this is the THIRD parameter you can set after the script number in round brackets
tutorial2.png
tutorial2.png (8.73 KiB) Viewed 814 times
The only exception here is [wiki]ACS_ExecuteWithResult[/wiki] where you can have four parameters in the header of your script as there is no map number there, so you can also set a parameter value in the textbox where you would normally write the map number!
User avatar
RV-007
Posts: 1501
Joined: Fri Sep 02, 2011 9:00 pm
Location: Dying w/ civilization or living after it
Contact:

Re: RV-007's Noob Mapping Disaster! Code Check.

Post by RV-007 »

I give up. I need a baby spoon. Give me example that can work with that 3D Floor elevator.
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

Re: RV-007's Noob Mapping Disaster! Code Check.

Post by cocka »

Can you send the latest version? So I can fix these problems.
User avatar
RV-007
Posts: 1501
Joined: Fri Sep 02, 2011 9:00 pm
Location: Dying w/ civilization or living after it
Contact:

Re: RV-007's Noob Mapping Disaster! Code Check.

Post by RV-007 »

I usually update the file when I come up with a post that mentions some kind of change in the file. It's not explicit, but it sure saves some (little) time. I surely think that the scripting language constrains on how some scripts be written, but that's my opinion. https://dl.dropboxusercontent.com/u/353 ... my_map.wad
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

Re: RV-007's Noob Mapping Disaster! Code Check.

Post by cocka »

OK here is the correct version:

https://drive.google.com/file/d/0B97Can ... sp=sharing

So I've written just one script for the two switches and for the conversation dialogue. Its new number is 5. There are two parameters there:

Code: Select all

(int floor, int which)
If you call the elevator from a specific floor then you'll press a switch so the first parameter will be 0 as the floor is not relevant here because it can be calculated with the help of GetActorFloorZ, the second will be 1 to distinguish the two different operation of the different script parts.

But if you are in the lift then you'll specify on which floor would you like to get. So the second parameter will be 0 and the first will be gained from the DIALOGUE.

Code: Select all

special = 80; // what is that damn special? damn ACS.
arg0 = 5; // on the following condition(s) (script number)
arg1 = 1; // on the following condition(s) (map number)
arg2 = 0; // on the following condition(s) FIRST parameter
arg3 = 0; // on the following condition(s) SECOND parameter
arg4 = 0; // on the following condition(s) THIRD parameter

Code: Select all

arg2 = floor
I'm sorry but I weeded out those tremendous amount of comment you've left there. It's rather confusing. But anyway, you can do with the file what you want. :D
User avatar
RV-007
Posts: 1501
Joined: Fri Sep 02, 2011 9:00 pm
Location: Dying w/ civilization or living after it
Contact:

Re: RV-007's Noob Mapping Disaster! Code Check.

Post by RV-007 »

Alright, thanks, this will take a while for me to decipher. I know that floor is definitely s_arg2 from the DIALOGUE lump, thanks to parameter int floor of Script 5. heightofffloor is 128, and floorz = floor*heightofffloor; is the ceiling height. However, I don't know where heightofffloor as value 128 is being defined. There are two if statements working so two actions are being done in the script. I don't know where parameter int which values comes from, except that s_arg3 is all zero. I guess there is a possibility that something clunks up.

Other news, I found out how to make 3D Floor materials/mass. Now the elevator looks real. All it took was a flag parameter switch of either 0 (+ 3dmidtex bridge [yes, there is that no decals problem {no empty space to support decals}]) or 8. Flag 0 allows solid wall and 3dmidtex supposedly paints that wall. Flag 8 allows non-solid wall (player can pass thru like in TransferHeight or Deep Water tutorial. cocka's elevator script just need #define heightoffloor 128 to #define heightoffloor 256 (yes, all the current stuff in this topic to this post needs to have the same multiples).

Next would be to start making stuff in each 3D Floor space control sector by either in the 3D Floor space control sectors themselves, 3D Floor material control sectors, or something else. I would use the model sector, but I doubt that it could render different map shapes/things in each floor. Then I will be making steps, 3dmidtex bridges, and stuff to transverse between floors.
Last edited by RV-007 on Sat May 10, 2014 3:42 pm, edited 3 times in total.
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

Re: RV-007's Noob Mapping Disaster! Code Check.

Post by cocka »

Here:

Code: Select all

#define heightoffloor 128
User avatar
RV-007
Posts: 1501
Joined: Fri Sep 02, 2011 9:00 pm
Location: Dying w/ civilization or living after it
Contact:

Re: RV-007's Noob Mapping Disaster! Code Check.

Post by RV-007 »

I will get to the #define part later, I hadn't used library just yet. The function method is something I heard of (maybe even practiced before in a programming class), but I have to see the function for ZDoom for myself.
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

Re: RV-007's Noob Mapping Disaster! Code Check.

Post by cocka »

I don't know where parameter int which values comes from, except that s_arg3 is all zero.
I've already written how it works. The variable which here tells you whether the script has previously been activated by the switches (the second parameter is 1 in this case) OR by selecting a dialogue option (the second parameter is 0 in this case).
there is a possibility that something clunks up.
What did you mean by that?

This is the latest version of my test wad where I tested a multi-level building with an elevator.

https://drive.google.com/file/d/0B97Can ... sp=sharing

There are 4 switches in the lift. One for going up by one floor, one for going down by one floor, a stop button terminating the current movement and another one with a floor selector.

It is a Hexen map in UDMF format!
Locked

Return to “Editing (Archive)”