2 registered members (TipmyPip, AndrewAMD),
12,726
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
How would I do this?
#273544
06/23/09 11:52
06/23/09 11:52
|
Joined: Mar 2006
Posts: 321 Norway
Eagelina
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2006
Posts: 321
Norway
|
The plan is this: Player pick up an object and set it on a table or shelve. Each object has a value that is an letter. example: 3 object , 1 is A, 2 is E and 3 is V.I whant the player to be able to spell EVA. Problem is how do I "recognise" that the player has spelled the word right..... since they each are represented with a box that player picks up and set it in the right order..... on a table or a shelve... Thanks for any advice  |E| |V| |A|
A6 and A7 Commercial ------------------- Programmer always searching for more to learn and understand.
|
|
|
Re: How would I do this?
[Re: Eagelina]
#273546
06/23/09 12:10
06/23/09 12:10
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
use strings to know what is the current order of the boxes and then use str_cmp or something like that to see if the word has been properly spelled.
Ubi bene, ibi Patria.
|
|
|
Re: How would I do this?
[Re: croman]
#273548
06/23/09 12:16
06/23/09 12:16
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
User
|
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi! If each letter is an Entity you can use a skill value a = 1 b = 2 and then with a few ifsssssssssssss 
Hope this helps! Ottawa  Ver 7.86.2 Pro and Lite-C
|
|
|
Re: How would I do this?
[Re: Ottawa]
#273550
06/23/09 12:22
06/23/09 12:22
|
Joined: Mar 2006
Posts: 321 Norway
Eagelina
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2006
Posts: 321
Norway
|
@Ottawa
How would you write this in code.... the
If each letter is an Entity you can use a skill value a = 1 b = 2
part?
A6 and A7 Commercial ------------------- Programmer always searching for more to learn and understand.
|
|
|
Re: How would I do this?
[Re: the_clown]
#273553
06/23/09 12:26
06/23/09 12:26
|
Joined: Mar 2006
Posts: 321 Norway
Eagelina
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2006
Posts: 321
Norway
|
@the_clown First I am girl  .... And yes I whant to find out if they are in the right order. But how would you use vec_dist for that? I usually gives an object/entity an value to make this happend. But how do I do it with letters? they dont have "normal" values.....
A6 and A7 Commercial ------------------- Programmer always searching for more to learn and understand.
|
|
|
Re: How would I do this?
[Re: Eagelina]
#273560
06/23/09 12:35
06/23/09 12:35
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
User
|
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi!
If the letters are placed in WED then you have access to their skills but if you use ent_create in your code then you will need a function that will place the values for the letters in the skill section. create letter A and place in skill15 the value 1
Do you have a list of all the permitted words for the letters on the shelf ? Do you know what the answer could be?
Hope this helps! Ottawa  Ver 7.86.2 Pro and Lite-C
|
|
|
Re: How would I do this?
[Re: Eagelina]
#273561
06/23/09 12:38
06/23/09 12:38
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Maybe you could store the ASC value of the letter in a skill of the objects? Then you've just got to figure out where the boxes are in relation to one another in the table. I would say have several "hot-spots" on the table, each looking for a box with c_scan. eg. (untested)
action table() //assumes ASC letter is stored in skill 5 of box entities
{
VECTOR HotSpot1, HotSpot2, HotSpot3;
vec_for_vertex(HotSpot1, my, 25);
vec_for_vertex(HotSpot2, my, 26);
vec_for_vertex(HotSpot3, my, 27);
while(1)
{
if(c_scan(HotSpot1, nullvector, vector(360,0,100), IGNORE_ME|IGNORE_YOU|SCAN_ENTS))
if(you.skill5=69) //if first letter is "E"
if(c_scan(HotSpot2, nullvector, vector(360,0,100), IGNORE_ME|IGNORE_YOU|SCAN_ENTS))
if(you.skill5=86) //and second letter is "V"
if(c_scan(HotSpot3, nullvector, vector(360,0,100), IGNORE_ME|IGNORE_YOU|SCAN_ENTS))
if(you.skill5=65) //and third letter is "A"
{ Do_Boxes_Right(); break; }
wait(1);
}
}
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: How would I do this?
[Re: EvilSOB]
#273567
06/23/09 12:47
06/23/09 12:47
|
Joined: Mar 2006
Posts: 321 Norway
Eagelina
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2006
Posts: 321
Norway
|
@EvilSOB
Yes this sounds interesting, will try it later today...
A6 and A7 Commercial ------------------- Programmer always searching for more to learn and understand.
|
|
|
Re: How would I do this?
[Re: Ottawa]
#273568
06/23/09 12:50
06/23/09 12:50
|
Joined: Mar 2006
Posts: 321 Norway
Eagelina
OP
Senior Member
|
OP
Senior Member
Joined: Mar 2006
Posts: 321
Norway
|
@Ottawa The answer will be like a password. That are predefined. But the entities/boxes will just lie on the floor in a pile. Player must pick the right ones and place them on the shelve in the right order...... to get the key And you need to get it right, if not.....you dont get a key....and arent able to leave..... 
A6 and A7 Commercial ------------------- Programmer always searching for more to learn and understand.
|
|
|
|