Graal Forums

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

Petey84 10-21-2001 06:33 AM

Triggeraction
 
Shakaku:
alright, can anyone tell me why when i hit the npc with the hammer, it doesn't inscrease, but when i touch it, it does?? :grrr:

Python523 10-21-2001 06:39 AM

I have the same problem
Here is what I have this so far:
if (actionname) setstring server.namedone,#v(namedone);
message #s(server.namedone)%
how would I get it to add 1 percent every time you fired the weapon which uses the triggeraction command? (I already have the triggeraction working on the weapon)

TDO2000 10-21-2001 08:33 AM

if (actionname) {
setstring server.namedone,#v(namedone+1);
message #s(server.namedone)%;
}

something like this or what u mean?
so it would set the serverstring+1 everytime u use the item and message the new percents... (if u mean something else I misunderstood you)

royce 10-21-2001 10:32 AM

server.percentdone++;

Python523 10-21-2001 11:19 AM

Quote:

Originally posted by TDO2000
if (actionname) {
setstring server.namedone,#v(namedone+1);
message #s(server.namedone)%;
}

something like this or what u mean?
so it would set the serverstring+1 everytime u use the item and message the new percents... (if u mean something else I misunderstood you)

That works but after 1%, it wont add anymore

TDO2000 10-21-2001 04:52 PM

ok hmmm u mean something like this I think:
if (actionname) {
namedone = strtofloat(#s(server.namedone))+1;
setstring server.namedone,#v(namedone);
message #s(server.namedone)%;
}

this should work like u want it =)

Petey84 10-21-2001 07:26 PM

Shakaku:
well it works, kinda. The triggeraction is in the hammer, so whenever i hit the npc once with the hammer, i touch it and it goes up, not when i hit it :grrr:

TDO2000 10-21-2001 07:44 PM

um....
when the hamer does something like:

triggeraction playerx+1.5+vecx(playerdir)*2,playery+2+vecy(playe rdir)*2,hammer,;

and the thing u use the hammer on does:
if (actionhammer) {
hammered = strtofloat(#s(server.hammered))+1;
setstring server.hammered,#v(hammered);
message #s(server.hammered)%;
}

it should work...

Python523 10-21-2001 11:07 PM

Quote:

Originally posted by TDO2000
ok hmmm u mean something like this I think:
if (actionname) {
namedone = strtofloat(#s(server.namedone))+1;
setstring server.namedone,#v(namedone);
message #s(server.namedone)%;
}

this should work like u want it =)

It works fine except now I've run into another problem, I want it to destroy after it reaches 100% but I can't get that to work
if (strequals(#s,server.roastdone=100)) {hide}
that's what I thought would work but it doesn't

Petey84 10-21-2001 11:29 PM

Shakaku:
= means assignment
==means equals, try that :D

Xaviar 10-21-2001 11:33 PM

Quote:

Originally posted by Python523

It works fine except now I've run into another problem, I want it to destroy after it reaches 100% but I can't get that to work
if (strequals(#s,server.roastdone=100)) {hide}
that's what I thought would work but it doesn't

if (strequals(#s(server.roastdone),100)) {hide;}

#s is a messagecode..it needs an argument, and you don't need that semi-colon in gscript in the last line of a block, but you should have it there anyway...I almost wish Stefan would make it so that you do need that last semi-colon...

TDO2000 10-21-2001 11:35 PM

Quote:

Originally posted by Petey84
Shakaku:
= means assignment
==means equals, try that :D

won't work either ;b

if (strtofloat(#s(server.roastdone))>=100) {hide;}

this is the best way =)

Xaviar 10-21-2001 11:38 PM

Quote:

Originally posted by TDO2000


won't work either ;b

if (strtofloat(#s(server.roastdone))>=100) {hide;}

this is the best way =)

Thats what you think ;) *points at previous post*

TDO2000 10-21-2001 11:46 PM

ohhh yeah k this is good too ;)
u were some seconds faster then me =)


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

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