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
  #41  
Old 12-31-2004, 08:02 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
My question is, currently, why isn't it copying the level correctly?
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #42  
Old 12-31-2004, 09:12 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by CaTigus
If you want to get all the players you're going to need
NPC Code:

for(i=0;i<playerscount;i++) {
with(players[i]) {
script;
}
}


To get serverside NPCs use:
NPC Code:

for(i=0;i<npcscount;i++) {
with(npcs[i]) {
script;
}
}


This works for classes aswell. You can control text's of a class and such with this, possibly warpto in the script, Which I have never tried.
I'm starting to lose understanding of your question.
this.i
__________________
Skyld
Reply With Quote
  #43  
Old 12-31-2004, 09:16 PM
Malinko Malinko is offline
Unholy Nation
Join Date: Mar 2004
Location: Massachusetts, U.S.A.
Posts: 1,782
Malinko is on a distinguished road
Send a message via AIM to Malinko
Quote:
Originally Posted by Skyld
this.i
Oh god...*slaps forehead*,

Edit: Inside joke, Skyld gets mad when you use "i" and not "this.i".
Reply With Quote
  #44  
Old 12-31-2004, 09:18 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
this.i doesn't matter that much
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #45  
Old 12-31-2004, 09:21 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
If you use it clientside in more than one script, they will conflict. I know that what you are trying to do is serverside, but still it is bad practise.
__________________
Skyld
Reply With Quote
  #46  
Old 12-31-2004, 11:07 PM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
Quote:
Originally Posted by Skyld
If you use it clientside in more than one script, they will conflict. I know that what you are trying to do is serverside, but still it is bad practise.
they will? I don't exactly see how unless Graal somehow runs two scripts at the exact same time (it does not do that)
__________________

Reply With Quote
  #47  
Old 12-31-2004, 11:38 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
I know they conflict when it's clientside, but geuss what, it's serverside.
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #48  
Old 01-01-2005, 01:28 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Skyld
If you use it clientside in more than one script, they will conflict
Horrendously bad advice.
__________________
Reply With Quote
  #49  
Old 01-01-2005, 02:53 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Evil_Trunks
they will? I don't exactly see how unless Graal somehow runs two scripts at the exact same time (it does not do that)
Clientside, variables without a prefix are stored on the client.

Quote:
Originally Posted by falco10291029
I know they conflict when it's clientside, but geuss what, it's serverside.
Did you not read what I said?

Quote:
I know that what you are trying to do is serverside, but still it is bad practise.
__________________
Skyld
Reply With Quote
  #50  
Old 01-01-2005, 02:59 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Listen: If you want the value of a variable to be preserved between frames then yes, a this. prefix should be used. But that is not the case with simple iterative variables. It is wasteful to have a copy for every separate NPC.
__________________
Reply With Quote
  #51  
Old 01-01-2005, 03:30 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Quote:
Did you not read what I said?
Yes, I did. I am just saying that i feel no need to type this. if I don't need to
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #52  
Old 01-01-2005, 03:51 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Isn't copylevel serverside?
Reply With Quote
  #53  
Old 01-01-2005, 03:59 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
yes it is, and SO IS THE NPC USING IT!
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #54  
Old 01-01-2005, 05:26 AM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
i think everyone forgot the orginal problem
__________________

Reply With Quote
  #55  
Old 01-01-2005, 06:36 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Me too, I would restart the thread if that wasn't illegal, but now people are arguin over something pointless...when...my thread...is still...going....on.........damn i'm a jackass
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #56  
Old 01-02-2005, 12:33 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Hey what's the variable for gravity? i want to change mine so that I can use it for spells....(there's bugs when I use 0 for power and zangle)
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #57  
Old 01-02-2005, 01:45 AM
CaTigus CaTigus is offline
Scripter
Join Date: Oct 2002
Posts: 80
CaTigus is on a distinguished road
Quote:
Originally Posted by falco10291029
Hey what's the variable for gravity? i want to change mine so that I can use it for spells....(there's bugs when I use 0 for power and zangle)
What do you mean gravity?
playerz?
playerz=
playerz+=
playerz-=
playerz++
playerz--
but playerz doesnt go below 0.
Reply With Quote
  #58  
Old 01-02-2005, 03:08 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
It's "gravity."
Reply With Quote
  #59  
Old 01-02-2005, 04:08 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Catigus, i meant for shoot, and tolfanate, thanks. Anyway i still need this problem fixed XD
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #60  
Old 01-02-2005, 05:08 AM
CaTigus CaTigus is offline
Scripter
Join Date: Oct 2002
Posts: 80
CaTigus is on a distinguished road
Quote:
Originally Posted by falco10291029
Catigus, i meant for shoot, and tolfanate, thanks. Anyway i still need this problem fixed XD
Oh, I get it now, you were using the shoot command for a spell :P Sorry
Reply With Quote
  #61  
Old 01-02-2005, 06:10 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
yes i was, but now i wish to have the problem fixed. I have an idea, but i need to know how yto trigger an action into the npcserver or a db npc (I'm thinking maybe only a db can copy levels)
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #62  
Old 01-05-2005, 01:49 AM
TB3 TB3 is offline
Registered User
TB3's Avatar
Join Date: May 2001
Location: US of A State of VA
Posts: 658
TB3 is on a distinguished road
Send a message via Yahoo to TB3
With all this talk about the deletelevel ; command , when using it does the npcserver remove DB npcs from that level before deleting it ??
__________________

To the sun of your age, I arise
Reply With Quote
  #63  
Old 01-05-2005, 01:56 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by CaTigus
but playerz doesnt go below 0.
It can.

Quote:
Originally Posted by falco10291029
only a db can copy levels)
I've done it before with a weapon.
Reply With Quote
  #64  
Old 01-05-2005, 04:31 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
what's the exact command you used? I cant get copylevel to work no matter what typ of npc uses it
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #65  
Old 01-05-2005, 04:44 AM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
I have used it before

I think the destination copyed level has to be in a subfolder of the level you are copying? I remember experiencing omething odd like this and taking a while to pick up on it
__________________

Reply With Quote
  #66  
Old 01-05-2005, 04:52 AM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
I havent used it in a while but I think I had the template level in levels/ and it copied to a subfolder and only had the folders on the 2nd part.

like

copylevel battletest.nw,battles/battletest#v(var).nw;
Reply With Quote
  #67  
Old 01-05-2005, 05:15 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
I'll try that, and announce if it works :-P


EDIT: No, that doesn't seem to work either, I tested it by puttin it in the npcserver, so I didnt ahve to go online, and i'l ltry it on molds too, but i doubt it'll work
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
Reply With Quote
  #68  
Old 01-05-2005, 08:46 AM
middo middo is offline
VHE Monkey
middo's Avatar
Join Date: Aug 2002
Location: California
Posts: 327
middo is on a distinguished road
Send a message via AIM to middo
I too have gotten it to work before...
I made a tent NPC that would spawn tents with individual insides.

I had the actual tent NPC put down via putnpc2
And when you entered the tent, your last coordinants were saved...
It wasnt exactly fool-proof, you could go in a tent and not come out for a day, and end up stuck on a tree..
I don't remember if I fixed that or not. Now I would have made a level-script that checked with a DB NPC where I would store coordinants and status (maybe dates) of tents to see if the one you are in is still active/in existance...

In the class NPC, I had an

if (created) {
copylevel levels/tents/tent_basic.nw,levels/tents/tent_#v(server.tentquary);
}

NOTE; Dont do it the lame way I did it...
Reply With Quote
  #69  
Old 01-05-2005, 04:05 PM
TB3 TB3 is offline
Registered User
TB3's Avatar
Join Date: May 2001
Location: US of A State of VA
Posts: 658
TB3 is on a distinguished road
Send a message via Yahoo to TB3
Eh....?
PHP Code:
//Level NPC in level that initiates battle.
if (playerenters) {
  
putnpc2 x,y,{join baddyclassname;};
  
with(npcs[npcscount-1]) {
    
setstring this.target,#a;
  
}

PHP Code:
//Baddy Class 
if (created||invalid) {
  
setstring this.var,#v(int(random(0,300)));
  
ok 0;
  
with(getnpc(Battles)) {
    if(
lindexof(#s(thiso.var),this.activelevels) == -1) ok = 1;
  
}
  if(
ok == 0) {
    
callnpc -1,invalid,;
  } else {
    
copylevel battletest.nw,battles/battletest_#s(this.var).nw;
    
with(getnpc(Battles)) {
      
addstring this.activelevels,#s(thiso.var);
    
}
    
setstring this.startlevel,#L;
    
warpto battletest_#s(this.var).nw,x,y;
    
with(getplayer(#s(this.target))) setlevel2 #L,playerx,playery;
  
}
}
//Baddy code rest of the way except
if(whateverhappenswhenbaddydies) {
  
setlevel2 escapelevel,playerx,playery;
  
with(getnpc(Battles)) {
    
removestring this.activelevels,#s(thiso.var);
  
}
  
warpto #s(this.startlevel),x,y; //Failsafe if delete level doesnt remove db npcs you dont want bugged db npcs clogging your npcserver
  
deletelevel battles/battletest_#s(this.var).nw; // Not sure if you need the battles/ part 

PHP Code:
//Battles DB List NPC 
Maybe something like this ???
God knows i didnt test it so there may be some grammar errors or script errors.
And I was inquiring earlier do DB npcs get deleted from level if you use the deletelevel command ? eh?
__________________

To the sun of your age, I arise
Reply With Quote
  #70  
Old 01-05-2005, 10:45 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
yes they do, I had something stored there and it was deleted by accident, and so ewas the DN npc, and anyways, i tryed the ways, but it doesnt seem to be copying, I am gonna try doing several of those in the same script, and see if any of them activate..
__________________
BEst Insult ever: If I had a dollar for every brain you DIDNT have, i'd have one dollar!
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 03:07 AM.


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