Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 692 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
how do I...force field/shield #127612
05/01/07 23:05
05/01/07 23:05
Joined: May 2006
Posts: 53
Puerto Rico
monchito Offline OP
Junior Member
monchito  Offline OP
Junior Member

Joined: May 2006
Posts: 53
Puerto Rico
Hi
I want to do some protection for my entities like a force shield
like many games. It will be shown when an impact is detected. I don't know exactly how to do it . I tried some transparent bitmaps, etc but wihtout
success. Any help is welcome, any reference to a post, tutorial etc....
thanks

Re: how do I...force field/shield [Re: monchito] #127613
05/02/07 03:36
05/02/07 03:36
Joined: Oct 2003
Posts: 702
Z
zazang Offline
User
zazang  Offline
User
Z

Joined: Oct 2003
Posts: 702
Whenever your player is hit,just use "ent_create" instruction to
create the force shield entity and then fade it away.


I like good 'views' because they have no 'strings' attached..
Re: how do I...force field/shield [Re: zazang] #127614
05/02/07 03:41
05/02/07 03:41
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline

Expert
Blink  Offline

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
i am looking for that same type of code. if you get a working code, can you please post it?

Re: how do I...force field/shield [Re: Blink] #127615
05/03/07 10:58
05/03/07 10:58
Joined: May 2006
Posts: 53
Puerto Rico
monchito Offline OP
Junior Member
monchito  Offline OP
Junior Member

Joined: May 2006
Posts: 53
Puerto Rico
ok, i tried the sugestion and....
1 created a force shield entity (a cilinder without top and bottom, some sides)
2 assigned an action
3 modified the event of the shield protected entity
4 worked really good for me
5 thanks....

action act_shield
{
shield = my;

while(!player){ wait(1);}

my.x = the_robot.x;
my.y = the_robot.y;
my.z = the_robot.z;
my.albedo = 0;
my.unlit = on;
my.scale_x = 1;
my.scale_y = 1;
my.scale_z = 1;
my.passable = off;
my.push = 0;
my.health = 150;
my.passable = on;
my.transparent = ON;
my.invisible = off;
my.ambient = 100;
my.alpha = 0;

// shield is a cilinder whitout some sides
while(shield.health > 0) // as long as still active
{
my.x = the_robot.x; // move with the protected entity
my.y = the_robot.y;
my.z = the_robot.z;

my.pan += 1; // do some rotating effect
wait(1);
}
}

/************************************/

function robot_event()
{
if(EVENT_TYPE == EVENT_SHOOT)// active when player is shooting the robot...
{ // ...can't do damage if player is not in range
if (player.hlock == 1) // hlock = 1 active when distance between
{ // player and robot is below 350 (vec_dist())
if(shield.health <= 0) // as long as the shield is active...
{ // ...do not decrease entity health
my.health -= 10;
}

// shield_sw ---is a var to cancel repeating hits to initiate
// the shield on/off out of control
if((shield_sw == 0) && (shield.health > 0))
{
shield.health -= 10; // reduce robot shield energy
shield_sw = 1; // do not allow more shield hits until finish
shield.alpha = 0; // initialize shield alpha
while (shield.alpha < 50) // make more solid
{
shield.alpha += 5 * time;
wait(1);
}
shield.alpha = 50; // make more transparent
while (shield.alpha > 5)
{
shield.alpha -= 5 * time;
wait(1);
}

shield.alpha = 0;
shield_sw = 0; // reset the switch to allow another complete
} // cycle of shield fading

}
}

scaned_entity = null;
if (EVENT_TYPE == event_detect)
{
scaned_entity = you;
// save the entity position scaned in this global vector
vec_set (v_scaned.x, player.x);
}
}

/******************************/

any opinions, suggestions are apreciated

Re: how do I...force field/shield [Re: monchito] #127616
05/04/07 18:11
05/04/07 18:11
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline

Expert
Blink  Offline

Expert

Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Monchito, look in user requests, i asked Slin to make one for me as well, look at his posted code. i didnt get a chance to test it, but i ran it and there was no errors.


My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."

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