Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

SOMEBODY HELP ME! I need help with textboxes! Fast!

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
planethunter
Lost In Emotion




Joined: 07 Jul 2003
Posts: 258
Location: Éire

PostPosted: Sat Jul 26, 2003 11:25 pm    Post subject: SOMEBODY HELP ME! I need help with textboxes! Fast! Reply with quote

I need help with creating a textbox via creating npcs.

Yes, it can be done using the "create npc command", but it takes ages to
create each idividual npc.

I was thinking along the lines of a loop, but I remember somebody here
saying loops slow down game speed. Anyhow here's my script:



script, create textbox, begin,
#read below first: Dir=npc's direction, n/w=Pic facing north west, etc.
#npc0=corner PIC of the box
#DirUp=n/w corner, DirRight=s/w corner
#DirDown=n/e corner, Left=s/e corner

#npc1=Sides npc, First value=npc Dir, second=box Pic
#Up=up Right=down Down=left Left=right

#npc2= block npc, one soild 20x20 of the same color.
#up=frame1 down=frame2 right=frame3 left=frame4

variable (textboxtimex,textboxtimey,scrnx,scrny,director,X8,X-8,Y8,Y-Cool
x:= hero x(me)
Y:= hero y(me)
scrnX:=0
scrnY:=1
director:=0
X8:=herox(me)+8
X-8:=herox(me)--8
Y8:=heroy(me)+8
Y-8:=heroy(me)--8

#three rows
for(textboxtimex,scrnX,1,16)
do (createnpc(1,X-8+scrnX,y+2,up)
createnpc(2,X-8+scrnX,y+3,up)
createnpc(1,X-8+scrnX,y+4,right)
wait(1))

#four corners
create npc (0,X--8,y+2,up)
create npc (0,X+8,y+2,down)
create npc (0,X--8,y+3,right)
create npc (0,X+8,y+3,left)

#tidy up the box... the two sides
create npc(1,x--8,y--2)
create npc(1,x+8,y+2)

for (textboxtimeY,0,0,5)
do( set npc direction (2,director)
wait (6)
increment (director)
if (director>>3) then (director:=0))
end


This is extremely complex, yes?
KNOWN PROBLEMS:

The co-ords are wrong, when I tested them the npc's were everwhere!
the loop seems to create npcs in the same place, for some reason.

What intended for was:
to create a box 3 rows of npcs with a 1 npc border round it.
the row SHOULD span the length of the screen, but it doesn't.
also, in the second row, the block tiles should animate until
the box is destroyed.

[b]PLEASE HELP![/b] Oookay...
_________________
~PH


Last edited by planethunter on Wed Jul 30, 2003 8:55 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Uncommon
His legend will never die




Joined: 10 Mar 2003
Posts: 2503

PostPosted: Sun Jul 27, 2003 12:50 am    Post subject: Reply with quote

Download Serg's Faces. It covers all that crap, and comes with a script that he gives full permission to steal.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
planethunter
Lost In Emotion




Joined: 07 Jul 2003
Posts: 258
Location: Éire

PostPosted: Sun Jul 27, 2003 9:38 pm    Post subject: Reply with quote

I had a look at it, it's the very thing I want to avoid:
reems and reems of "create npc"! I was thinking of
reducing the amount of commands. I tried a loop,
(see script) but it doesn't work. I need help with
the loop or at least some way of reducing the
amount of commands. See, I have four scripts
running in the background already and all those
commands won't help. Really confused

I wouldn't have turned here unless I was really
stuck... somebody take the time and look at
the script. I have scaned it numerous times
but I feel the more I mess with it, the more
complicated it gets!

HELP
_________________
~PH
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Camdog




Joined: 08 Aug 2003
Posts: 606

PostPosted: Fri Aug 08, 2003 1:31 am    Post subject: Reply with quote

Why are you so worried about using lots of create npc commands? It won't slow things down more than a similar script using a for loop. A loop command just tells the interpreter to do the commands in the loop a bunch of times, it doesn't reduce the amount of commands that it executes. If you want to get technical, a loop would be slower than just writing everything out by hand, because in a loop, not only would the interpreter have to go through all the create npc commands, but it would have to go through the loop commands and calculate the loop's counter as well. Just go with the script linked above and save yourself a headache.
Back to top
View user's profile Send private message
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Fri Aug 08, 2003 5:34 am    Post subject: the reason your loops aren't right... Reply with quote

Code:

#three rows
for(textboxtimex,scrnX,1,16)
do (createnpc(1,X-8+scrnX,y+2,up)
createnpc(2,X-8+scrnX,y+3,up)
createnpc(1,X-8+scrnX,y+4,right)
wait(1))


your "for" command is wrong. What is "textboxtimex"?

Code:

for(textboxtimex,scrnX,1,16)

as written, textboxtimex is the counter variable. scrnX is the starting value, and 1 is the finishing value, and 16 is the increment.

If you simply remove textboxtimex then this loop ought to do exactly what you want.

Code:

#three rows
for(scrnX,1,16)
do (createnpc(1,X-8+scrnX,y+2,up)
createnpc(2,X-8+scrnX,y+3,up)
createnpc(1,X-8+scrnX,y+4,right)
wait(1))


now it will increment scrnX from 1 to 16

Also, get rid of ALL the "wait" commands in this script, unless you really want your text box to appear slowly on the screen one block at a time.

Somebody probably told you that you should always put a "wait" command inside loops. This is only true of endless "while" loops intended to run in the background.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
planethunter
Lost In Emotion




Joined: 07 Jul 2003
Posts: 258
Location: Éire

PostPosted: Sun Aug 10, 2003 11:56 pm    Post subject: Reply with quote

thanks,

though rerereading this script I see that if the hero is near the edge of
the map then the script cannot create npcs off the map, they'll probably
appear on the other side though. :¬(

textboxtimeX is the first loop, textboxtimeY is the second.
just a silly name, for a loop anyway.

Included the 'wait' command so i could watch which npcs were being
first, and where. Intended to remove it once I got the script right. :¬)

surely somebody before tried to create a textbox out of npcs, that
worked ANYWHERE. I know the faces.rpg showed people how to create
the boxes but, what if somebody wanted to use this script on anymap,
anywhere? Surely you wouldn't need to do a different script for each
textbox... this is why I asked for help.

I can't believe nobody has even tried it before...
_________________
~PH
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Mon Aug 11, 2003 1:23 pm    Post subject: Reply with quote

The problem with having a textbox-out-of-npcs script that runs on any map anywhere is that you have to allocate npcs on all the maps. Which cuts into your already very limited 36 NPC's. And you might draw the textbox on top of other npcs, which means you'll have to stop all the npc's from moving. You'll have to use suspend npcs and resume npcs for that.

To change the appearance of the box and faces, you'll have to use npc stat altering commands, which are very slow - so don't over do it!


But besides from that, I'll say its possible and not to complicated. YOu'll just have to watch out for map borders.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
planethunter
Lost In Emotion




Joined: 07 Jul 2003
Posts: 258
Location: Éire

PostPosted: Wed Aug 13, 2003 2:44 am    Post subject: Reply with quote

that's what I was saying, but what i want to know is:
did anybody here actually try it? and if so did it work?
and if so again do you have the .hss file...

perhaps using the camera position instead of the hero position,
this might help with the problem of map sizes.
_________________
~PH
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Cube
Dimensional Traveller




Joined: 02 Feb 2003
Posts: 294

PostPosted: Wed Aug 13, 2003 3:40 am    Post subject: Reply with quote

I've been around for years, and as far as I know nobody has tried to do that. The reasons for this is that it just isn't worth the time or effort. With all the effort and time that you put into such a system, you could have improved on so many other things in the game, like graphics or gameplay. Most people chose to focus on those rather than worry about customisable hero names Raspberry! (Or, I would imagine so anyhow =\ )
Back to top
View user's profile Send private message
planethunter
Lost In Emotion




Joined: 07 Jul 2003
Posts: 258
Location: Éire

PostPosted: Thu Aug 14, 2003 2:02 am    Post subject: Reply with quote

I am somewhat of a perfectionist.
all I wanted was for my game to have a unique look and feel.
I am willing enough to spend time on the small details now,
and I think the pace of my latest game is much more
involved.

that aside one could only dream of customising textboxes using the 256
colour palette, like the text in the box.

I guess i should hold out. I just only wrote a script for customisable hero
names, that worked. and the ohr update had it built in.
perhaps it would be wise just to wait...
_________________
~PH
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Thu Aug 14, 2003 12:22 pm    Post subject: Reply with quote

Well, there's point to do this if you want textbox faces anyway, but not for names... I forgot you only wanted to customize heor names...

The easiest way to fix the problem with the edge of the map is to make the maps bigger than they are, and give it an impassible black frame around the outside.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
planethunter
Lost In Emotion




Joined: 07 Jul 2003
Posts: 258
Location: Éire

PostPosted: Fri Aug 15, 2003 12:25 am    Post subject: Reply with quote

the custom hero names thing is ruled out, since the latest update has it
built in.

All I wanted was a script to create npcs to look like a textbox.

I consider the current boxes somewhat bland, since there are
quite a number of shades of pink/purple. Why? oh why?
_________________
~PH
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Sat Aug 16, 2003 12:06 pm    Post subject: Reply with quote

pink? purple? I thought that every colour in the master palette was in there... or do you have a custom master palette?
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
planethunter
Lost In Emotion




Joined: 07 Jul 2003
Posts: 258
Location: Éire

PostPosted: Sun Aug 17, 2003 6:59 pm    Post subject: Reply with quote

no no no! I ment the textbox colours used in the ohr, you know navy,
green, red etc. I just thought there were a little too many pink/purple
boxes. They could have been used for some other colours that's all.
_________________
~PH
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Wed Aug 20, 2003 11:06 am    Post subject: Reply with quote

Ah right.. those. Well.. I think that those first 16 colours are all somewhere else on the normal master palette anyway, so if you use th other copies, you could free change show of tose with scripts, yeah.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group