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 03-25-2007, 09:43 AM
Travesty Travesty is offline
Registered User
Join Date: May 2006
Posts: 19
Travesty is an unknown quantity at this point
Sword-Specific Level

I'm trying to make it so that when a player is in this level, the player has 10 hearts and a level 2 sword, while everywhere else, 13 hearts and a level 3 sword. Possible?

Heh... can you do that in GS1?

Last edited by Travesty; 03-25-2007 at 10:10 AM..
Reply With Quote
  #2  
Old 03-25-2007, 09:57 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Yes. Hold on a minute.

Could work, couldn't work. Might want to put this in a class and let me know.

PHP Code:

//#CLIENTSIDE
function onPlayerleaves()
{
  
this.firsthearts clientr.swordfullhearts;
  
this.firstspower clientr.swordpower;  
  
  
player.swordpower 2;
  
player.fullhearts 10;
}

function 
onPlayerenters()
{
  
player.swordpower this.firstspower;
  
player.fullhearts this.firsthearts;

__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #3  
Old 03-25-2007, 01:10 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 killerogue View Post
Yes. Hold on a minute.
Could work, couldn't work. Might want to put this in a class and let me know.
Umm... you can't set a players sword power or hearts clientside. Also, this.firstpower and this.firsthearts are undefined. You also managed to mix up the order (clientr. is set when the player leaves?).

I'll write it in GS2 first and i'll try and work it out in GS1
PHP Code:
function onCreated()
{
  
this.sethearts=10;
  
this.setsword=2;
}

function 
onPlayerEnters()
{
  
player.clientr.setsword player.swordpower;
  
player.clientr.sethearts player.fullhearts;
  
player.swordpower this.setsword;
  
player.fullhearts this.sethearts;
  
player.chat "Default stats set!";
}

function 
onPlayerLeaves()
{
  
player.swordpower player.clientr.setsword;
  
player.fullhearts player.clientr.sethearts;
  
player.clientr.setsword "";
  
player.clientr.sethearts "";
  
player.chat "Original Stats Restored";

Reply With Quote
  #4  
Old 03-25-2007, 02:04 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by Twinny View Post
Umm... you can't set a players sword power or hearts clientside. Also, this.firstpower and this.firsthearts are undefined. You also managed to mix up the order (clientr. is set when the player leaves?).

I'll write it in GS2 first and i'll try and work it out in GS1
PHP Code:
function onCreated()
{
  
this.sethearts=10;
  
this.setsword=2;
}

function 
onPlayerEnters()
{
  
player.clientr.setsword player.swordpower;
  
player.clientr.sethearts player.fullhearts;
  
player.swordpower this.setsword;
  
player.fullhearts this.sethearts;
  
player.chat "Default stats set!";
}

function 
onPlayerLeaves()
{
  
player.swordpower player.clientr.setsword;
  
player.fullhearts player.clientr.sethearts;
  
player.clientr.setsword "";
  
player.clientr.sethearts "";
  
player.chat "Original Stats Restored";

In GS1:

PHP Code:
if (created)
{
     
this.sethearts 10;
     
this.setsword 2;
}

if (
playerenters)
{
     
setstring clientr.setswordplayerswordpower;
     
setstring clientr.setheartsplayerfullhearts;
     
playerswordpower this.setsword;
     
playerfullhearts this.sethearts;

     
setplayerprop #c,Default stats set!;
}

if (
playerleaves)
{
     
playerswordpower clientr.setsword;
     
playerfullhearts clientr.sethearts;
     
setstring clientr.setsword,;
     
setstring clientr.sethearts,;

     
setplayerprop #c,Original Stats Restored;


* I love how when people ask for GS1, everyone gives him GS2 ...
__________________
What signature? I see no signature?
Reply With Quote
  #5  
Old 03-25-2007, 03:26 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 godofwarares View Post
* I love how when people ask for GS1, everyone gives him GS2 ...
I skipped GS1 all together so I don't know it all. I post a solution in GS2 in case the original poster / someone else can use it to translate to GS1.
Reply With Quote
  #6  
Old 03-25-2007, 03:42 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
Please only post in the language relevant to the post. Ideally we do not want to confuse people by mixing up the languages.
__________________
Skyld
Reply With Quote
  #7  
Old 03-25-2007, 11:45 PM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
Quote:
Originally Posted by godofwarares View Post
In GS1:

* I love how when people ask for GS1, everyone gives him GS2 ...
You almost had it right:

HTML Code:
if (created)
{
     this.sethearts = 10;
     this.setsword = 2;
}

if (playerenters)
{
     setstring clientr.setsword,#v(playerswordpower);
     setstring clientr.sethearts,#v(playerfullhearts);
     playerswordpower = this.setsword;
     playerfullhearts = this.sethearts;

     setplayerprop #c,Default stats set!;
}

if (playerleaves)
{
     playerswordpower = strtofloat(#s(clientr.setsword));
     playerfullhearts = strtofloat(#s(clientr.sethearts));
     setstring clientr.setsword,;
     setstring clientr.sethearts,;

     setplayerprop #c,Original Stats Restored;
}
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 11:13 PM.


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