Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Personalized rooms (https://forums.graalonline.com/forums/showthread.php?t=11126)

Xythar 09-04-2001 05:16 AM

Personalized rooms
 
I started toying around with the idea of giving the player the ability to reaarange their room this morning, and I've been planning and messing around with the code for the past ten minutes or so. I've found that there's a few ways I could make it, and I'd like some advice as to which to do. Keep in mind that this is my first scripting project --- I've never made a real NPC by myself in my life.

The most sophisticated and ideal way would be how I was planning on doing it in the first place --- chat commands. For instance, if the player says "move itemname left," said item moves left, or the specified direction (up, down, left, right). Unfortunately, this would require the creation of onwall detection, which I don't think I'm quite ready for yet. Also, if it was used in a playerhouse setting it would take a bit more scripting to keep all the pieces of furniture from moving at once. I've thought of ways to solve this, all of them rather sloppy.

Another, simpler way would be to hide and show the images. For instance, should the player say "itemname left corner" the item would move to that corner. There's very little chance I'll use this
system, as it would severely limit the players options, and would allow the player to stack the furniture on top of each other. Yech.

The easiest way, obviously, is to use canbepulled and canbepushed, so that the player has to drag the items around the room. This would solve all of the problems previously mentioned, but it seems a little cheap to me; like I'm taking the easy way out. I'd add the ability to remove and add items using hide and show, but I still don't like that it would take all of five minutes to script. I may not be at a very advanced level (or even an intermediate level for that matter) but I'd like to at least give myself a bit of a challenge.

Any suggestions? Comments? Methods I didn't think of? Anything would be appreciated. Also, can someone tell me why it's better to use playerchats with strequals instead of just playersays? Kaimetsu only flamed me when I said I used playersays, without explaining why I shouldn't. ;)

SSj_Link 09-04-2001 06:23 AM

Hmmm Maybe....
 
how about,

if the image is the blue couch

if (playerchats&&strequals(#c,Right)) {
setimg bluecoughright.gif;
}
if (playerchats&&strequals(#c,Left)) {
setimg bluecoughleft.gif;
}
if (playerchats&&strequals(#c,Down)) {
setimg bluecouch.gif;
}

and so on :)

Merlin 09-04-2001 06:40 AM

Stefan does'nt want complex NPCs in houses and he's removing those personal rooms so i've heard

SSj_Link 09-04-2001 07:05 AM

x.x
 
Hmmm

if there is any scripting its probly me FrEaKy CaRnIe ( Known as Da7footdude)

Xythar 09-04-2001 08:34 AM

Re: Hmmm Maybe....
 
Quote:

Originally posted by SSj_Link
how about,

if the image is the blue couch

if (playerchats&&strequals(#c,Right)) {
setimg bluecoughright.gif;
}
if (playerchats&&strequals(#c,Left)) {
setimg bluecoughleft.gif;
}
if (playerchats&&strequals(#c,Down)) {
setimg bluecouch.gif;
}

and so on :)

That would just change the direction it's facing. What I'm scripting, it moves the actual furniture around the room.

And Merlin, that silly. What's wrong with NPC's?

Merlin 09-04-2001 09:46 AM

Re: Re: Hmmm Maybe....
 
Quote:

Originally posted by Xythar


That would just change the direction it's facing. What I'm scripting, it moves the actual furniture around the room.

And Merlin, that silly. What's wrong with NPC's?

Something about when the owners are transfered of the house they need to be changed so he wants to be default again

fuzie 09-04-2001 11:45 AM

why not just make it so that it moves 2x,2y when u say up down left right????? and use a onwall script to keep the player from putting it on hte wall like make it go back to the middle of hte room if onwall?????i aint to abd at scripting but tell me if this would werk!!

konidias 09-04-2001 12:48 PM

No merlin, stefan meant he doesn't want personal npcs that work only according to a certain username.. If somehow you could change the username through the npc then it would be fine.. like "this.owner" or something.. I don't know the value or string for the owner of a house, but it would need to be similar to that. Not something like:

if (playerchats&&strequals(#c,blah)&&strequals(#a,acc ountname){

He doesn't want certain account names.. it would have to be a guild, or a changeable string. ;)

nyghtGT 09-04-2001 12:50 PM

just
 
why dont you make it where you use the pics1.png ....

if (playerchats && strequals(#c,object bed)) {
setimgpart pics1.png ...... and so on ...

then have it where the player can edit the direction and stuff too ...

CyanideSR71 09-04-2001 05:46 PM

Just to tell ya, that idea was done already, it was a project Maxim and I made up where you could buy a house, and then have to buy the furnishings and stuff.
The railroad track builder format is a good way of doing it.
*reads Kai's post* Aww... crap, someone else did it too =(.

Yakuna2001 09-04-2001 06:40 PM

Quote:

Originally posted by Kaimetsu
And I did it better than j00.
naturally. arent like you and kyle the best on the boards rightnow?

Yakuna2001 09-04-2001 06:43 PM

Quote:

Originally posted by Kaimetsu


We're probably the top two, yeah.

heh i should hold a scripters competition :) see who is the best ;)

Yakuna2001 09-04-2001 06:48 PM

Quote:

Originally posted by Kaimetsu


Between me 'n' Kyle? I dunno, we both have skills that the other doesn't. He can beat me in some aspects and I can beat him in others. But I don't think either of us cares much - we have a kind of mutual respect.

its good to be like that, instead of always trying to say each one is better than each other.
but, i got to admit, you two are very good from what ivew seen, i presume you do other scripting to? and i thought lady m was good too, she always seems to have an answer for everyones script problems :)

Yakuna2001 09-04-2001 07:03 PM

Quote:

Originally posted by Kaimetsu


Other scripting? Well, I program stuff outside of Graal. Working on my own game, in fact.

And yeah, Lady Midnight is pretty good. It strikes me that she's the only female scripter I've ever met. Scary.

your own game eh? nice.... well, if i can ever help with hosting it, let meknow, i have access to a server maching, and i can work with redhat, and other linux good i think :)

Xythar 09-04-2001 08:41 PM

Aargh, already been done? Twice? Ah well, great minds think alike. :rolleyes:

Although, something like the edited railroad builder would be very nice, but require some pretty advanced scripting. Also, I wasn't aware that you could use pics1.png in setimg --- thanks for the tip. :)

Merlin 09-05-2001 12:49 AM

Oh, then you can just use level.strings for the master key

fuzie 09-05-2001 02:54 AM

i got a great idea how you can do it and i've got it almost done..........make a hotel and sell keys per room and if the player has that key then they cna move the furniture around.......i am finishing it up right now!!!!

Enigma_GP6 09-05-2001 04:38 AM

If fizie were a cow, I swear I'd never eat another hamburger again....

-Rebel95

fuzie 09-05-2001 07:35 AM

**middle fingers slowly goes up facing Engima_GP6,Rebel95,

i'd like you to script it smart @$$$$!!!!

sry i couldnt finish the room today but tomorrow i will and put it up on the forums okie? kk L8 ALL

'~BrIaN~'

konidias 09-05-2001 07:40 AM

Don't you just love newbies? :D

This script would be nice.. anyone mind sending it to me? It would be cool to have on the 2001 server for player rooms.. Of course if it doesn't cause major lag or anything. :)

fuzie 09-05-2001 07:51 AM

hahaha aint laggy at all i just gotta finish a few scripts with the light turning on and off

nyghtGT 09-05-2001 11:12 AM

wha?
 
wha?

Xythar 09-05-2001 10:32 PM

Quote:

Originally posted by Kaimetsu
Mine wasn't laggy at all, and it worked better than people just pushing furniture around or shouting out commands. I should dig it out sometime.
I'm offended, Kaimetsu. :p I didn't bother finishing it anyway, I'm just messing around and trying to teach myself onwall. So dull.:asleep:

Yakuna2001 09-06-2001 03:05 AM

Quote:

Originally posted by Kaimetsu
Mine wasn't laggy at all, and it worked better than people just pushing furniture around or shouting out commands. I should dig it out sometime.
yeah, dig it out, and give it to me.... ;)

nyghtGT 09-06-2001 04:53 PM

:spam:

Yakuna2001 09-06-2001 06:11 PM

Quote:

Originally posted by Kaimetsu


I might give it to Stefan.

fine....... :D


All times are GMT +2. The time now is 10:41 AM.

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