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
  #1  
Old 07-05-2004, 09:41 PM
jackson2k4 jackson2k4 is offline
Registered User
jackson2k4's Avatar
Join Date: Jan 2004
Posts: 39
jackson2k4 is on a distinguished road
Question loggin' =)

ok ive been trying to make a logging system on my server... and im really close to getting it, but for some reason i cant get it lol, im trying to make it so you can unly use a certian weapon on it (axe), but when i seem to have it, i dont.... so can any one help me?
Reply With Quote
  #2  
Old 07-05-2004, 10:05 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
Be more specific..
__________________
V$:CONFL16T
Reply With Quote
  #3  
Old 07-05-2004, 10:14 PM
jackson2k4 jackson2k4 is offline
Registered User
jackson2k4's Avatar
Join Date: Jan 2004
Posts: 39
jackson2k4 is on a distinguished road
ok here goes.....i am making a logging system for my server....i want to make it so when you "chop" at the tree with a weapon (d button use) lets say an axe, that it takes hp away from the tree....


i have it so you can take hp from the tree... and i have the weapon..... i just cant make it so oyu can only use that certian weapon on the tree to take its hp away
__________________
Owner of Faded Edge (or trigger i used to called it)
-----------------------------------------------
yep thats me =D

+~||Zoiko§on||~+
Reply With Quote
  #4  
Old 07-05-2004, 10:15 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
First off you need to "Be more specific.." as Wan said.

Give us some details, like the ways you have tried it, what exactly isn't it doing, etc. Read below...

"I'm trying to make this NPC that does this, but it's not doing it. Any help?"
Doesn't help does it?


EDIT: How are you taking the HP away from the tree?


Do you have a messenger of some sort?
__________________
[signature]insert here[/signature]
Reply With Quote
  #5  
Old 07-05-2004, 10:22 PM
jackson2k4 jackson2k4 is offline
Registered User
jackson2k4's Avatar
Join Date: Jan 2004
Posts: 39
jackson2k4 is on a distinguished road
to show the hp im using "message #v(this.npc)/250" 250 is how much health the tree has..... and i want the axe to be able to take away hp.....ive tried "if (hasweapon && keydown(7)" but that didnt work X . x


yahoo= zakusonu
AIM =zakusonuu

XD im on both
__________________
Owner of Faded Edge (or trigger i used to called it)
-----------------------------------------------
yep thats me =D

+~||Zoiko§on||~+
Reply With Quote
  #6  
Old 07-05-2004, 10:25 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
In the weaponscript, use triggeraction.

In the tree npc, only take hp away if it was triggered.
__________________
[signature]insert here[/signature]
Reply With Quote
  #7  
Old 07-05-2004, 10:26 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
Wow I think even my own ****let skills can do this. Offline anyway.

What are you having the axe do? Just pressing a special key with a gani or triggeraction whatever?
__________________
Reply With Quote
  #8  
Old 07-05-2004, 10:35 PM
jackson2k4 jackson2k4 is offline
Registered User
jackson2k4's Avatar
Join Date: Jan 2004
Posts: 39
jackson2k4 is on a distinguished road
yeah im having it be a gani......equip it in your items (Q) and then press (D) to use it
__________________
Owner of Faded Edge (or trigger i used to called it)
-----------------------------------------------
yep thats me =D

+~||Zoiko§on||~+
Reply With Quote
  #9  
Old 07-05-2004, 11:06 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
I'm not the most professional scripter or anything but couldnt you have it trigger an action then have the tree pick it up, lose hp, etc?
__________________
Reply With Quote
  #10  
Old 07-05-2004, 11:59 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
Quote:
Originally Posted by Gerami
I'm not the most professional scripter or anything but couldnt you have it trigger an action then have the tree pick it up, lose hp, etc?
red up a little bit
__________________
[signature]insert here[/signature]
Reply With Quote
  #11  
Old 07-06-2004, 02:49 AM
jackson2k4 jackson2k4 is offline
Registered User
jackson2k4's Avatar
Join Date: Jan 2004
Posts: 39
jackson2k4 is on a distinguished road
ok teach me triggeraction...because i tried...and i thaught i new how... but i dont X . x
__________________
Owner of Faded Edge (or trigger i used to called it)
-----------------------------------------------
yep thats me =D

+~||Zoiko§on||~+
Reply With Quote
  #12  
Old 07-06-2004, 05:32 AM
matt8891 matt8891 is offline
Registered User
matt8891's Avatar
Join Date: Jul 2003
Location: New York
Posts: 0
matt8891 is on a distinguished road
Send a message via AIM to matt8891 Send a message via Yahoo to matt8891
Quote:
Originally Posted by jackson2k4
ok teach me triggeraction...because i tried...and i thaught i new how... but i dont X . x

Ehh...Look for a scripting tutorial.
Reply With Quote
  #13  
Old 07-06-2004, 05:59 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
taken from newfeatures2001.txt
Quote:
- New script command: triggeraction targetx,targety,action,params;
This is one of the commands that give you like 50% more scripting
power than before. It is like a combination of hitobjects and
callnpc, but better. With 'triggeraction' you invoke an event
to the object on positon (targetx,targety). If the object is
an npc, then the npc script is called with the flag
'action<action>' set, when the object is a player then the
weapon scripts of the that player are called with the
'action<action>' flag set.
'params' can be one or more parameters, divided by commas;
the called script can read the paramters by accessing the
message code #p(paramindex).
Because this is hard to explain with words, here some
little examples:

- trigger player weapons
You can easily do a weapon which freezes the other
player:

if (playertouchsme) toweapons Freezing-Weapon;
if (weaponfired) {
triggeraction playerx+1.5+vecx(playerdir)*2,
playery+2+vecy(playerdir)*2,freeze,;
}
if (actionfreeze) {
freezeplayer 3;
setplayerprop #c,FREEZED;
}

Both players must have this weapon for making it
working. Then use it on the other player, and he will
be freezed, because a 'freeze' action is sent to him
and his weapon script, called with flag 'actionfreeze',
will freeze him. You can also move the if (actionfreeze) ...
into an system npc so the weapon can be used on all
players.
Other nice things you could do with triggering actions
on players: a stealing weapon which lets the other player
loose gralats (if (actionsteal) lay2 greenrupee,... );
complex attacking weapons that use your own hitpoint
system instead of the default hearts thing

- trigger npcs

Until now npcs can only react to 'playertouchsme' and
'wa****', other things are very hard to do (e.g. the
mining on Graal2001 was made by checking periodically
what animation the player has and before which stone the
player stands). You could do callnpc, but this works only
client-side and you needed to pass parameters with
flags.
Using 'triggeraction' you can make those things much easier.
The mining axe could have the script
if (weaponfired) {
setani jaxe,hammergold0.png;
triggeraction playerx+1.5+vecx(playerdir)*2,
playery+2+vecy(playerdir)*2,mining,#v(axepower);
}
If you now use the weapon on a stone, the stone npc could
check this so:
if (actionmining) {
axepower = strtofloat(#p(0));
this.power -= axepower;
if (this.power<=0) {
setstring uncraftedgold,#v(strtofloat(#s(uncraftedgold))+1);
hide;
}
}
With this thing you can also easily do switches which are
activated with the hammer, or torch lamps which are turned on
by using a torch on it.
the hp document Stefan posted also has some useful information if for whatever reason this doesn't satisfy you...
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #14  
Old 07-06-2004, 06:19 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
Quote:
Originally Posted by screen_name
red up a little bit
A minute apart ;-;
__________________
Reply With Quote
  #15  
Old 07-06-2004, 07:16 PM
jackson2k4 jackson2k4 is offline
Registered User
jackson2k4's Avatar
Join Date: Jan 2004
Posts: 39
jackson2k4 is on a distinguished road
ok thx for your help guys XD
__________________
Owner of Faded Edge (or trigger i used to called it)
-----------------------------------------------
yep thats me =D

+~||Zoiko§on||~+
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:19 PM.


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