Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Increasing Damage (https://forums.graalonline.com/forums/showthread.php?t=76645)

Knightmare1 09-05-2007 02:41 AM

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)



coreys 09-05-2007 03:52 AM

do thedamage(this.damage), what the ****?
Also, you can't read variables that are set serverside on the clientside, and vise versa.

Googi 09-05-2007 07:58 AM

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.

Skyld 09-05-2007 09:39 AM

Quote:

Originally Posted by Googi (Post 1345915)
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?

xXziroXx 09-05-2007 12:21 PM

Quote:

Originally Posted by Knightmare1 (Post 1345863)
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.

Inverness 09-05-2007 01:30 PM

Quote:

Originally Posted by xXziroXx (Post 1345928)
I believe what you are looking for, is:

setsword(player.swordimg, 2);

Replace the "2" with power.

player.swordpower = 2; should work well too.

Crow 09-05-2007 03:16 PM

Quote:

Originally Posted by Skyld (Post 1345926)
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

Knightmare1 09-05-2007 09:18 PM

i got the Do thing from an old system i deleted

Googi 09-05-2007 11:31 PM

Quote:

Originally Posted by Skyld (Post 1345926)
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?

Skyld 09-05-2007 11:39 PM

Quote:

Originally Posted by Googi (Post 1346023)
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.

xXziroXx 09-06-2007 05:45 PM

Quote:

Originally Posted by Inverness (Post 1345931)
player.swordpower = 2; should work well too.

Ah right. Haven't used any stuff like that since GS1 :D

PrinceOfKenshin 09-06-2007 11:24 PM

Quote:

Originally Posted by Skyld (Post 1346024)
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 :asleep:

Twinny 09-07-2007 07:21 AM

Quote:

Originally Posted by PrinceOfKenshin (Post 1346169)
Woot i so knew that! its like that in visual basics or some other language i know i forget :asleep:

It's in like every programming language ever to include sequencing, selection and interation.


All times are GMT +2. The time now is 02:05 AM.

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