Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,498 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Action when object is in view #341507
09/17/10 16:58
09/17/10 16:58
Joined: Sep 2010
Posts: 42
NS, Canada
gSet Offline OP
Newbie
gSet  Offline OP
Newbie

Joined: Sep 2010
Posts: 42
NS, Canada
I've got a slightly strange requirement, here. I'm using a first-person movement script, and I'm wondering if it's possible to activate a certain event (such as send a bit value to the parallel port) when a specific object is in view. I'm still in the process of learning Lite-C so I really just need to know if this is possible and if it's going to be complex. Any advice would be appreciated!


"If it's true what you say to me, that the whole world will mourn his death - If the whole world will weep, I will give him back his breath."
Re: Action when object is in view [Re: gSet] #341508
09/17/10 17:06
09/17/10 17:06
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
No worries.

All you need to do is research events as triggered by "c_scan", so you
can perform a "port_out" command to send data to the serial or parallel port.

Both "c_scan" and "port_in / port_out" commands can be found in the manual.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Action when object is in view [Re: EvilSOB] #341618
09/18/10 17:18
09/18/10 17:18
Joined: Dec 2008
Posts: 271
Saturnus Offline
Member
Saturnus  Offline
Member

Joined: Dec 2008
Posts: 271
Depending on how "in view" is meant, you can also use the CLIPPED flag.

Re: Action when object is in view [Re: Saturnus] #341795
09/20/10 16:31
09/20/10 16:31
Joined: Sep 2010
Posts: 42
NS, Canada
gSet Offline OP
Newbie
gSet  Offline OP
Newbie

Joined: Sep 2010
Posts: 42
NS, Canada
Thanks for the suggestions! This should work great


"If it's true what you say to me, that the whole world will mourn his death - If the whole world will weep, I will give him back his breath."
Re: Action when object is in view [Re: gSet] #341907
09/21/10 15:53
09/21/10 15:53
Joined: Sep 2010
Posts: 42
NS, Canada
gSet Offline OP
Newbie
gSet  Offline OP
Newbie

Joined: Sep 2010
Posts: 42
NS, Canada
Alright, so I've been trying to learn to use c_scan, but for some reason this just isn't working for me. I've read all the documentation and searched the forums but to no avail. What I'm trying to do is essentially have one model use ProxFinish to detect when another entity comes within 400 quants (in any direction) and then load a specific level. Sounds easy, right? There must be something simple I'm doing wrong or forgetting. Here's what I've got.

Sorry it isn't tabbed, not sure how to do that. Also, camera_follow is just a simple function that does exactly what it sounds like.

action ProxFinish() {
my.emask |= ENABLE_DETECT;
while(1) {
c_scan(my.x,my.pan,vector(0,0,400),SCAN_ENTS);
wait(1);
}
}

action PlayWalk() {
camera_follow(me);
my.emask |= ENABLE_SCAN;
VECTOR vFeet;
vec_for_min(vFeet,me);

while (1) {
my.pan += (key_cul-key_cur)*10*time_step;
var distance = (key_cuu-key_cud)*30*time_step;
c_move(me, vector(distance,0,0), NULL, GLIDE);
c_trace(my.x,vector(my.x,my.y,my.z-1000),IGNORE_ME | IGNORE_PASSABLE);
my.z = hit.z - vFeet.z;
if (event_type == EVENT_SCAN) {
level_load("Level1.wmb");
}
wait(1);
}
}


"If it's true what you say to me, that the whole world will mourn his death - If the whole world will weep, I will give him back his breath."
Re: Action when object is in view [Re: gSet] #341912
09/21/10 16:49
09/21/10 16:49
Joined: Apr 2008
Posts: 650
Sajeth Offline
User
Sajeth  Offline
User

Joined: Apr 2008
Posts: 650
First, youre using the event-system in a wrong way, I suggest to look it up in the manual again.
Second, just use vec_dist(my.x,player.x) for distance detection.


Teleschrott-Fan.
Re: Action when object is in view [Re: Sajeth] #342099
09/23/10 13:35
09/23/10 13:35
Joined: Sep 2010
Posts: 42
NS, Canada
gSet Offline OP
Newbie
gSet  Offline OP
Newbie

Joined: Sep 2010
Posts: 42
NS, Canada
Problem solved. It was a dumb mistake, I just didn't find the documentation very clear... Came about it with enough trial and error.


"If it's true what you say to me, that the whole world will mourn his death - If the whole world will weep, I will give him back his breath."

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

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