3m0~Scape
Would you like to react to this message? Create an account in a few clicks or log in to continue.
3m0~Scape

3m0 scape HD is now out!


You are not connected. Please login or register

A Few Coding tips { Basics To Advanced }

2 posters

Was This Helpful For 3m0

A Few Coding tips { Basics To Advanced } Vote_lcap100%A Few Coding tips { Basics To Advanced } Vote_rcap 100% [ 3 ]
A Few Coding tips { Basics To Advanced } Vote_lcap0%A Few Coding tips { Basics To Advanced } Vote_rcap 0% [ 0 ]
A Few Coding tips { Basics To Advanced } Vote_lcap0%A Few Coding tips { Basics To Advanced } Vote_rcap 0% [ 0 ]
A Few Coding tips { Basics To Advanced } Vote_lcap0%A Few Coding tips { Basics To Advanced } Vote_rcap 0% [ 0 ]
A Few Coding tips { Basics To Advanced } Vote_lcap0%A Few Coding tips { Basics To Advanced } Vote_rcap 0% [ 0 ]
Total Votes : 3

Poll closed

Go down  Message [Page 1 of 1]

1A Few Coding tips { Basics To Advanced } Empty A Few Coding tips { Basics To Advanced } Sat Mar 28, 2009 3:26 am

jak3str



Laughing well here

Table Of Contents
Basic


How to make an NPC
How to make an NPC talk
How to make an Object
How to make simple commands

Medium

How to make more advanced commands
How to make areas nonWild
Explanation of data types (int, double, boolean)
Explanation of operators( ++, --, +, %, ==, =, !=)
How to add NPC drops
How to change were the player starts, and the starting gear.

Advanced

How to make a teleport random.
Declaring Fields, and Local Variables.
How to add something that saves in your moreinfo file.
How to change the str bonus, price, high alch, low alch, of an item.
How to make an NPC talk to you.

Other

Better ::obj command
How to make a few epic commands
How to make the whole world non wild
Manual Compiler
-----------------------------------------------------------------------------------------------------

Basic

How to make an NPC
For this tutorial, we are going to be working in "autospawn.cfg." Right click your file, and open it with an editing software, such as notepad. In this tutorial, we are going to add a man.
1. Open your Autospawn.cfg
2.Go onto a new line, and add this:

CODE
spawn = 1 2843 3675 0 0 0 0 0 2 man

Let me explain what the numbers mean:
First number = NPC ID
2nd and 3rd = Coordinates
4-9 = Walking type, attacking range ( Set them to 0, and the last to 2, for a basic standing npc)
10 = NPC name. It can be anything you want.
**NOTE: Those are TABS between the numbers
-----------------------------------------------------------------------------------------------------

How to make a NPC talk


Your going to be working in NPCHandler.java, so right click it, and open it up with an editing software, such as notepad. In this tutorial, we will make the man we spawned above, say "I Love Tutorials."

1. Open up NPCHandler.java
2. Search for something one of your NPCs says, like "Welcome to drpepperscape"
3. What you are going to do, is add this.

CODE
if (npcs[i].npcType == 1) {if (misc.random2(30) <= 10) {npcs[i].updateRequired = true;npcs[i].textUpdateRequired = true;npcs[i].textUpdate = "I Love Tutorials";}}

Let me read this code to you in english. If the npc's ID is 1, and a random number selected out of 30 is less then or equal to 10( Speed control ), update that npc, and make the text I Love Tutorials appear.

lolz just alil sumpthin for 3m0 if he need to know to do do this stuff What a Face

if so more coming

~ Jak3str ~ What a Face clown

3m0 pker

3m0 pker
Admin

Not bad. I know how to do all this lol but a good TUT for begginers = )

https://3m0-scape.darkbb.com

jak3str



ty dude

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum