Jump to content

scripts and slave script prim effecting memory


MishkaKatyusha
 Share

You are about to reply to a thread that has been inactive for 2573 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

im abit curious,is there a line that would force one prim with a script,thats slave to another prim with a script in the same linket.to lose its attributes?

the main reason for this is the slave prim has a nasty habit of getting attributes stuck and the master script loses effect on the slave prim's attributes

Link to comment
Share on other sites

My saying was that I don't know what you're doing. I also asked a question.

But yes, generally, if you can do without slave scripts then that's what I'd advise. Slave scripts typically occupy way more memory than necessary and don't improve the regions ability to parallel process commands in any way.

Don't mind pardoning nitwits provided that equal effort and consideration is given. :)

Link to comment
Share on other sites

Well, sure, I know what a slave script is and what you'd expect to happen. Assume the instructions are being poorly interpreted by the slave script - perhaps you have a semi-colon at the end of an if-statement.

What I don't know - and this will be my third and final attempt to understand - is what you're using the slave script to try and accomplish.

And again, do you need this slave script, or is there an LSL command you can use that addresses linked prims remotely for this function?

P.S. @ Dora, my assumptions of this case thus far:-

  1. A slave script is a script that's executing commands 'on behalf of' a master script, e.g. setting llSetText or llColor (probably in a child prim)
  2. The 'attribute' that the OP refers to is whatever is being changed by the slave script, e.g. the hovertext or the prim colour.
Link to comment
Share on other sites

I have also some difficulties getting the meaning

  1. What is a slave script?
    Maybe a script in a child prim and then the master script would be a script in the root prim?
  2. The only attributes I know about that can stick are prim attributes
    Is that what you refer to when you talk about script attributes?

:smileysurprised::):smileyvery-happy:

Link to comment
Share on other sites

im trying to design a line on the slave script that will vape its attributes if it receives a "clear" order from the master script

 

if(order == "clear target")         reset_channel = (integer)llTargetRemove(target_id,"|");

ive already added the reset channel as an integer >.>

but i cant quite figure out how to get it to remove the target

Link to comment
Share on other sites


MishkaKatyusha wrote:

 
if(order == "clear target")         reset_channel = (integer)llTargetRemove(target_id,"|");

 

You're definitely not using reset_channel or llTargetRemove correctly.

  • Look to the Wiki to see llTargetRemove used properly.
  • reset_channel - if necessary - should be if'd higher up inside the listen or link_message event (that this is probably an extract from).

Not sure that this is a useful way for you to approach this project. There's too much guesswork on our side and too little feedback from you, for advice you receive here to be especially helpful.

Link to comment
Share on other sites

yes thats the general implication of my ham fisted script writing help plea

 

*sigh* it would be so nice if i could just tell it "purge state" but so far it wont accept llresetscript

ive defined the error as a lack of receiving the clear order from the master script.infact.as far as i can tell from looking at and comparing both.the clear target doesnt exist in the master script as anything other than a pointless menu click

for example,ehre is a snippet from the master script containing the fire order

 }        else if (m == "fire"){            llMessageLinked(LINK_SET,0,"fire|"+target+"|5|0|0|"+(string)gmode,JSON_NULL);        }

and then the part containing the clear target order

   }        else if(m == "clear target"){            target = NULL_KEY;                    }
Link to comment
Share on other sites

well,here is the entire slave script,perhaps this will answer something

 

// Missile Typesstring m_type_5 = "missle";integer reload = FALSE;// Misc Variable Setupvector pos;rotation rot;vector offset;float missile_vel = 10;integer ammo = 0;integer reload_time = 10;integer r_timer;integer cluster_spacing;integer fire_channel = 1;// variables from other scriptsinteger missile_type;integer missile_channel;integer reset_channel;integer land_mode;integer gmode;integer landowner;integer target_id;// Launch Functionlaunch_missile(){    // Ammo Counter Reset    // Get position and rotation for maff!    pos = <0.0,4.0,0.0>*llGetRot();    rot = llGetRot();    vector fwd =  llRot2Up(llGetRot());    fwd *= missile_vel;    integer i = 5;    rot *= llGetRot();    // Rez Missile Types, Send land_mode integer as on_rez integer    if(missile_type == 5){        //  llSay(0, "function fire");        // Combat Missile        llRezObject(m_type_5, llGetPos()+pos, 4*fwd,  llEuler2Rot(<0,0,0>*DEG_TO_RAD)*llGetRot(), missile_channel);        llPlaySound("72362129-f7c0-6db0-8f81-e7f58a88cc4c",1.0);    }}default{    on_rez(integer start_param){        ;    }    link_message(integer sender_number, integer number, string message, key id)    {        if(number == 0){            list cmd_list = llParseString2List(message,["|"],[]);            string order = llList2String(cmd_list, 0);            string target = llList2String(cmd_list, 1);            missile_type = llList2Integer(cmd_list, 2);            //combat_system = llList2Integer(cmd_list, 3);            land_mode = llList2Integer(cmd_list, 4);            gmode = llList2Integer(cmd_list, 5);                        if(order == "clear target")         reset_channel = (integer)llTargetRemove(target_id);                               else if(order == "fire" ){                missile_channel = (integer)llRound(llFrand(60000-30000) + 30000);               if( ammo != 400 ){                    launch_missile(); // Fire the missile                    llShout(missile_channel,target + "|" + (string)landowner + "|" + (string)land_mode+ "|" + (string)gmode); // Send target UUID to missile (missiles turn off listen once recieved)                                        ammo++;                    //ammo++;                }                else if (ammo == 400 || ammo >4){                    // llSay(0, "Ammo Depleated");                    if(!reload){                        // llSay(0,"Processing Reload");                        reload=TRUE;                        llSetTimerEvent(4);                    }                }            }        }    }    timer(){        // Process the reload timer        ammo = 0;        //llSay(0,"Reload Complete");        reload = FALSE;        llSetTimerEvent(0);    }}
Link to comment
Share on other sites


steph Arnott wrote:

The best answer is use the employment forum and pay a coder.

Seconded.

The script snippets look like a mess of kludges packed in together. I'd be surprised if they can even compile as it is.

If the OP is determined to work alone then lessons or more limited initial projects might be beneficial. As it is, I can't see this current approach being productive for anyone involved.

Additionally: Yeah, I'm not reading more of that. I got about halfway and you've got variables everywhere that don't really link to anything. You've certainly broken the list parsing from link_message 'message' and I don't have the patience to read sloppy indentation.

Link to comment
Share on other sites

v.v unfortunately this is yet another sad case of where occam's razor ignores reality

paying a coder would be dandy,but quite simply im not the sort that has the extra monetary resources out of budget to compensate for such an expensive endeavour

lessons are in theory also dandy,but they miss the point in this case for half the same reason as the above possibility,mainly for the easy to digest ones cost alot of money,and the ones that arent are in such a foreign form of english as to befuddle even the most english proficient begginers

and down to the basic english comphrehension.i have very little of it.im 26 years old and have been for the most part a hermit due to a severely impinging lack of social graces by default.which ironically enough is a self reinforcing decaying logic loop

i have a lack of formal english comphrehension due to a lack of social graces preventing me from being able to pick up english from social interaction as normals do.which further ensures my lack of social graces as it were

 

which leaves me with only one alternative if i want to learn complicated things

i must thrust myself into complicated,dead-end projects and try to work on them,learning due to the "project group level interaction" which is considerably easier than normal social interaction

see this isnt my script at all,im trying to repair it for someone else that themselves hasnt the slightest idea why this error is occuring

Link to comment
Share on other sites

I can guarantee that everyone who's participated in this thread has encountered social and financial difficulty. I have lifelong mental health issues and first learned LSL primarily while spending a long time unemployed.

There's plenty of people around with sympathy, I'm sure that persistance (and realistic goals) will pay-off for you in time. As someone who went through these troubles, it seems to me that you're setting your expectations very high.

If you lack resources to complete this project then perhaps other, smaller projects are more realistic. Break this one down into chunks, try and get a slave script working and parsing a list successfully. Practice interpretting chat or rezzing objects from contents. Once you can handle lists and intra-object communication, can read 3D-mathematics and handle basic physics, the rest will get easier.

In looking for help, try to furnish others which as much information as possible. We're not participating here to poke fun at newbies trying their hardest - we're just busy people with several things calling for our attention and it's hard to be sure what projects are worth spending a lot of time on.

If you're struggling with the terminology, there's good resources online.

Basic Programming Concepts

w3.org - Programming

SL Wiki: LSL Tutorials

Hope this helps. :)

Link to comment
Share on other sites

I started writing a hundred lines moving a prim 0.2 meters in steps untill i learned loops. And i may cringe at seeing it now but was elated then. This forum taught me beyond basics to medium and for that i will allways be gratefull.

ADDED, those here do it for free in there own time, have respect, could end up with just idiots here.

Link to comment
Share on other sites

(in reply to your previous message,yes i quite annoying.but essentially harmless.my primary strength is a form of insanity,obsession,.its abit like this one martial arts movie i saw once.this man wanted to learn the particular martial art of this one rural community.but they refused.so he came up with an inventive idea,he woudl try,over,and over,and over again.getting "whalloped" with this martial art each time.yet every time,he picked up a little more of it.and then eventually mastered said martial art to the point where no one in the village had greater skill in this martial art than he did.while that was a poor example,it demonstrates how i learn to a degree.i get in way over my head as many times as needed to develope a skill.formal courses never mesh well with me because of my,(to say it in a way that you might like better than my usual speech) highly disorganized thought patterns.never the less my desire is quite sincere)

 

i do have very much respect,and hope through trial and error ad nauseam to emulate the greats of this scripting world ,like you (you fixed that lousy bed script i bought)

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2573 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...