Jump to content

ademes

Mitglieder
  • Gesamte Inhalte

    131
  • Benutzer seit

  • Letzter Besuch

Alle erstellten Inhalte von ademes

  1. Hi Goetz, Thank you for your explanations, but you didn't answer to this question. André
  2. hello, Here are the problems encountered when trying "user-defined" scripts. As one can see in the attached screens, I call the "user-defined" Grill giving only one parameter "vehicle" that is the trigger to the engine defined in the event "train enters track". the parameter has been given the "object" as type. The called script execute only one instruction : print (vehicle.name) and this results in a print "Nothing" as seen on the event trace. It seems to be impossible to communicate a table to the called script. Regards André
  3. Hi Goetz Thank you for your help. Even if it occurs in the same module? Currently, I cannot sort the events in the sample i gave to you earlier. Have I to put the "user-defined" event in a separate module to be able to sort it? That's great and exactly What I need! I didn't realized that the (same) action restart automatically after the delay. Regards André
  4. Sorry, here are the 2 scripts André
  5. Hi Goetz, I have another problem : Look at the 2 Lua scripts, one in the case "train enters track" and the 2nd whem "timer expires". The first one works good, but the second one gives an error condition "script error (10) : attempt to index a nil value (global 'vehicle')". Is it because, as in V4, the trigger in the case of "timer expires" points only to the timer's name? Regards André
  6. Hi Goetz, The first situation, I already use it. The second situation (different triggers), I"ll try asap. Just to know : when I define the "user defined" event under the first Event definition, the new event is physically placed after all other existent events and I cannot move it up to be placed as the first one in the list. Parameters : may I, for example, give the name of a vekicle and use it as an object? Thank you
  7. Hi, Is it possible to have a double 1st condition for an event? For example : train enters a track or timer expired? Thank you André
  8. Hi Goetz and Neo, Thank you for explanation. I'll try this soon. André
  9. …. And is it possible to define a table as an Object.variable? André
  10. Hi, Next question : how to define a table in Lua that is available to all events? I mean, there are global variables ; is it possible to have a global table? Thank you for your help André
  11. Hi Goetz and Neo Thank you for your answers. I continue to learn the Lua language more deeper . Regards André
  12. Hi Goetz, Thank you and, of course, it works! So my example was too simple, I guess. In fact, my concern is to build a table where some some gap may exists like, for example : Pos = { T1 = {0, , 1}, This produce a Script error (10) T2 = {1, 0}, T3 = {1, 1, 0} } Pos = { T1 = {0, nil, 1}, This is OK for the syntax but produce an error while attempting to toggle with a nil value T2 = {1, 0}, T3 = {1, 1, 0} } Pos = { T1 = {0, "" , 1}, This is OK for the syntax but "" is interpreted as 0 (zero) T2 = {1, 0}, T3 = {1, 1, 0} } So, my final objective is to create a table to pilot my trains according to defined trajects; currently, I'm thinking and searching a good way to do that and tables seem to be the best solution. Regards André
  13. Hello Goetz, one question concerning the tables : Imagine a layout where you have 3 switches at the entry of a station. To go to the plateform n°1, you only need the first switch; for plateform n° 2, one need switches 1 & 2 and to go to plateform 3, one need the 3 switches. I've build the Following table containing the pos required for the switches for the tree trajects T1, T2 and T3: Pos = { T1 = {0, track.variables["switch2"].state, track.variables["switch3"].state}, T2 = {1, 0, track.variables["switch3"].state}, T3 = {1, 1, 0} } where switch1, switch2 and switch3 are object variables (type = object) with the real name of the switches SW1, SW2 ans SW3 and the actions trajet = vehicle.variables["Trajet"] $("SW1").state = Pos[trajet][1] $("SW2").state = Pos[trajet][2] $("SW3").state = Pos[trajet][3] So only the needed switches are toggled. But do you have another method to replace the "track.variables["switch3"].state in order to avoid the toggle of the unused switch? Many Thanks André
  14. Hello, Is there a way to apply the same value to a lot (list) of variables? Something like : Set the value "#" to all "reserve" object variables Or is it possible in Lua? When I switch the "start button", I first want to reset certain variables and captions to the initial value, for example setting the variable "reserve" present on every switches in the layout to the value "#". Thank you André
  15. Hi Andy and BahnLand, Thank you both for your explanations, but be sure that I'm learning V5 step by step and I'm aware of the new way to write down an Event, including the usage of the Keywords and the Triggers. And so, I agree with Andy that his solution is ok. But the question I was asking is finally the following : the translation of the V4 formula gives a sequence of "wheels" that look strange to me as I cannot reproduce it from scratch. That's it! Am I so silly?? This to say that it becomes urgent to explain more deeply all those new mechanisms and tips to the users. Otherwise, you probably will be obliged to answer more and more to the same questions. If I can help, just tell me how. Regards André
  16. Hi Goetz, You speak about Trigger as option for "variable extend"; I speak about Trigger as option for "Name Property". Please let me know if you are able to create from scratch the sequence shown in my example and how you do that. This correspond to the instruction in V4 : Train enter a track/street : $_Trigger2._Name action : set variable name : $($(_Trigger2._Name).switch1).status Value : $($(_Trigger2._Name).switch1).Reserve Thank you André
  17. Hello, I have a problem : when I open a layout from V4 into V5, a "set variable" has been translated into the result in the image below. But I cannot reproduce that sequence fron scratch in V5 as I don't seen the property "trigger" under the property "Property". Thank you André
  18. Hello, I've the following questions concerning the events and espescially the new "IF" condition : When one goes from the event's conditions to Lua and changes something in the Lua script, is it possible to go back to the standard 3D conditions. In the sample D Lua below, one can see that the buttons to go back are grised after I add the "else" condition in Lua. In the Demo V5, the "else" condition exists in the 3d event's definition (see "If-else-1") as confirmed in Lua (see "If-else-2"). The question is : why is the last action exeuted in the else condition; I see no difference between the conditions with the value 1 and 2 in the standard 3d development? Notice also that, here, one can switch from 3d to Lua and back. Thank you
  19. Andy, First, you treat me as "silly" which is not very sympathetic! Next, please understand english! I don't want to remove that button witch, you're right, is very important. NO! What I suggest is to change the physical position of that button so that it become highlighted as it concerns ALL object's variables and not only one. I hope now that it is clear for you and, Andy, it is just a suggestion! No more. Regards André
  20. Hi Andy, For sure, I will come to LUA. But in the mean time, I also try to understand how V5 is working >< V4. And all I saw up to now enjoy me because the major changes made in V5 permits a lot of thing impossible in V4. During that task (learning), I discover some possible improvements and therefore I gave them as suggestions. Not only for me, but for all users, beginners or not. And, Andy, a suggestion I just realize now is the following : aside the fully description of the functionnalities of V5, one should also open a "Tip" directory or thema in the forum where any user can pick-up good ideas to solve the encountered problems. What do you think about that? Regards André
  21. Hi Neo, Just small suggestions concerning the variables : The button (see below) used to look to the variables now opens a window showing all variables included into the objects giving the possiblity to see, change, copy and delete all those variables. Suggestion : put that button elsewhere and no more attached to a specific object Even if copy one or more variables from on object to another, using multi-selection, it is not possible to make (export) a list of all these variables. Suggestion : permit the selection of more than one object from the list in order to put that selection into the clipboard.
  22. Hi Neo, Thank you for your answers : Export : ok to wait for the official version delivery. You asked why to export : there could be some reasons like print read all events in one document if an additionnal butom "Import" comes with the export one (seems not being foreseen yet), the copy of some events may be done between different layouts Variable list : in V4, under the buttom "timer & variables", one can have a list of all variables (global as object.variables); in V5, this is no more available. You suggest to right-clic on the special buttom on the corresponding objet, but this is not possible if the event window is open ==> an independant list is then very usefull Trigger : if you have a condition "train enter track", vehicule = any, what will be the meaning of Trigger = vehicule? Does it mean that one can address an engine using indirection from another engine? this sound a little bit strange to me. Thank you and regards André
  23. Hello, I try to read the different interventions, but it is very difficult as they are written in german and translation takes time. So, sorry if my questions were already posted and replied : In V4, there was a button to export the events in order, for example, to print them. I don't find this option in V5 In V4, one can use Trigger1 & 2, depending on the action or condition expressed; now, in V5, these were removed and replaced by Trigger but I have some difficulties to see how to use it now. For example, in the demo furnished with V5, I discover that "vehicule located on track" has the following parameters : - Vehicule : Any - Trigger : one have the choice between "Vehicule", new track or last track - What is the meaning of these parameters ? - Name : name of the variable What is the differnece between "Variable" and "Variable (Extended)"? Is it possible to have a list of all variables and how? In general, is it possible to have a detailled description of the different parameters and the good way to use them? Thank you for your comprehension Rgards André
  24. Hi Neo I don't know if this could help, but I translate your document in english. If you are interested, please let me know how I can transmit it : it's a word document! Regards André
×
×
  • Neu erstellen...