Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-05-2007, 03:44 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Save and Apply

When working with scripts in RC, there are times when you'd rather just edit a script and save it rather than have it save and run. This could be a nice addition to RC.

[Clarification]: Changing a script with calling the onCreated event

Last edited by Twinny; 08-05-2007 at 08:57 AM..
Reply With Quote
  #2  
Old 08-05-2007, 10:24 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Twinny View Post
there are times when you'd rather just edit a script and save it rather than have it save and run.
No, not really.
:D
__________________
Reply With Quote
  #3  
Old 08-05-2007, 06:45 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by Inverness View Post
No, not really.
I made a script on UN which, when onCreated was called, saved all the players positions, updated the gmap then warped them back to where they were. I wanted to change some of the code without calling the onCreated event
Reply With Quote
  #4  
Old 08-06-2007, 10:21 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Twinny View Post
I wanted to change some of the code without calling the onCreated event
2BAD4U
__________________
Reply With Quote
  #5  
Old 08-06-2007, 11:55 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
ispaused = true;

Move your stuff out of the onCreated() function and have the new function check if its been run already.
__________________
Reply With Quote
  #6  
Old 08-07-2007, 10:48 PM
Inspiration Inspiration is offline
7 Words
Inspiration's Avatar
Join Date: Oct 2004
Location: New York
Posts: 826
Inspiration is on a distinguished road
Send a message via AIM to Inspiration
Couldn't you just comment out the part of the script you did not want to run?
__________________
How to start your own project:

1. Annoy everybody on an existing project by submitting or proposing changes that they don't want
2. Formally declare all existing projects to be complete crap
3. Talk at great length about the deficiencies of other projects
4. Get drunk
5. ???
6. Profit
Reply With Quote
  #7  
Old 08-08-2007, 04:30 AM
Horrified Horrified is offline
Rediculously inactive
Join Date: Jul 2007
Posts: 961
Horrified is on a distinguished road
Send a message via ICQ to Horrified Send a message via AIM to Horrified Send a message via MSN to Horrified Send a message via Yahoo to Horrified
SO MANY CHOICES.

PHP Code:
/*

These are comment brackets!

*/

//These are comment lines!

function testPlz(params//this is a function not executed on default!


Reply With Quote
  #8  
Old 08-08-2007, 04:42 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Then everything inside the onCreated would not function for those who recieve the weapon afterwards, unless he removed the captions and saved it... thus negating the whole process. So there aren't really SO MANY CHOICES.
Only thing I can think of is moving everything outside of the onCreated() to its own function, and calling the function only when it hasn't been called before... which would involved setting something to the player(or in a DBNPC) the first time it is called and checking it, and which would also involve clearing said something if you actually NEED the onCreated() to be called for all players again.
Reply With Quote
  #9  
Old 08-08-2007, 04:58 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
A wicked part of my script is the ability to simply press reset on the DBNPC to run the script. Makes it alot easier for the less script savvy.

Another example. You have a weapon which creates a gui when onCreated is called clientside. Instead of causing this weapon to popup the gui (causing deaths and angry players), you could just edit the code and save the script. It may be a bit more difficult for clientside though. Id would still have to be sent but not applied.

You can argue that there are many different ways to do this (like calling creategui() from a seperate weapon) but it's just an idea.
Reply With Quote
  #10  
Old 08-08-2007, 11:05 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
You could make a weapon which calls something similar to onCreated() when the weapon itself is created, so you can edit the code of the other weapons, but I have to agree, something like that would be nice ;o
Reply With Quote
  #11  
Old 08-08-2007, 12:21 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
There is is no reason to be creating GUIs in the onCreated() section unless they're invisible or part of the HUD.

The mechanics of the script updating process don't need to be changed when its rather easy to have a workaround to some commands being called everytime onCreated() is.

For weapons on the serverside, a simple this.variable can be used since when you update weapons, the serverside variables are not cleared.

On clientside the weapon object is deleted and recreated so variables are lost, saving to the player object would be best way for this.
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:47 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.