Jump to content

Gertrude Babenco

Resident
  • Posts

    8
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Well, changing the scan angle, as you suggested me, the car moves. Strangely, but it moves. Strangely because: 1°) I need to touch the car for moving to each point. 2°) It follows a line which is not the determinated points (I guess I made a mistake calculating the X and Y virtual positions). 3°) The car turns 90° on itself before moving and at the end of the movement. I looked at your SL profile this afternoon and saw that you sometimes accept to work on scripts. Maybe, I could wait for your come back in SL (when you'll be able to "babysit" your avatar again^^) and show you the situation. Obviously, I would pay you: I feel ashamed to have made you spent so much time for me. Why a sensor? because the car would detect the nature (= name) of the piece of road: if it detects a straight line, it would activate the straight scenario and if it detects a turning piece, it would turn. Thank you again.
  2. OK, I test your script, then I tell you. Hoping your exile from SL is not too difficult ^^.
  3. Well, I tried to obtain something during the all day and, feeling to be "as dumb as I look" ^^, I didn't dare communicate my mistaken script... Well I have an issue with llRotLookAt (error: function call mismatches...) and maybe the script I made is full of others errors. Here it is: integer target_id;string SensorTargetName = "turning90";float scandistance = 11.0;float scanangle = 0.8; // Radianslist offsets = [<0.0,0.0,0.0>,<0.1363,0.8127,0.0>,<0.3611,0.8920,0.0>,<0.6719,0.8259,0.0>, <0.8365,0.620,0.0>,<0.9889,0.3995,0.0>, <0.9527,0.2249,0.0> ];integer count;move() { //llSetRot(ZERO_VECTOR);vector new_target = llGetPos() + (vector)llList2String(offsets,0) ;llMoveToTarget(new_target, 5.0);llRotLookAt(llRotBetween(<1.0,0.0,0.0>, llVecNorm(new_target - llGetPos()), 1.0, 0.4));// Second positionnew_target += llGetPos() + (vector)llList2String(offsets,1); //This replaces the first target with a new onellMoveToTarget(new_target, 5.0);llRotLookAt(llRotBetween(<1.0,0.0,0.0>, llVecNorm(new_target - llGetPos()), 1.0, 0.4));// Third positionnew_target += llGetPos() + (vector)llList2String(offsets,2); //This replaces it againllMoveToTarget(new_target, 5.0);llRotLookAt(llRotBetween(<1.0,0.0,0.0>, llVecNorm(new_target - llGetPos()), 1.0, 0.4)); // 4th positionnew_target += llGetPos() + (vector)llList2String(offsets,3); //This replaces it againllMoveToTarget(new_target, 5.0); llRotLookAt(llRotBetween(<1.0,0.0,0.0>, llVecNorm(new_target - llGetPos()), 1.0, 0.4)); // 5th positionnew_target += llGetPos() + (vector)llList2String(offsets,4); //This replaces it againllMoveToTarget(new_target, 5.0); llRotLookAt(llRotBetween(<1.0,0.0,0.0>, llVecNorm(new_target - llGetPos()), 1.0, 0.4));// 6th positionnew_target += llGetPos() + (vector)llList2String(offsets,5); //This replaces it againllMoveToTarget(new_target, 5.0);llRotLookAt(llRotBetween(<1.0,0.0,0.0>, llVecNorm(new_target - llGetPos()), 1.0, 0.4));}default{ state_entry() { llSetStatus(STATUS_PHYSICS,FALSE); llSetRot(ZERO_ROTATION); count = 0; } touch_start(integer total_number) { llSetStatus(STATUS_PHYSICS,TRUE); llSetBuoyancy(1.0); llSensor(SensorTargetName,"",ACTIVE | PASSIVE,20.0,PI); } sensor(integer num) { move(); // First position}} If I could resolve the error-call-mismatches, should I indicate the Z-rotations (example: 9°) in the llRotBetween(<1.0,0.0,9.0> for each "postitions"? Well, I'm very embarrassed to ask your help again. Conscious of the time you've already spent for me, well, thanks a lot anyway.
  4. Wow, thank you so much. I try to adapt it tomorrow (because it is very late here) then I tell you about it, I promise. I hope I'll be able to...
  5. "If you want to use that other method, then you need to put the positions (vectors) of the waypoints into a global list instead of the names of the waypoints. You do not need to calculate anything from the first target -- just enter the positions in the list as vectors." Sure, but if you need to change your waypoint or set it on another land, you have to change all the data in your script. If your car movement is determinated by a segment of the road, it would be easier and faster. I don't understand why it would be so complex to code it (for someone who can manipulate scripts like you, not for me, lol), using points calculated relatively to a beginning point/root: maybe because positions will depend on world axis? I guess this code would be useful for a train system too. Anyway, thank you so much for your several answers: I really really appreciate the time and the attention you give to me
  6. Hello Rolig and Void, Thank you very much for your help. I've just tested your script, Rolig, and it works OK. Why would I need a more complex system, using the both methods you described in your first message? Because, since the pieces of the road (it could be train tracks) would have the same size, it would be less fastidious (you don't have to fit correctly several prims-targets) and would coast less prims. I mean Target2, 3, 4, etc. would be "virtual" and calculated from the position of the position and rotation of the Target1, set as the (invisible) root of the "turning piece of road". But I don't know how to code it in my "list". Thanks again.
  7. Hello, Please, excuse my bad english. Since nobody can answers me in my language, I'll try to request help here. I'm not a scripter, I can just try to adapt scripts I've found. I would like to move a physical car. Using a script I have adapted, the cars moves correctly on a straight road. But I have issues when it has to turn. My idea was: 1. First, the car detects the root position/rotation 2. Then it follows a waypoints calculated from the detected root position/rotation On the picture, yellow prims represent these "virtual" points calculated from the red root. Here is my (stupid or foolish) code (which doesn't work anyway). I used 2 "lists", one for the successive positions, the other one for the successive rotations: string gsSensorTargetName = "turning90"; float scandistance = 11.0; float scanangle = 0.8; // Radians integer direction = 0; list p_data = ["B","C","D","E","F","G"];// list of successive positionslist r_data = ["rotB","rotC","rotD","rotE","rotF","rotG"]; list p_current= ["A","B","C","D","E","F"]; list r_current= ["rotA","rotB","rotC","rotD","rotE","rotF"]; integer A; integer B; integer C; integer D; integer E; integer F; integer G; integer rotA; integer rotB; integer rotC; integer rotD; integer rotE; integer rotF; integer rotG; vector waypoint; rotation set_rot; integer tau = 1; Go() { llSensor(gsSensorTargetName, "", ACTIVE | PASSIVE, scandistance, scanangle);} Action(vector waypoint, rotation set_rot) { vector A= llDetectedPos(0); rotation rotA= llDetectedRot(0); B= A+<0.1363,0.8127,0.0>; C= B+<0.3611,0.892,0.0>; D= C+<0.6719,0.8259,0.0>; E= D+<0.8365,0.6200,0.0>; F= E+<0.9889,0.3995,0.0>; G= F+<0.9527,0.2249,0.0>; rotB= rotA+<0.0,0.0,-12.0>; rotC=rotB+<0.0,0.0,-14.0>; rotD= rotC+<0.0,0.0,-30.0>; rotE=rotD+<0.0,0.0,-19.0>; rotF=rotE+<0.0,0.0,-12.0>; rotG=rotF+<0.0,0.0,-13.0>; integer listLength = llGetListLength(p_data); waypoint=llList2Vector(p_data,p_current); set_rot=llList2Rot(r_data,r_current); ///target = next point on list llMoveToTarget(waypoint, tau);///physical movement llLookAt(waypoint,1,1); ///face direction of travel llRotLookAt(set_rot,1,1); ///face preset rotation } default { state_entry() { llSay(0, "Hello, Avatar!"); } touch_start(integer total_number) { Go(); } sensor (integer total_number) { Action(); }}Could anyone correct my script in order to obtain something? Thank you very much. Lovre from Gertrude
×
×
  • Create New...