Author Topic: how to: capture attempt to open door before it is opened?  (Read 2371 times)

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
how to: capture attempt to open door before it is opened?
« Reply #60 on: September 03, 2010, 11:57:05 pm »


               

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.
               
               

               
            

Legacy_Invisig0th

  • Sr. Member
  • ****
  • Posts: 279
  • Karma: +0/-0
how to: capture attempt to open door before it is opened?
« Reply #61 on: September 04, 2010, 12:01:29 am »


               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 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
how to: capture attempt to open door before it is opened?
« Reply #62 on: September 04, 2010, 12:06:24 am »


               

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.'<img'>

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.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
how to: capture attempt to open door before it is opened?
« Reply #63 on: September 04, 2010, 12:09:48 am »


               

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.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
how to: capture attempt to open door before it is opened?
« Reply #64 on: September 04, 2010, 12:36:44 am »


               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 .
                     
                  


            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
how to: capture attempt to open door before it is opened?
« Reply #65 on: September 04, 2010, 03:00:37 pm »


               

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
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
how to: capture attempt to open door before it is opened?
« Reply #66 on: September 04, 2010, 05:31:27 pm »


               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 .
                     
                  


            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
how to: capture attempt to open door before it is opened?
« Reply #67 on: September 04, 2010, 05:41:18 pm »


               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 .
                     
                  


            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
how to: capture attempt to open door before it is opened?
« Reply #68 on: September 05, 2010, 11:01:39 pm »


               "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 .