Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (Grant), 999 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Workshops dont teach interactions? #292686
10/06/09 00:21
10/06/09 00:21
Joined: Oct 2009
Posts: 5
So Cal
H
H8BitHero Offline OP
Newbie
H8BitHero  Offline OP
Newbie
H

Joined: Oct 2009
Posts: 5
So Cal
Hi Everyone!

I come to the forums asking another question, after getting my answer to the last one so fast! I had done all of the workshops that came with lite-c and JUST realized, there were no workshops for interaction, i.e. doors, buttons, or switches in the level. How would I go about giving my player model the ability to interact with a door?

Thank You Guys!
H8Bit-Hero

Re: Workshops dont teach interactions? [Re: H8BitHero] #292688
10/06/09 00:29
10/06/09 00:29
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
Hey,

Use something like (ugly and untested)

Code:
function use(){
   c_scan(player.x, player.pan, vector(120,0,200), SCAN_ENTS | SCAN_LIMIT);
   if(you){ //if something found
      if(your.skill1 == 1){ //use if(your.class == door){ and defines
         your.pan = 90;
      }
   }
}
...
on_enter = use;



hope this helps

Re: Workshops dont teach interactions? [Re: MrGuest] #292689
10/06/09 00:52
10/06/09 00:52
Joined: Oct 2009
Posts: 5
So Cal
H
H8BitHero Offline OP
Newbie
H8BitHero  Offline OP
Newbie
H

Joined: Oct 2009
Posts: 5
So Cal
oh my

all i understand is that c_scan is what checks if there is an interactive object nearby, right? My next question(s) is/are how do I identify what is and is not an interactive object? what do all the values inside of c_scan mean? and what are skill and class for?

I know some of this is suuuuper novice, but any help would be greatly appreaciated

Re: Workshops dont teach interactions? [Re: H8BitHero] #292690
10/06/09 01:20
10/06/09 01:20
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
no probs

yeah c_scan will return the closest object to the player as the 'you' pointer
from the manual
Originally Posted By: c_scan
c_scan (VECTOR* pos, ANGLE* ang, VECTOR* sector, var mode);
pos scan origin.
ang scan direction Euler angle.
sector.x horizontal scan sector, or scan cone width in degrees (360 for a full sphere)
sector.y vertical scan sector in degrees, or 0 for a circular scan cone.
sector.z scan range in quants.


using defines will tidy up your code and make it a lot more understandable to yourself and the reader
e.g.
Code:
if(your.skill31 > 0){
   if(your.skill32 > 30){
      if(your.skill33 == 0){
         reload();
      }else{
         shoot();
      }
   }
}


could be written as
Code:
#define health skill31
#define energy skill32
#define bullets skill33

if(your.health > 0){
   if(your.energy > 30){
      if(your.bullets == 0){
         reload();
      }else{
         shoot();
      }
   }
}

now makes much more sense

giving everything in the level a class will let the player know instantly what he's found, though you could use things like EVENT_SCAN

hope this helps a bit more
experiment, create, play, what's the worst that could happen tongue

Re: Workshops dont teach interactions? [Re: MrGuest] #292691
10/06/09 01:42
10/06/09 01:42
Joined: Oct 2009
Posts: 5
So Cal
H
H8BitHero Offline OP
Newbie
H8BitHero  Offline OP
Newbie
H

Joined: Oct 2009
Posts: 5
So Cal
Several nuclear explosions is what can happen!!!

Lol, didn't mean to sound lazy, I just really didn't know where to even begin with that code, so experimenting was out of the question. This clears a butt load up though! thank you VERY much grin


Moderated by  HeelX, rvL_eXile 

Gamestudio download | chip programmers | 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