Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,253 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
How would I do this? #273544
06/23/09 11:52
06/23/09 11:52
Joined: Mar 2006
Posts: 321
Norway
Eagelina Offline OP
Senior Member
Eagelina  Offline 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 smile


|E| |V| |A|


A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile
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 Offline
Serious User
croman  Offline
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
O
Ottawa Offline
User
Ottawa  Offline
User
O

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 wink


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: How would I do this? [Re: Ottawa] #273549
06/23/09 12:21
06/23/09 12:21
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
I think he wants to know how to figure out that the letters are in the correct order, physically, means, when the items are in the correct physically order.
I'd use vec_dist for that.

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 Offline OP
Senior Member
Eagelina  Offline 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. smile
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 Offline OP
Senior Member
Eagelina  Offline OP
Senior Member

Joined: Mar 2006
Posts: 321
Norway
@the_clown

First I am girl grin....

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. smile
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
O
Ottawa Offline
User
Ottawa  Offline
User
O

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 laugh

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 Offline
Expert
EvilSOB  Offline
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)
Code:
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 Offline OP
Senior Member
Eagelina  Offline 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. smile
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 Offline OP
Senior Member
Eagelina  Offline 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..... grin


A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1