Co-ordinate based system, old forum post
Elexxorine
15 Jan 2008, 11:39In the old forum there was a thread about a co-ordinate based system, being developed by 'I think Im Back'. I'm quite interested in it. Here's the link to the thread: http://www.axeuk.com/ubb/Forum2/HTML/000597.html
Is 'I Think Im Back' the same person as 'I Think Im Dead'? Has anyone else made something similar?
Is 'I Think Im Back' the same person as 'I Think Im Dead'? Has anyone else made something similar?
steve the gaming guy
15 Jan 2008, 15:55Well, ms. elex..
Paul_one/Tr0n/Computer Whizz once helped me with a really cool system. It may not be exactly what you're looking for but I had a section of desert that had to be walked through and I did not want to make a bunch of rooms. So instead, this coordinate idea was devised which allowed like 2 or 3 rooms to turn into as many as I wanted. It was a neat idea. It's in both versions of my King's Quest game. For the life of me, I can't find the link in the forums but it was sometime in 2005 when I was asking about it, I think.
If I stumble across it, I'll link it.
Paul_one/Tr0n/Computer Whizz once helped me with a really cool system. It may not be exactly what you're looking for but I had a section of desert that had to be walked through and I did not want to make a bunch of rooms. So instead, this coordinate idea was devised which allowed like 2 or 3 rooms to turn into as many as I wanted. It was a neat idea. It's in both versions of my King's Quest game. For the life of me, I can't find the link in the forums but it was sometime in 2005 when I was asking about it, I think.
If I stumble across it, I'll link it.
Elexxorine
15 Jan 2008, 16:24Thanks, I'll have a look at what you've done.
steve the gaming guy
15 Jan 2008, 17:23Paul_one may have to give you better specifics about this but I'm going to copy some code out of my game and show you. The first segment was what was posted at the beginning of the file. It sets specific points of interests throughout the grid; in other words, these are the non-repeating room coordinates...
Now here's some code from the middle part of the game. It defines the desert rooms including the oasis rooms.
This is the crazy formula:
startscript {
set string <oasis[1]; 5,2>
set string <oasis[2]; 9,3>
set string <oasis[3]; 7,0>
set string <oasis[4]; 7,-1>
set string <oasis[5]; 6,3>
set string <oasis[6]; 10,6>
set string <oasis[7]; 0,3>
set string <oasis[8]; 0,4>
set string <oasis[9]; 0,5>
set string <oasis[10]; 0,6>
set string <oasis_room[1]; oasis1>
set string <oasis_room[2]; oasis2>
set string <oasis_room[3]; oasis3>
set string <oasis_room[4]; stone temple>
set string <oasis_room[5]; desert skeleton>
set string <oasis_room[6]; tents>
set string <oasis_room[7]; death1>
set string <oasis_room[8]; death2>
set string <oasis_room[9]; death3>
set string <oasis_room[10]; death4>
if ( $loadmethod$ = normal ) then do <start>
}
properties <desert_x=0; desert_y=0>
Now here's some code from the middle part of the game. It defines the desert rooms including the oasis rooms.
define room <start>
alias <end of the forest>
prefix <the>
look <At the edge of the forest, the desert sands strangle what remaining grass tries to grow. Further west is nothing but desert sand as far as you can see.>
south do <desert_exit(S)>
east {
goto <northeastern clearing>
}
west do <desert_exit(W)>
description {
msg <You are at the |b|clend of the forest|xb|cb.|n>
msg <#quest.lookdesc#>
}
end define
define room <desert>
prefix <the>
look <Endless sand in all directions.>
north {
if ( #edgedetect[2]# = FALSE ) then msg <The face of a cliff blocks any further passage north.> else do <desert_exit(N)>
}
south do <desert_exit(S)>
east do <desert_exit(E)>
west do <desert_exit(W)>
script {
set numeric <ED_north1; #game:desert_y# - 1>
set numeric <ED_east1; #game:desert_x# - 1>
set string <edgedetect[1]; $desertroom(%ED_east1%; #game:desert_y#)$>
set string <edgedetect[2]; $desertroom(#game:desert_x#; %ED_north1%)$>
}
end define
define room <oasis1>
alias <oasis>
prefix <the>
look <You've reached the oasis. What a pleasant relief to find among the desert sands.>
north do <desert_exit(N)>
south do <desert_exit(S)>
east do <desert_exit(E)>
west do <desert_exit(W)>
description {
msg <You are at the |b|cloasis|xb|cb.|n>
msg <#quest.lookdesc#>
}
prefix <the>
article <it>
gender <it>
end define
end define
define room <oasis2>
alias <oasis>
prefix <the>
look <You've reached the oasis. What a pleasant relief to find among the desert sands.>
north do <desert_exit(N)>
south do <desert_exit(S)>
east do <desert_exit(E)>
west do <desert_exit(W)>
description {
msg <You are at the |b|cloasis|xb|cb.|n>
msg <#quest.lookdesc#>
}
end define
end define
define room <oasis3>
alias <oasis>
prefix <the>
look <You stand before a huge opening in the cliff to the north. You can see a huge stone temple carved right into the side of the cliff.|nA small oasis sits near a small boulder.>
north do <desert_exit(N)>
south do <desert_exit(S)>
east do <desert_exit(E)>
west do <desert_exit(W)>
end define
This is the crazy formula:
define function <desertroom>
set string <returning; 1>
set numeric <upper; $ubound(oasis)$>
if ( $numberparameters$ > 0 ) then {
if ( $parameter(1)$ > 0 ) and ( $parameter(2)$ < 0 ) then {
set string <hypoth; $parameter(1)$,$parameter(2)$ >
set string <returning; FALSE>
for <i; 1; %upper%> {
if ( #hypoth# = #oasis[i]# ) then set string <returning; TRUE>
}
}
else set string <returning; TRUE>
}
else {
for <i; 1; %upper%> {
set string <dest; #game:desert_x#,#game:desert_y#>
if ( #dest# = #oasis[i]# ) then set string <returning; #oasis_room[i]#>
}
if ( #returning# = 1 ) then {
if ( #game:desert_x# = 0 ) and ( #game:desert_y# = 0 ) then {
set string <returning; start>
property <game; desert_x=0; desert_y=0>
}
else {
if ( #returning# = 1 ) then {
if ( #game:desert_x# = 0 ) and ( #game:desert_y# = 1 ) then {
set string <returning; start2>
property <game; desert_x=0; desert_y=1>
}
else {
if ( #returning# = 1 ) then {
if ( #game:desert_x# = 0 ) and ( #game:desert_y# = 2 ) then {
set string <returning; start3>
property <game; desert_x=0; desert_y=2>
}
else {
set string <returning; desert>
}
}
}
}
}
}
}
return <#returning#>
end define