Gamestudio Links
Zorro Links
Newest Posts
zorro license, IB connection
by miwok. 12/06/23 16:32
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
5 registered members (miwok, AndrewAMD, TipmyPip, 3run, 1 invisible), 633 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: question about event_impact [Re: JetpackMonkey] #137021
06/18/07 13:17
06/18/07 13:17
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
the beam is set to my.passable = off and so is the target entity, i have tried c_setminmax as well to no avail.


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: question about event_impact [Re: jigalypuff] #137022
06/18/07 14:58
06/18/07 14:58
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
Code:

var phaser_speed;

define _frameCt, skill22;
define _hit, flag3;

function shipEvent() {
if (event_type == event_block
|| event_type == event_entity
|| event_type == event_impact
|| event_type == event_push) {
my._hit = on;
}
}
function f_ship{
wait(1);
c_setminmax(me);
my.scale_x = 4.0;
my.scale_y = my.scale_x;
my.scale_z = my.scale_x;
my.enable_entity = on;
my.enable_impact = on;
my.enable_scan = on;
my.event = shipEvent;
while (me != null && my._hit == off) {
wait(1);
}
if (me != null) { ent_remove(me); }
}
function phaserEvent() {
if (event_type == event_block
|| event_type == event_entity
|| event_type == event_impact
|| event_type == event_push) {
if (you != null) {
if (you == player) {
error("player laser collision");
}
}
my._hit = on;
}
}
function my_phaser() {
wait(1);
c_setminmax(me);
my.scale_x = 200;
my.scale_y = 0.5;
my.scale_z = 0.5;
my.passable = off;
my.oriented = on;
my.flare = on;
my.bright = on;
my.ambient = 100;
my.pan = player.pan;//--->player.pan and tilt set to camera
my.tilt = player.tilt;
my.enable_block = on;
my.enable_entity = on;
my.enable_impact = on;
my.enable_push = on;
my.event = phaserEvent;
phaser_speed.x = 50 * time;
phaser_speed.y = 0;
phaser_speed.z = 0;
my._hit = off;
my._frameCt = 0;
while (me != null && my._hit == off) {
//if (my.roll > 150) {
//my.passable = off;
//}
my.roll += 25 * time;
you = player;
c_move(my,vector(phaser_speed*time,0,0), nullvector, ignore_passable | ignore_you);
my._frameCt += 1;
if (my._frameCt >= 20) { break; }
wait(1);
}
if (me != null) { ent_remove(me); }
}



Re: question about event_impact [Re: testDummy] #137023
06/18/07 17:00
06/18/07 17:00
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
dude thanks, that works great, now onto ever more confusion by trying to add a targeting code lol


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: question about event_impact [Re: jigalypuff] #137024
06/20/07 16:27
06/20/07 16:27
Joined: Jul 2006
Posts: 91
Florida, USA
Knuckles Offline
Junior Member
Knuckles  Offline
Junior Member

Joined: Jul 2006
Posts: 91
Florida, USA
this code is interesting. I just need to clarify something. This code checks to see if one entity has collided with another entity and then performs an action, right? Is that what this does:

if (event_type == event_block
|| event_type == event_entity
|| event_type == event_impact
|| event_type == event_push)


If so, then what qualities would event_impact have in order to check to see if an entity has collided with it? That's what I'm still wondering.

Last edited by Knuckles; 06/20/07 16:27.
Re: question about event_impact [Re: Knuckles] #137025
06/20/07 16:40
06/20/07 16:40
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
If both entities are dynamic entities and thus moving through c_move, you cannot be sure that the event_type of entity [1] is alway event_entity and the one of entity [2] is always event_impact.
Thus you have to catch both events, as you cannot be sure which event is set for which entity.

Re: question about event_impact [Re: Xarthor] #137026
06/20/07 17:18
06/20/07 17:18
Joined: Jul 2006
Posts: 91
Florida, USA
Knuckles Offline
Junior Member
Knuckles  Offline
Junior Member

Joined: Jul 2006
Posts: 91
Florida, USA
So how would you catch both events?? Would you have to label each entity differently and do a check to see if that label has collided with it?

Re: question about event_impact [Re: Knuckles] #137027
06/20/07 17:40
06/20/07 17:40
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
No if both entities are dynamic you just set these events activ for both:
my.enable_entity = on;
my.enable_impact = on;

Then you could check if the entity was hit by another entity (event_impact) or if the entity hit another entity (event_entity)

Re: question about event_impact [Re: Xarthor] #137028
06/20/07 18:29
06/20/07 18:29
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
and here`s a weird thing, i added an explosion code for when the target gets hit, but no explosion and the target shoots straight up into the air lol, still trying to figure that one out.


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: question about event_impact [Re: jigalypuff] #137029
06/20/07 19:14
06/20/07 19:14
Joined: Jul 2006
Posts: 91
Florida, USA
Knuckles Offline
Junior Member
Knuckles  Offline
Junior Member

Joined: Jul 2006
Posts: 91
Florida, USA
ohhh so enable_impact is a predefined function built in? I didn't know that. That makes it even easier, then thanks.

Page 2 of 2 1 2

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