Aller au contenu

Photo

how to: capture attempt to open door before it is opened?


  • Veuillez vous connecter pour répondre
68 réponses à ce sujet

#51
ehye_khandee

ehye_khandee
  • Members
  • 855 messages

ShaDoOoW wrote...

ehye_khandee wrote...

I can tell you the results you get by using AssignCommand incorrectly can cause lag and even crash your server in some cases.

I would wonder, details, proofs...




Doubt if you please but you will have to create your own proofs. My experience comes from debugging other peoples' crashy modules by their request. Crashes and lag were common even after I fixed the obvious, digging deeper I found many systems that were doing the naughty AssignCommand with OBJECT_SELF - having cleared those, crashes vanished, lag dissipated (it was a largish module and PRC too). I no longer have the old buggy version and even if I did, it is not mine to give you as an example, but belongs to the authors who asked my help last year in fixing it.

Sorry I can't oblige your request.

#52
ffbj

ffbj
  • Members
  • 593 messages
Interesting, but I don't think it really matters. It does not cause any problems or lag whatsoever in this script nor has using AssignCommand in many of the scirpts that I have used that function in, but thanks anyway.
Though if people are adamant against using it then by all means don't take my paltry skills at scripting as an indication you should do as I suggest. I have done it both ways and notice no difference. I suppose I could look at some of the other scripts where I use it, more complex examples, but I don't think it makes much difference, unless you were running in it a hb script.

Modifié par ffbj, 03 septembre 2010 - 10:13 .


#53
Invisig0th

Invisig0th
  • Members
  • 170 messages

ShaDoOoW wrote...
however delaing the function at the end of the script can be sometimes very good feature

Yes, I already said that.

Invisig0th wrote...
You definitely should not defer execution of commands unless you have a reason to do so.

Obviously if you have a reason to use this technique, then it would be a good reason and a good feature.

Regardless, it is very clear that no one in this thread was deliberately using this "feature" in an attempt to execute things after the script was finished. So that's not relevant to this discussion.

Modifié par Invisig0th, 03 septembre 2010 - 10:19 .


#54
ffbj

ffbj
  • Members
  • 593 messages
Actually it is because that is what I wanted, though more by chance than by design since I was basing off another script I made with similar use of AssignCommand. But in most situations it is better to do as you and the Lexicon say. Probably would have been fine too just have the door open itself.




#55
Invisig0th

Invisig0th
  • Members
  • 170 messages
ffbj,

Fair enough, seems reasonable. Using the AssignCommand on OBJECT_SELF may be useful in some situations, but I think we can all agree that would be an advanced maneuver!

Modifié par Invisig0th, 03 septembre 2010 - 10:38 .


#56
Shadooow

Shadooow
  • Members
  • 4 465 messages

ehye_khandee wrote...
Doubt if you please but you will have to create your own proofs.

Yes this won't please me, you are the accused side, not me, you are required to bring proofs. I have never seen lags or crashes due to assign command even delay commands. Yes some scripts may lag server, cep(1) torch heartbeat is good example how to not make scripts. Or if the script does TMI, it may cause big lagging after few runs.

But crashing? In past, it said that improperly used ActionEquipItem may crash the server but that was fixed long time ago, also too many bonus feats could cause crash - this was big PRC issue but it was fixed in 1.69 patch. Then adding too much spells into epic spell menu could crash too, but pardon me, I have never saw a beginner to make a script that could cause a crash and I don't believe you. I have seen a lot swashbucklers like you that claimed similar statements, but they never brought proof and I doubt you will.

That because if you could make a crash in script, this would be very useful feature for restarting server. AFAIK there isn't way, otherwise this would been common way to restart server already.

One more note for delaycommands. I have seen very poor ways to use them, for example the just in Hall of Fame spawn system (AmarAdam or similar) used (not sure if still uses) delay commands for every spawn waypoint that was in module. My friend have this in his module and it didnt lagged surprisedly. (But it threw TMI at on module load because the script tries to get all waypoints in module and run script on them - and my friend had like 2k these waypoints there)

Modifié par ShaDoOoW, 04 septembre 2010 - 12:01 .


#57
Invisig0th

Invisig0th
  • Members
  • 170 messages
<sorry, duplicate post>

Modifié par Invisig0th, 03 septembre 2010 - 10:37 .


#58
ffbj

ffbj
  • Members
  • 593 messages
I don't know I would not call something a mistake that works. Sure it's not the prescribed method and the Lexicon says it pointless to do it that way, less efficient, whatever. But it works, nonetheless. As far as other situations go that is not relevant to this particular script, but like I said, don't do what I do, since clearly I don't know what I'm doing. Thanks for the input, all.

Modifié par ffbj, 03 septembre 2010 - 10:43 .


#59
Shadooow

Shadooow
  • Members
  • 4 465 messages

ffbj wrote...

I don't know I would not call something a mistake that works. Sure it's not the prescribed method and the Lexicon says it pointless to do it that way, less efficient, whatever. But it works, nonetheless. As far as other situations go that is not relevant to this particular script, but like I said, don't do what I do, since clearly I don't know what I'm doing. Thanks for the input, all.

+1

#60
ffbj

ffbj
  • Members
  • 593 messages
I should probably use this opportunity to appologize to EK, who was correct is questioning me. Initially I though he was saying I assigned assigncommand to OBJECT_SELF, and I was thinking, well clearly I defined oDoor as OBJECT_SELF.



Anyhow he. EK was correct when he said my comment was rude, and I think a bit mean, as in small of me, to say that, especially since he was right, but even if he was not right, that was inappropriate of me to say, so for that I appologize.

#61
ehye_khandee

ehye_khandee
  • Members
  • 855 messages

ShaDoOoW wrote...



ehye_khandee wrote...
Doubt if you please but you will have to create your own proofs.

Yes this won't please me, you are the accused side, not me, you are required to bring proofs. I have never seen lags or crashes due to assign command even delay commands. Yes some scripts may lag server, cep(1) torch heartbeat is good example how to not make scripts. Or if the script does TMI, it may cause big lagging after few runs.


Accused? Accused of what? Offering you all the benefit of my experience? Required? Where are you getting these rules? YMMV. But I'm not obliged to hand over someone ELSE's module to you on your request. It is their work, not mine in one case and in the other, it is my work and I'm not giving you or anyone else a copy of my own module. End of story.

ShaDoOoW wrote...


But crashing? In past, it said that improperly used ActionEquipItem may crash the server but that was fixed long time ago, also too many bonus feats could cause crash - this was big PRC issue but it was fixed in 1.69 patch. Then adding too much spells into epic spell menu could crash too, but pardon me, I have never saw a beginner to make a script that could cause a crash and I don't believe you. I have seen a lot swashbucklers like you that claimed similar statements, but they never brought proof and I doubt you will.


Imagine for a moment your AssignCommand was to tell the subject to give an object to another creature, and your subsequent lines then addressed that object on the recipient creature (perhaps even with your ActionEquipItem() above). THAT can cause problems. This is just one example of how to foul your scripts by misusing the AssignCommand - I'm sure there are many more and some _could_ be catestrophic (crashy).


ShaDoOoW wrote...

That because if you could make a crash in script, this would be very useful feature for restarting server. AFAIK there isn't way, otherwise this would been common way to restart server already.

One more note for delaycommands. I have seen very poor ways to use them, for example the just in Hall of Fame spawn system (AmarAdam or similar) used (not sure if still uses) delay commands for every spawn waypoint that was in module. My friend have this in his module and it didnt lagged surprisedly. (But it threw TMI at on module load because the script tries to get all waypoints in module and run script on them - and my friend had like 2k these waypoints there)


Um, crashing a server does not restart it. Outside systems might monitor your server and restart it, but that is outside the scope of this thread and cannot be done by nwn scripting once nwn crashes.

#62
Invisig0th

Invisig0th
  • Members
  • 170 messages
Just because a coding mistake is not catastrophic does not mean that it's not a mistake. It's important to discuss things like this, particularly  in a scripting forum. Certain people may not understand why that is important, but all of the best scripters I know appreciate this kind of information. Some may call it nit-picking, but others call it understanding what the pros and cons are of different approaches.

But it sounds like all of us (or at least, all of us that matter) are agreed on the issue. As far as I'm concerned, it was a good chance for all of us to better understand some of the advanced inner workings of the scripting engine, and that is a good thing for everyone.

Modifié par Invisig0th, 03 septembre 2010 - 11:16 .


#63
Shadooow

Shadooow
  • Members
  • 4 465 messages

ehye_khandee wrote...

Imagine for a moment your AssignCommand was to tell the subject to give an object to another creature, and your subsequent lines then addressed that object on the recipient creature (perhaps even with your ActionEquipItem() above). THAT can cause problems. This is just one example of how to foul your scripts by misusing the AssignCommand - I'm sure there are many more and some _could_ be catestrophic (crashy).

Well first to say to give item from one creature to another copyitem function is used. This example has nothing to do with assigncommand. This is good example of possible mistake but this do not rely on any assign or delay command. Also ActionEquipItem function will fail (do nothing) if the item is not owned by the caller. Can't see whats catastrophic there, it just won't work.;)

ehye_khandee wrote...
Um, crashing a server does not restart it. Outside systems might monitor your server and restart it, but that is outside the scope of this thread and cannot be done by nwn scripting once nwn crashes.


Ah right. Sorry. I am too much wonted to NWNX, that uses the crashing, but exactly as you stated it does start the server again when the NWNX monitor find out the server is down.

#64
Shadooow

Shadooow
  • Members
  • 4 465 messages

Accused? Accused of what? Offering you all the benefit of my experience?
Required? Where are you getting these rules? YMMV. But I'm not obliged
to hand over someone ELSE's module to you on your request. It is their
work, not mine in one case and in the other, it is my work and I'm not
giving you or anyone else a copy of my own module. End of story.

Well you are giving advice here. Thats okay, but you are saying exaggerated statements without any proof and this is not okay.

#65
ffbj

ffbj
  • Members
  • 593 messages
Yeah I agree that not doing things in the best or most efficient manner is certainly not preferable to doing things correctly using the prescribed methods. Having no coding xp whatsoever has been both a blessing and a curse. I never think oh I can't do that, until maybe after hours of working on something. But then again I have no methodological constraints on my approach to scripting.
Of course sometimes this results in making mistakes, which in turn can lead to discussions like this one, which I agree in general is a good thing. It certainly clarified some things for me. I never even looked at AssignCommand in the Lexicon before though I use it all the time.
As far as the other discussion about crashes and such and bad things happening, in general if there are poor scripting practices such as the incorrect use of AssignCommand then there may be
other scripting errors, TMI's and such as indicated by ShaDoOow, though, as I alluded to earlier I do use AssignCommand, but have never had a problem. Of course that is only anecdotal evidence from my module and not across the board statement that using it may not cause problems. I think some individuals come from a background where rigorous proof are required. I have many programmer friends who require very specific clear examples of things you say in a conversation. Sometimes it is rather weird as you spend more time explaining what you are talking about than you do actually talking about it.

Probably best to use it only sparingly as suggested above.

Modifié par ffbj, 03 septembre 2010 - 11:39 .


#66
ehye_khandee

ehye_khandee
  • Members
  • 855 messages

ShaDoOoW wrote...

Accused? Accused of what? Offering you all the benefit of my experience?
Required?
Where are you getting these rules? YMMV. But I'm not obliged
to hand over someone ELSE's module to you on your request
. It is their
work, not mine in one case and in the other, it is my work and I'm not
giving you or anyone else a copy of my own module. End of story.

Well you are giving advice here. Thats okay, but you are saying exaggerated statements without any proof and this is not okay.


Accept the posts or reject them, I am under NO obligation to provide you with anything. So read them, don't read them, I don't care. I've been informed by several persons you are the local troll, so I'm taking their advice and BLOCKING YOU. Go redecorate the underside of your bridge or something if you got so much pent-up energy, but you will bother me no more.

Be well. Game on.
GM_ODA

#67
Shadooow

Shadooow
  • Members
  • 4 465 messages
Try to write something like this into NWN Wiki for example. See how long the statement that "AssignCommand may lag or crash server" stays there without any proof. The same goes for lexicon, I, unlike you am lexicon contributor (althought I scamped it...).

Until you provide proofs, I feel obligatory to advice anyone not to believe your statement about AssignCommand at all. Everything relevant is in NWN Lexicon already.

Sincerely, your local troll.

Modifié par ShaDoOoW, 04 septembre 2010 - 04:32 .


#68
ffbj

ffbj
  • Members
  • 593 messages
Hmm, I don't think he is a troll...Oh wait his picture looks oddly like one. Oh well...I guess that is proof enough.
Your local white bearded mage in a robe.

Modifié par ffbj, 04 septembre 2010 - 04:42 .


#69
Genisys

Genisys
  • Members
  • 525 messages
"What do you think abou that Elaine? (The broadcaster)"

"Well I...  (The Rock Interrupts her.)

"It doesn't matter what you think!"

The Rock...

Those wrestling shows always make me laugh.. lol

Modifié par Genisys, 05 septembre 2010 - 10:11 .