Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 10-18-2011, 07:36 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
You make things so much simpler.
All I have to do now is add the images of random trash and presto.
Would you possible know how to put names and images in an array?
maybe something like.
PHP Code:
temp.trash = {
  {
"trashone.png"Name},
  {
"trashtwo.png"Name}
}; 
I believe this is how a "3D" array works?
But how would you read the information from that and pick a random trash object O_O
PHP Code:
this.chosen random(0temp.trash.size()); 
Yet again im probably horribly wrong.
I was just thinking doing an array would make it look much nicer and be easier to add more items, rather than doing this.
PHP Code:
temp.chosen random(13);
if (
temp.chosen == "1") {
  
this.item "Garbage 1";
  
this.image "Image for it";
}
if (
temp.chosen == "2") {
  
this.item "Garbage 2";
  
this.image "Image for it";
}
if (
temp.chosen == "3") {
  
this.item "Garbage 3";
  
this.image "Image for it";

__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
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 05:16 AM.


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