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
  #16  
Old 10-30-2005, 10:01 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Yen
actionleftmouse is called when you click on the NPC.
Except his script is apparently a weapon. Don't give bad advice.
Reply With Quote
  #17  
Old 10-30-2005, 10:03 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by excaliber7388
can't get this to work, should warp player, set attributes, and gender
You've had approximately the same problem with your approach in several threads already. We've explained in great detail what the problems with your approach are. We've enumerated what is clientside and what is serverside. We've explained how to translate between the two. There is a second part to rule 1, you know.

I'll try this:
The following information is available in newfeatures2002.txt:

Quote:
- mouse variables:
mousex, mousey - position of the mouse in the level
mousebuttons - tells you which mouse buttons are pressed,
it's a sum of the values 1 for left mouse button, 2 for middle
mouse button and 4 for the right mouse button, so it's 1+2+4=7
when all buttons are pressed; you can also use the flags described
later to easier check for the mouse buttons
mousescreenx, mousescreeny - position of the mouse in the game screen
mousewheeldelta - the movement of the mouse wheel in the last 0.05 seconds
- flags for checking if a mouse button is pressed:
leftmousebutton - is set when the left mouse button is down
middlemousebutton - is set when the middle mouse button is down
rightmousebutton - is set when the right mouse button is down
- events:
mousedown - occurs when a mouse button has been pressed, so
you can do things like if (mousedown && leftmousebutton) message hi;
mouseup - occurs when a mouse button has been released
mousewheel - occurs when the mouse wheel has been used
- triggered actions (only on npcs where the player has clicked on,
is also sent to the npcserver):
actionleftmouse - the player has clicked on the npc
actionmiddlemouse - the player has clicked with the middle mouse button on the npc
actionrightmouse - the player has right-clicked on the npc
actiondoublemouse - the player has double-clicked on the npc
The following is the correct format of weapon triggeractions:
NPC Code:
triggeraction 0,0,serverside,weaponname,params;



What do you suppose the problem(s) with your approach could be? I'll make this easier by bolding the parts you ought to look at:

NPC Code:
// Graal2002 NPC by Excaliber
if(actionserverside){
...
}
if (mousedown && ...){
...
}

//#CLIENTSIDE
if (mousedown && ...){
...
triggeraction playerx,playery,serverside,warp;
}
if (created) {
...
}



What do you suppose is wrong with that?

Other than that, I do have a suggestion: you should definitely consider placing a lot of those conditional checks within the event block you have associated them with. It might help you understand what's going on with your script better.

Last edited by Lance; 10-30-2005 at 10:39 PM.. Reason: typo
Reply With Quote
  #18  
Old 10-30-2005, 11:25 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Since when do weapons use showcharacter?
Reply With Quote
  #19  
Old 10-30-2005, 11:30 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Yen
Since when do weapons use showcharacter?
Perhaps since the time showcharacter NPCs use reserved triggeractions for weapons? Your advice was bad becuase you didn't elaborate.
Reply With Quote
  #20  
Old 10-30-2005, 11:56 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
this is not a weapon this is the current script, it does not warp the player

NPC Code:
if (actionservside){
if(strequals(#p(0),warp)){
setlevel2 begin_darkrival2.nw,31,31;
}
}
//#CLIENTSIDE
if(actionleftmouse){
setgender male;
sethead head.png;
setbody body.png;
enabledefmovement;
hideplayer.05;
triggeraction playerx,playery,serverside,warp;
}

Reply With Quote
  #21  
Old 10-31-2005, 12:40 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
-.- do you read?
1. you're triggering at the player not the npc
2. you spelled serverside wrong
__________________
Reply With Quote
  #22  
Old 10-31-2005, 12:47 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
still doesn't work:

NPC Code:
if (actionserverside){
if(strequals(#p(0),warp)){
setlevel2 begin_darkrival2.nw,31,31;
}
}
//#CLIENTSIDE
if(actionleftmouse){
setgender male;
sethead head.png;
setbody body.png;
enabledefmovement;
hideplayer.05;
triggeraction x,y,serverside,warp;
}

Reply With Quote
  #23  
Old 10-31-2005, 01:06 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
Give the NPC a shape (setshape).
__________________
Skyld
Reply With Quote
  #24  
Old 10-31-2005, 02:29 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
it registers the fact that i clicked on the NPC, it changes the player's attributes, however, it does not warp the player
Reply With Quote
  #25  
Old 10-31-2005, 03:18 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by excaliber7388
this is not a weapon this is the current script, it does not warp the player
Then, as I said, you should not use special reserved triggeractions. Actions taking the name "server*" are received by the Control-NPC (except for actions taking the name "serverside", which are received by the weapon you specify as the next parameter).

If you insist on keeping a triggeraction, name the action something else. Perhaps 'warp' would do; then you would check it with if (actionwarp). Also, as Skyld said, you would need a serverside setshape for it to receive the action.
Reply With Quote
  #26  
Old 10-31-2005, 04:52 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
thanks you guys this really helped
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:57 PM.


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