Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Old Scripting Engine (GS1)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-05-2008, 01:59 AM
johny023 johny023 is offline
Registered User
Join Date: Dec 2006
Posts: 36
johny023 is on a distinguished road
why does this happen?

i built a refrigerator for my offline world, it's basically just stores food so you don't have to clutter your inventory or if you just don't feel like getting food you can take some of the food you stored in the refrigerator.

i made it and it worked fine for a while, but then it started making graal crash when you took something out, and it doesn't happen every time but it does happen a lot. when graal crashes it just freezes and if i press F4 to go back to the editor mode it only half opens it and that also freezes, but i get a error message that says

" Access violation at address 00402FCO in module "GraalEditor.exe', Read of address 40EFE3FC " why does this happen? this is how i scripted it..

this part of the script is in the refrigerator

if (actionapressed) {
sleep 0.1;
foodselect = 3;
disableweapons;
timeout = 0.05;
}

" foodselect = 3; " opens 2 menus that show what's in your invitory and what's in the refrigerator. then i click on the item on the menu i want

if (actionleftmouse){
triggeraction fridgex+1,fridgey+1,tsoda,soda;
putnpc block.gif,frigesoda.txt,x,y;
}

that places the weapon that goes to your invitory then sends a triggeraction to the refrigerator saying that you took 1 soda out

refrigerator's script

if (actiontsoda){
foodselect = 0;
sleep 0.2;
this.soda -= 1;
foodselect = 3;
timeout = 0.05;
}

weapon's script
// NPC made by john
if (created) {
}

if (playerenters && !isweapon){
toweapons /Coke;
if (!isweapon) destroy;
}

if (weaponfired){
setani drink_potion,soda1.gif;
playerhealth += 30;
stamina += 50;
playerfood += 30;
destroy;
}

if (isweapon){
setimg soda1.gif;
}

it was working for a day or two.. but now it randomly freezes when i use it. there's more script in the npcs but that's the script that's being used.

i know that won't work online.. it's a offline world, but i would like to know why this happens and how to fix it?
Reply With Quote
  #2  
Old 09-05-2008, 02:11 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Probably something to do with putnpc.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #3  
Old 09-05-2008, 02:19 AM
johny023 johny023 is offline
Registered User
Join Date: Dec 2006
Posts: 36
johny023 is on a distinguished road
is putnpc glitched or something? because i use that a lot.... and never really had a problem with it... i had to stop using the "playertouchsme" trigger because that was freezing it to...
Reply With Quote
  #4  
Old 09-05-2008, 04:39 AM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by johny023 View Post
if (playerenters && !isweapon){
toweapons /Coke;
if (!isweapon) destroy;
}
When a player enters, you're checking to see if the NPC is not a weapon. If it's not a weapon, you add it. Then, you destroy it. What's the purpose of that?
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #5  
Old 09-05-2008, 01:06 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by LoneAngelIbesu View Post
When a player enters, you're checking to see if the NPC is not a weapon. If it's not a weapon, you add it. Then, you destroy it. What's the purpose of that?
Since it's offline, scripts doesn't differ client/serverside - so playerenters is triggered "serversided" in weapon NPC's as well, so he's dodging that by checking it's not already a weapon.

I remember doing that a lot for my offline playerworld(s) in the past.
__________________
Follow my work on social media post-Graal:Updated august 2025.
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 06:22 PM.


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