Design forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Request - Current Story Height

muril00ng
Booster
Hello everyone,

I have been doing tests in 2D script about REQUEST options, when I write this text:


n = REQUEST ("Story_info", expr, nStories,index1, name, elev, height)

text2 0,0, height


In 2D preview, the value "height" shows the height of Ground Floor. In this case, I want that it shows the height the current floor (if some project has many stories).

In versions before AC 20 the GLOB_CSTORY_HEIGHT variable was a solution.

What do you suggest?

Thanks in advance.
____________________________________
Murilo Noleto
http://www.kilobim.com/
AC 12 - 25 | Win 10 | 16GB | NVidia GTX 1050Ti | AMD Ryzen 7 1700X
5 REPLIES 5

Barry Kelly
Moderator
GLOB_CSTORY_HEIGHT should still be fine if used in the 2D script.
Just don't use it in the Parameter (or Master) script.

Barry.

One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

muril00ng
Booster
Thanks Barry!

Now, if we bring this example to Parameters script.


n = REQUEST ("Story_info", expr, nStories,index1, name, elev, height)

parameters cstory_height = height



When I go to Parameters List, the value of cstory_height parameter (that I have created) is always of the ground floor one.

Is there a simple way to replace the info about the Current Story?
____________________________________
Murilo Noleto
http://www.kilobim.com/
AC 12 - 25 | Win 10 | 16GB | NVidia GTX 1050Ti | AMD Ryzen 7 1700X

Barry Kelly
Moderator
From the GDL manual is says ...
If expr is a numerical expression, it means a story index: only the number of stories and the information on the specified story is returned.
So if you have 'expr' and a number (say 0) then you will get info only for the storey starting at story 0.
Not sure how this works in the USA version as there is no 0 story.

If you set it to 1 then you will get info for story 1.

I think your problem will be you can't REQUEST the story because that can only be done in the 2D script - where you then can't save parameters.
You can't REQUST the current story in the parameter script because this can no longer be done.

If you set 'expr' as a string then you can get all info for all storey as an array.

Again from the manual ...
DIM t[]
n = REQUEST ("STORY_INFO", "", nr, t)
FOR i = 1 TO nr
nr = STR ("%.0m", t [4 * (i - 1) + 1])
name = t [4 * (i - 1) + 2]
elevation = STR ("%m", t [4 * (i - 1) + 3])
height = STR ("%m", t [4 * (i - 1) + 4])
TEXT2 0, -i, nr + "," + name + "," + elevation + "," + height
NEXT i
REQUEST Story_Info will work in 2D and parameter scripts.

I just don't know a way that you can find the current story in the parameter script so you can save a parameter with the height for that story.

Barry.

One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

muril00ng
Booster
I got it!!!!

The solution of my case was to use the "Story_Info" request (as you told me) and creating parameters (with arrays) using the request extracted data.
After that I called the "Home_story" request in order to get the proper "index" of current story.

With a combination of this parameters I could find the current height.

With GLOB_CSTORY_HEIGHT things were pretty much easier. Now the road is more winding.

Thanks Barry for help.
____________________________________
Murilo Noleto
http://www.kilobim.com/
AC 12 - 25 | Win 10 | 16GB | NVidia GTX 1050Ti | AMD Ryzen 7 1700X

im a little late to this but the elevator object is where i learned how to do all of that with the stories. I use it in so many objects.
AC 24, Twinmotion current, Windows 11, Msi 10UG with rtx 3070, wacom intuos pro m, Wacom Cintiq Pro 16, razer Tartarus pro.

Didn't find the answer? Start a new discussion

Labels

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!