Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 03-17-2006, 02:28 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Projectshifter
That really doesn't seem to make much sense. You're going to have an NPC in a level that reads onPlayerKills(player)? I'm not sure you're getting the concept of all of this object orientation, onPlayerKills(player) would be a member of what object? If you're wanting to do that, whenever a player is hit you can store the attacker in a string, and if that player dies then trigger to an NPC to calculate it. Otherwise I'm really not seeing the merit of it.
Okay. You let me try to explain.


The "created" event handler doesn't imply a player object assignment:
PHP Code:
function onCreated() {
  
player.chat "blahdeedaregarfg"//doesn't work because no player was involved in the creating

On the other hand, the "playerenters" event handler does imply a player object assignment:
PHP Code:
function onPlayerEnters() {
  
player.chat "blahdeedaregarfg"//works because the player was involved in the entering

It would make sense for the player that was killing to be assigned to the player object of the event handler for "playerkills." However, it would also make sense to know who was killed, so it would make sense for params[0] to contain the player who died's object reference.

In clientside scripting the player object assignment is always assigned to the only clientside player.
Reply With Quote
 


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 12:00 PM.


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