Jump to content

Bioscope

Resident
  • Posts

    12
  • Joined

  • Last visited

Everything posted by Bioscope

  1. Wow! Thank you so much! Just one more question: how can I add water detection here so that the airplane behaves the same on the water as it does on the ground? Can raycast detect water?
  2. Thanks for this example! I tried it, but in flight, especially in turns, it keep saying AIR - GROUND - AIR - GROUND especially on turns. Do I understand correctly that it detects itself, the lower parts of the airplane such as the gears? And what to do in this case? Do I need to put this script in the very bottom prim of the airplane and from there send a link message to the engine script? Or... what am I doing wrong? Also wondering what parameters need to be changed? So far this is what I got, but I have not tried it on the water. vector start = llGetPos(); vector end = start - < 0.0, 0.0, rayLength > ; list results = llCastRay(start, end, [RC_MAX_HITS, 1]); if (llList2String(results, 0) == "0") { //Set flying state llSetText("AIR", < 1.0, 0, 1.0 > , 1.0); llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_TIMESCALE, 1.20); llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 0.20); } else { //Set grounded state llSetText("GROUND", < 1.0, 0, 1.0 > , 1.0); llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_TIMESCALE, 10.0); llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 1.00);
  3. Many thanks! This is a very interesting example. But what if, say, the runway is in the air above water or land? It is obvious that the vehicle will continue to behave as if it were in flight? What to do about it? 🤔
  4. And yes I know all airplane scripts are Cubey's script based, but mine is generated by a vehicle script generator, so I consider it mine.
  5. Hi! Thanks! But I think in your script the change of modes does not happen automatically, but manually? I saw something similar in a script I found on the Help island. Which is very interesting, but not what I need. I've probably tried all the open source scripts and none of them suit me *. I like RCX scripts, but they are too complicated for me, and I do not understand what is going on in them. I would hire a scripter, but I want to understand what is going on and I think it will be very expensive. 😉 * Precisely for the same reason, there is no taxi mode. So I make my own script.
  6. Hey! Decided to create an airplane. In the flight, everything is fine. The problem starts when I try to drive on the ground, let alone water. In general, I need a taxi mode. How to do it? Thanks! 😊
  7. you use the word "noob" as a curse word. my first account was registered in 2010 and I do not consider myself either a beginner or an old one. I have seen both of you and I can tell you that there is not much difference between you. I met a person whose account was 15 years old and they did not know what "local lights" are. it's not how many years you spent, but how you spent them. so maybe think twice before bullying someone just because they have fewer digits on their profile than you.
  8. Hello! Thank you very much for your reply! I sent you an example and a script as well as a bunch of songs just in case.
  9. I need to make this script published in following post repeat ( loop ) the song. Reward 500 Ls. Now it plays full song and stops.
  10. Hi! Hope you all doing well! Script question here. This is a full song player script, for multiple songs, it uses sound files from the content. It plays song only once and then stops. And I need it to loop song. I would appreciate any help on how to do that. list songs = ["SONG1", 9.9, "SONG2", 9.8]; integer volume = 10; integer lis_count; integer playing; integer busy; integer part; integer lis; integer sl; float delay; list cancel = ["CANCEL", "STOP"]; list playlist; list waiting; list song; string vol_str = "Volume"; string song_str = "Songs"; string song_name; list StrideOfList(list src, integer stride, integer start, integer end) { list l = []; integer ll = llGetListLength(src); if (start < 0) start += ll; if (end < 0) end += ll; if (end < start) return llList2List(src, start, start); while (start <= end) { l += llList2List(src, start, start); start += stride; } return l; } list Volumes(integer vol) { integer v = 0; list l = []; do { if (v != vol) l += [((string) v)]; } while ((++v) <= 10); return l; } PageOne(key k, integer c) { llDialog(k, "\nAdjust the volume or select a song to play?", [vol_str, song_str] + cancel, c); } PlaySong(string n) { song = []; integer c = -1; string name = ""; do { if (llSubStringIndex((name = llGetInventoryName(INVENTORY_SOUND, (++c))), n) != -1) song += [name]; } while (name); delay = llList2Float(songs, (llListFindList(songs, [n]) + 1)); if ((sl = llGetListLength(song))) { llPreloadSound(llList2String(song, (part = 0))); if (sl > 1) llPreloadSound(llList2String(song, 1)); playing = FALSE; llSetTimerEvent(0.01); } } integer Chan() { return llRound((llFrand(-5000000.0) + -500000.0)); } float ScaleVol(integer v) { return (v * 0.1); } Listen(integer c, key a) { lis = llListen(c, "", a, ""); } RemoveListen(integer b) { llListenRemove(lis); lis_count = 0; if (b) busy = FALSE; lis = 0; } SetListenTimer(integer p) { if (p) while (((++lis_count) * llRound(delay)) < 30); else { lis_count = 1; llSetTimerEvent(30.0); } } integer CheckWaitingRoom(integer c) { if (waiting) { key a = llList2Key(waiting, 0); if (!c) { RemoveListen(0); Listen((c = Chan()), a); SetListenTimer(playing); } PageOne(a, c); waiting = llDeleteSubList(waiting, 0, 0); return 1; } return 0; } default { on_rez(integer param) { llStopSound(); llResetScript(); } changed(integer change) { if (change & CHANGED_INVENTORY) llResetScript(); } touch_start(integer nd) { if (llDetectedKey(0) == llGetOwner()) { while (nd) { key agent = llDetectedKey(--nd); if (!busy) { busy = TRUE; integer channel = Chan(); SetListenTimer(playing); Listen(channel, agent); PageOne(agent, channel); } else { list a = [agent]; if (llListFindList(waiting, a) == -1) waiting += a; } } } } listen(integer chan, string name, key id, string msg) { if (msg == "STOP") { llStopSound(); llResetScript(); } if (msg != llList2String(cancel, 0)) { SetListenTimer(playing); if (msg == vol_str) { llDialog(id, "\nChange the volume?\nThe current volume is set at \"" + ((string) volume) + "\"", cancel + Volumes(volume), chan); return; } if (msg == song_str) { string current = ""; if (playlist) { current = "\n\nThe songs currently queued are\n\"" + llList2String(playlist, 0) + "\" (currently playing)"; if (llGetListLength(playlist) > 1) current += "\n\"" + llDumpList2String(llList2List(playlist, 1, -1), "\"\n\"") + "\""; } llDialog(id, llGetSubString(("\nSelect a song to play?" + current), 0, 500), cancel + StrideOfList(songs, 2, 0, -1), chan); return; } if (llListFindList(Volumes(volume), [msg]) != -1) { llAdjustSoundVolume(ScaleVol((volume = ((integer) msg)))); PageOne(id, chan); return; } if (llGetListLength((playlist += [msg])) == 1) PlaySong((song_name = msg)); } if (CheckWaitingRoom(chan)) return; RemoveListen(1); } timer() { if (playlist) { if (!playing) { llSetTimerEvent(delay); playing = TRUE; } llPlaySound(llList2String(song, part), ScaleVol(volume)); if ((++part) == sl) { if (llGetListLength(playlist) > 1) { song_name = llList2String((playlist = llDeleteSubList(playlist, 0, 0)), 0); llSleep(delay); PlaySong(song_name); } else { llSetTimerEvent(0.0); song_name = ""; playing = FALSE; playlist = []; } } else if (part == (sl - 1)) llPreloadSound(llList2String(song, 0)); else llPreloadSound(llList2String(song, (part + 1))); } if (lis && (!(--lis_count))) { if (!(CheckWaitingRoom(0))) RemoveListen(1); } } }
×
×
  • Create New...