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 09-05-2007, 02:41 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
Increasing Damage

im pretty new to this, i did gs1 for 2 years, but i never figured out how to increase damage, not even in gs1. after the gs2 release i deleted all my scripts i couldnt convert, and im stuck with like staff boots and summon, a couple of diferent block scripts, and a faulty gun. im trying to increase damage in my Battle System. you may know from the other thread , i need to make that hit a 2, please help if you could that would be great. script is here for poeple who havent read other thread or thread was lost in the distant past of page 3.
PHP Code:
function onCreated() {
this.damage 2;
}
//#CLIENTSIDE
function onCreated(){
  
replaceani("sword""punch_attack");
  
replaceani("idle""punch_idle");
  
replaceani("walk""punch_walk");
  do 
thedamage(this.damage)

__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #2  
Old 09-05-2007, 03:52 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
do thedamage(this.damage), what the ****?
Also, you can't read variables that are set serverside on the clientside, and vise versa.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #3  
Old 09-05-2007, 07:58 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
There's no such thing as a "do" command. Use something like hurt(this.damage), which is clientside-only (and also triggers the hurt gani), or player.hearts = player.hearts - this.damage, etc. If you're using a scripted HP system subtract from the hp variable rather than player.hearts.

As Corey said, make sure you set variables clientside if they're going to be used clientside.
__________________
Reply With Quote
  #4  
Old 09-05-2007, 09:39 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 Googi View Post
There's no such thing as a "do" command.
Well, there is, but it doesn't work like that. See do ... while.
Quote:
Originally Posted by Knightmare1
im pretty new to this, i did gs1 for 2 years, but i never figured out how to increase damage, not even in gs1. after the gs2 release i deleted all my scripts i couldnt convert, and im stuck with like staff boots and summon, a couple of diferent block scripts, and a faulty gun. im trying to increase damage in my Battle System. you may know from the other thread , i need to make that hit a 2, please help if you could that would be great. script is here for poeple who havent read other thread or thread was lost in the distant past of page 3.
What exactly is this dothedamage()/thedamage() function?
__________________
Skyld
Reply With Quote
  #5  
Old 09-05-2007, 12:21 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 Knightmare1 View Post
im pretty new to this, i did gs1 for 2 years, but i never figured out how to increase damage, not even in gs1. after the gs2 release i deleted all my scripts i couldnt convert, and im stuck with like staff boots and summon, a couple of diferent block scripts, and a faulty gun. im trying to increase damage in my Battle System. you may know from the other thread , i need to make that hit a 2, please help if you could that would be great. script is here for poeple who havent read other thread or thread was lost in the distant past of page 3.
PHP Code:
function onCreated() {
this.damage 2;
}
//#CLIENTSIDE
function onCreated(){
  
replaceani("sword""punch_attack");
  
replaceani("idle""punch_idle");
  
replaceani("walk""punch_walk");
  do 
thedamage(this.damage)

I believe what you are looking for, is:

setsword(player.swordimg, 2);

Replace the "2" with power.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #6  
Old 09-05-2007, 01:30 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by xXziroXx View Post
I believe what you are looking for, is:

setsword(player.swordimg, 2);

Replace the "2" with power.
player.swordpower = 2; should work well too.
__________________
Reply With Quote
  #7  
Old 09-05-2007, 03:16 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Skyld View Post
Well, there is, but it doesn't work like that. See do ... while.
Mh, I just wondered if Graal had the "do ... while" stuff like 3 days ago. Very useful ;D
Reply With Quote
  #8  
Old 09-05-2007, 09:18 PM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
i got the Do thing from an old system i deleted
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #9  
Old 09-05-2007, 11:31 PM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Quote:
Originally Posted by Skyld View Post
Well, there is, but it doesn't work like that. See do ... while.
News to me, but how is it different from a normal while loop?
__________________
Reply With Quote
  #10  
Old 09-05-2007, 11:39 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 Googi View Post
News to me, but how is it different from a normal while loop?
Condition execution.

In a while loop, the condition is executed first, and the loop running depends upon the condition being true before each loop.

In a do ... while loop, the condition is checked after the loop is executed, and the loop will always run once before that condition is checked.
__________________
Skyld
Reply With Quote
  #11  
Old 09-06-2007, 05:45 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 Inverness View Post
player.swordpower = 2; should work well too.
Ah right. Haven't used any stuff like that since GS1
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #12  
Old 09-06-2007, 11:24 PM
PrinceOfKenshin PrinceOfKenshin is offline
That guy with a beard
PrinceOfKenshin's Avatar
Join Date: May 2004
Location: Ontario, Canada
Posts: 819
PrinceOfKenshin has a spectacular aura aboutPrinceOfKenshin has a spectacular aura about
Quote:
Originally Posted by Skyld View Post
Condition execution.

In a while loop, the condition is executed first, and the loop running depends upon the condition being true before each loop.

In a do ... while loop, the condition is checked after the loop is executed, and the loop will always run once before that condition is checked.
Woot i so knew that! its like that in visual basics or some other language i know i forget
__________________


Quote:
Game Master (Server): Greetings PrinceOfKenshin, there are new posts on the forums that demand your urgent attention! God speed, the fate of the world is in your hands. If you fail, middle earth will forever be in the darkness and your children will be enslaved by McKain.
Reply With Quote
  #13  
Old 09-07-2007, 07:21 AM
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 PrinceOfKenshin View Post
Woot i so knew that! its like that in visual basics or some other language i know i forget
It's in like every programming language ever to include sequencing, selection and interation.
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 02:41 PM.


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