Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-03-2001, 10:24 AM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
Saving Info

(CHRIS: )
I need to know how to save varibles when my car runs out of gas and i need to make it so only ppl who OWN that car can fill it with more fuel to drive it away!!!!!!!!!! HELP !!!
Reply With Quote
  #2  
Old 11-03-2001, 10:38 AM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
Post Answers plz!!!

I am only writing this to bring it back to the op of list because otherwise you get ignored!!!!!!!! PLZ DONT IGNORE ME I NEED HELP!!!!!!!!!!!
Reply With Quote
  #3  
Old 11-03-2001, 10:39 AM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
wasn't there something like this.strings for P2P Playerworlds?

so i would
use something like this:

if(buying){
sestring this.owner,#a;
}


filling:
(use trigegraction for it)

car:
if(actionefillup){
if(strequals(this.owner,#a)){
this.gas=100; //just for example
}
else {say2 Not Your car;}
}

the refiller

if(weaponfired){
triggeraction playerx+1.5+vecx(playerdir)*2,playery+2+vecy(playe rdir)*2,fillup,#a;
}

don't know if it works...
__________________
No Webhost at the moment
Reply With Quote
  #4  
Old 11-03-2001, 10:44 AM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
Thnx

Thnx i wil try it Ur good!
BTW: will that hang on even after they log off?
Reply With Quote
  #5  
Old 11-03-2001, 10:54 AM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
i got a better wat to do it

i gfot a way to do it but i need to save it like position and stuff so they can come back to it!
Reply With Quote
  #6  
Old 11-03-2001, 11:01 AM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
Quote:
Originally posted by TDO2000
wasn't there something like this.strings for P2P Playerworlds?

so i would
use something like this:

if(buying){
sestring this.owner,#a;
}


filling:
(use trigegraction for it)

car:
if(actionefillup){
if(strequals(this.owner,#a)){
this.gas=100; //just for example
}
else {say2 Not Your car;}
}

the refiller

if(weaponfired){
triggeraction playerx+1.5+vecx(playerdir)*2,playery+2+vecy(playe rdir)*2,fillup,#a;
}

don't know if it works...
(Nick I would have done it a harder way lol.
Reply With Quote
  #7  
Old 11-03-2001, 11:28 AM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
hers the script FILL ME UP DOC!

// NPC made by ~|¤Colit¤|~
if (playerenters) {
message BUY ME!;
this.fuel=100;
this.x = x;
this.y = y;
}
if (playertouchsme) {

if (strequals(#c,Get in)){
set incar;
setstring this.owner,#a;
playerx = this.x;
playery = this.y;
hideplayer 1;

} if (strequals(#c,Get in)){
if (this.owner == #a){
set incar;
setstring this.owner,#a;
playerx = this.x;
playery = this.y;
hideplayer 1;
} }}

if (strequals(#c,Exit)) {
enableweapons;
playerdir=2;
playery+=2;
unset incar;
}
while (playerhearts>=0) {
if (incar) {
if (keydown(0)) {
if (!onwall(x+0.5,y-0.5)) {
y-=0.5;
this.fuel = this.fuel-.1;
}
}
if (keydown(1)) {
if (!onwall(x-0.5,y+0.5)) {
x-=0.5;
this.fuel = this.fuel-.1;
}
}
if (keydown(2)) {
if (!onwall(x+0.5,y+2)) {
y+=0.5;
this.fuel = this.fuel-.1;
}
}
if (keydown(3)) {
if (!onwall(x+2,y+0.5)) {
x+=0.5;
this.fuel = this.fuel-.1;
}
}
}}
while (playerhearts>=0) {
if (incar) {
if (keydown(0)) {
if (!onwall(x+0.5,y-0.5)) {
y-=0.5;
this.fuel = this.fuel-.1;
}
this.cardir=0;
}
if (keydown(1)) {
if (!onwall(x-0.5,y+0.5)) {
x-=0.5;
this.fuel = this.fuel-.1;
}
this.cardir=1;
}
if (keydown(2)) {
if (!onwall(x+0.5,y+2)) {
y+=0.5;
this.fuel = this.fuel-.1;
}
this.cardir=2;
}
if (keydown(3)) {
if (!onwall(x+2,y+0.5)) {
x+=0.5;
this.fuel = this.fuel-.1;
}
this.cardir=3;
}
if (exploded) {
this.fuel--;
}
if (this.fuel<=0) {
enableweapons;
unset incar;
}
freezeplayer 0.05;
hideplayer 0.05;
playerx=x-0.5;
playery=y-1;
playerhearts=playerfullhearts;
}
message #v(this.fuel);
sleep 0.05;
}
if (incar){
if (timeout){
message FUEL:#v(this.fuel);
timeout = 1;
}}


now make it so i can fill the tank and save the location when the tank runs out even if they go offline plz help me! i need service stations too (cheaper ten the gas can and faster too!)
Reply With Quote
  #8  
Old 11-03-2001, 11:30 AM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
good idea?

is this a good idea?
Reply With Quote
  #9  
Old 11-03-2001, 09:50 PM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
Re: hers the script FILL ME UP DOC!

first thing:
make a better keydown-routine with for loops

for(this.i=0;this.i<4;this.i++){
if(keydown(this.i)){
if(!onwall(playerx+1.5+vecx(this.i)*.5,playery+2+v ecy(this.i)*.5)){
playerx+=vecx(this.i)*.5;
playery+=vecy(this.i)*.5;
playerdir=this.i;
}
}
}

it's not a good onwall check but I dont want to write too much

I would also use triggeractions for filling up but I think there is a better way then this I think of, if u use NPC-Server...
__________________
No Webhost at the moment
Reply With Quote
  #10  
Old 11-03-2001, 10:46 PM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
No..........

Just tell me how i can increase a this. variable with another NPC i could put a value into a temp npc then say that (this.fuel=tempstr)
but i cant place a string ike that!!! HELOP?!?!?!?!
Reply With Quote
  #11  
Old 11-03-2001, 11:42 PM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
PLZ hurry

PLZ hurry i only got 70 or 80 years left in my life!!!!!!!!!!!!!!!!!!!!!!!



<CHRIS>
Reply With Quote
  #12  
Old 11-04-2001, 01:54 AM
Xaviar Xaviar is offline
Registered User
Join Date: Aug 2001
Location: Fairyland
Posts: 463
Xaviar is on a distinguished road
Send a message via ICQ to Xaviar Send a message via AIM to Xaviar
*blinks* Isn't this the sort of thing the save array is for?
__________________
One by one, the penguins steal my sanity.

*cookie for Xaviar* --Originally posted by Tyhm

--Xaviar

A m e r i c a
Reply With Quote
  #13  
Old 11-04-2001, 01:55 AM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
(Nick: )Umm i think its like save[#] I used it before but didnt really understand it
Reply With Quote
  #14  
Old 11-04-2001, 01:59 AM
Xaviar Xaviar is offline
Registered User
Join Date: Aug 2001
Location: Fairyland
Posts: 463
Xaviar is on a distinguished road
Send a message via ICQ to Xaviar Send a message via AIM to Xaviar
Quote:
Originally posted by Poogle
(Nick: )Umm i think its like save[#] I used it before but didnt really understand it
[sarcasm]
No, the save array is special, you have to put the index before the name of it, and it uses <>'s to mark the subscript instead of []'s
[/sarcasm]

Just kidding, I was just wondering why you guys didn't use the save array instead of strings?
__________________
One by one, the penguins steal my sanity.

*cookie for Xaviar* --Originally posted by Tyhm

--Xaviar

A m e r i c a
Reply With Quote
  #15  
Old 11-04-2001, 08:27 AM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
SAVE ARRAY?

Well never used it before tell me how and i will use it! Otherwise im not up a crick w/out a paddle im in space without air!!!!
Reply With Quote
  #16  
Old 11-04-2001, 11:22 AM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
TELL ME NOW!

i am losing my patince tell me how to use the save array plz!?!?!?!
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 09:20 AM.


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