Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-16-2008, 06:02 PM
TheStan TheStan is offline
Stan?
Join Date: May 2008
Location: U.S.
Posts: 100
TheStan is on a distinguished road
Send a message via AIM to TheStan Send a message via MSN to TheStan
putnpc3 (Nothing New)

Just whipped up a quick little putnpc3() function to make it easier on folks who'd rather not make an npc in a level in the level editor etc. then upload etc.

PHP Code:
/**** Notes ****\
PARAMS:
  levelname - The level you wish for the npc to be placed at.
  x - The x coordinate the npc will be placed at.
  y - The y coordinate the npc will be placed at.
  classes - Supports both arrays and single strings. List of classes joined to the npc.
  vars - Supports both arrays and single strings. Variables you wish set to the npc.
  vals - Supports both arrays and single string. Values for the variables.
\***************/
public function putnpc3(levelnamexyclassesvarsvals) {
  
with (findlevel(levelname)) {
    
with (putnpc2(xy"")) {
      if (
vars.type() == vals.type()) {
        if (
vars.type() == 3) {
          if (
vars.size() == vals.size()) {
            for (
0vars.size(); v++) {
              
this.(@ vars[v]) = vals[v];
            }
          }
        }
        else {
          if (
vars.type() == 1) {
            
this.(@ vars) = this.(@ vals);
          }
        }
      }
      
this.joinedclasses classes;
    }
  }

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 01:11 AM.


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