Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-02-2002, 08:54 AM
draygin draygin is offline
Telmont Bandit
draygin's Avatar
Join Date: Feb 2002
Location: Ohio
Posts: 2,550
draygin is on a distinguished road
newbie scripter.

Ok I'm really new to scripting and I have an npc document that I swear is from 1.39 I mean it uses stuff like setgifpart etc..

Any how please bare with me as I slaughter and crucify script commands.

I'm trying to set it up so when your hp reaches 0 you get warped to a specified level. This is what I have so far. Sorry in advance its my first attempt at real script aside from clothes changer and details such as lighting effects.

This is what I have so far.
if (playerenters) {toweapons hellwarp;}
if (timeout=.5&&client.hp=0){setlevel2 underworld.nw,30,30;}

(toweapons and hellwarp are just temporary to test offline.) Obviously this doesnt work. I was talking to a friend and he said to use strtofloat(#s(client.HP))=0 although what some of those commands beats me since I cant find them on my npc document. I dont want some one to do the code. But maybe suggest looking into some alternate command. Etc..
(also if some one has an up to date npc document I'd appreceate it)
__________________

I stole Spanky's gold!
Reply With Quote
  #2  
Old 07-02-2002, 09:00 AM
draygin draygin is offline
Telmont Bandit
draygin's Avatar
Join Date: Feb 2002
Location: Ohio
Posts: 2,550
draygin is on a distinguished road
ok ok sweet I just found a handy little command playedies =D but the problem is when I get up I get warped back to where I died. Hmm maybe time out or so. Or something unos momentos I'll be editing this post.

if (playerenters) {toweapons hellwarp3;}

if (playerdies) {setlevel2 underworld.nw,30,30;}

hmm maybe if I change the setlevel2 command or perhaps a time out some where *dabbles*

/edit I also just found the strofloat command in the document.

hmm thats no good I cant get the player to stay in the level.

hmm what does it mean when a stack overflow comes up when you try to play the level and graal crashes? I'm going to assume if (playerdies) wont work for what I need.

Ok two hours laters and still where I was at. I'll work on this some more tommorrow.
__________________

I stole Spanky's gold!

Last edited by draygin; 07-02-2002 at 09:30 AM..
Reply With Quote
  #3  
Old 07-02-2002, 10:01 AM
reeset1 reeset1 is offline
Registered User
Join Date: Jan 2002
Posts: 112
reeset1 is on a distinguished road
Send a message via AIM to reeset1 Send a message via Yahoo to reeset1
I had a nice, FLAWLESS HP script on my good comp, however, that comp broke down almost 2 months ago and is just NOW getting fixed.
__________________
---
Reese is no longer the (Events Admin)
Reply With Quote
  #4  
Old 07-02-2002, 10:32 AM
draygin draygin is offline
Telmont Bandit
draygin's Avatar
Join Date: Feb 2002
Location: Ohio
Posts: 2,550
draygin is on a distinguished road
Quote:
Originally posted by reeset1
I had a nice, FLAWLESS HP script on my good comp, however, that comp broke down almost 2 months ago and is just NOW getting fixed.
The hp script is fine. I just want to warp players when they die. This might not be for anything more than a learning experience.
__________________

I stole Spanky's gold!
Reply With Quote
  #5  
Old 07-02-2002, 10:44 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
Is this for Providence?

You'd need to use triggeraction, because I don't think setlevel2 can be done clientside.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote
  #6  
Old 07-02-2002, 10:50 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
Re: newbie scripter.

Quote:
Originally posted by draygin
Ok I'm really new to scripting and I have an npc document that I swear is from 1.39 I mean it uses stuff like setgifpart etc..

Any how please bare with me as I slaughter and crucify script commands.

I'm trying to set it up so when your hp reaches 0 you get warped to a specified level. This is what I have so far. Sorry in advance its my first attempt at real script aside from clothes changer and details such as lighting effects.

This is what I have so far.
if (playerenters) {toweapons hellwarp;}
if (timeout=.5&&client.hp=0){setlevel2 underworld.nw,30,30;}

(toweapons and hellwarp are just temporary to test offline.) Obviously this doesnt work. I was talking to a friend and he said to use strtofloat(#s(client.HP))=0 although what some of those commands beats me since I cant find them on my npc document. I dont want some one to do the code. But maybe suggest looking into some alternate command. Etc..
(also if some one has an up to date npc document I'd appreceate it)
wouldn't it be strtofloat(#s(client.HP),0)?

Er, whatever.

Check for it to be 0, and then to a triggeraction.
For example...
NPC Code:
 
if (actionserverside){ //Checks for serverside action in the NPCW.
setlevel2 underworld.nw,30,30; // sets level
}

//#CLIENTSIDE
if (timeout && strequals(#s(client.hp),0)){ //Checks for death with HP.
triggeraction 0,0,serverside,hellwarp,; //Triggers
timeout=0.1; //Loops...?
}



if (actionserverside) is above //#CLIENTSIDE because if it was below, it would be clientside also.
It's an example, and it might only work online, or not at all. I'm not sure about the strequals.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote
  #7  
Old 07-02-2002, 11:37 AM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
Re: newbie scripter.

Quote:
Originally posted by draygin

This is what I have so far.
if (playerenters) {toweapons hellwarp;}
if (timeout=.5&&client.hp=0){setlevel2 underworld.nw,30,30;}
HEY BUDDY! YOUR FORGOT YOUR 2nd timeout! this should work...
NPC Code:

if (playerenters) {toweapons hellwarp;timeout=0.05;}
if (timeout&&client.hp=0){setlevel2 underworld.nw,30,30;timeout=0.05;}

__________________
Reply With Quote
  #8  
Old 07-02-2002, 01:45 PM
Bhala Bhala is offline
Disgruntled Monkey
Bhala's Avatar
Join Date: Mar 2001
Posts: 779
Bhala is on a distinguished road
Quote:
Originally posted by Torankusu
Is this for Providence?

You'd need to use triggeraction, because I don't think setlevel2 can be done clientside.
lol yes it can
__________________
Reply With Quote
  #9  
Old 07-02-2002, 02:04 PM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
Quote:
Originally posted by Bhala


lol yes it can
you have tested this online?

It might just be our NPCserver, but it didn't work.

edit: I was talking about for NPCservers.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote
  #10  
Old 07-02-2002, 08:48 PM
draygin draygin is offline
Telmont Bandit
draygin's Avatar
Join Date: Feb 2002
Location: Ohio
Posts: 2,550
draygin is on a distinguished road
Thanks guys I'll play some more when I get home. Setlevel2 works serverside but not clientside. It could be for providence. But more than anything I'm just learning some scripting.
__________________

I stole Spanky's gold!
Reply With Quote
  #11  
Old 07-02-2002, 09:34 PM
jeff335 jeff335 is offline
Registered User
Join Date: Oct 2001
Posts: 605
jeff335 is on a distinguished road
if(actionserverside){
setlevel2 level.nw,30,30;
}
//#CLIENTSIDE
if(playerdies){
//call it -hellwarp, add it using the NPC doler or something
triggeraction 0,0,serverside,-hellwarp;
}
__________________

Quote:
Some people like standing around talking to idiots in the real world, and some don't. Neither choice is inherently better than the other.

-Kaimetsu
Reply With Quote
  #12  
Old 07-02-2002, 09:43 PM
draygin draygin is offline
Telmont Bandit
draygin's Avatar
Join Date: Feb 2002
Location: Ohio
Posts: 2,550
draygin is on a distinguished road
Quote:
Originally posted by jeff335
if(actionserverside){
setlevel2 level.nw,30,30;
}
//#CLIENTSIDE
if(playerdies){
//call it -hellwarp, add it using the NPC doler or something
triggeraction 0,0,serverside,-hellwarp;
}
Yeah I knew I had to put the - so it didnt show up in the inventory. Now I just need to go home and learn what triggeractions is. I'm sure I'll be doing better once I learn what the commands actually are instead of going through a list looking for one that does what I need.
__________________

I stole Spanky's gold!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 07:34 PM.


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