Gamestudio Links
Zorro Links
Newest Posts
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
1 registered members (AndrewAMD), 1,014 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Poison/Camera Effect WDL #39200
01/14/05 07:28
01/14/05 07:28
Joined: Aug 2004
Posts: 44
RI, USA, Earth (or Mars dk rly...
Davetheave Offline OP
Newbie
Davetheave  Offline OP
Newbie

Joined: Aug 2004
Posts: 44
RI, USA, Earth (or Mars dk rly...
Well after much time spent on the fourms i found that people need codes that involved the cameras. So i looked around more and found how easy it was to make some camera code. Any feedback will be great i don't care if it's bad. Also i will take ideas. Note: I belive the camera.alpha code needs pro edition to run currectly.

Code:
/* Poison/Camera effect      Coded by David Branco a.k.a DaveTheAve

Note: This code was made for use with the templates.
To use:
Include this .WDL last in the main script
Call the function of the effect you want.
To shutoff:
Camera effects: Call the function "normal_camera"
Other Effects: Call the function "shutdown_effects" */

bmap poison_pan = "poison.bmp"; //Fullscreen poison bmp file
bmap pain_pan = "pain.bmp"; //Fullscreen pain bmp file
var poison_stat, 0; //Keep at 0 Needed to reset effect is more poison is taken
var poison_speed, 1; //Speed the poison effect decreases by
var pain_stat, 0; //Keep at 0 Needed to reset effect is more poison is taken
var pain_speed, 1; //Speed the poison effect decreases by
var drugged_working, 0; //Keep at 0 Needed for the drug camera

panel poison_panel
{
alpha = 0;
bmap = poison_pan;
flags = transparent, refresh, d3d;
}

panel pain_panel
{
alpha = 0;
bmap = pain_pan;
flags = transparent, refresh, d3d;
}

function poison_effect()
{
poison_panel.alpha = 80;
poison_stat = 1;
poison_panel.visible = on;
while(poison_panel.alpha > 0)
{
poison_panel.alpha -= poison_speed * time;
wait(1);
}
poison_panel.alpha = 0;
poison_panel.visible = off;
poison_stat = 0;
}

function pain_effect()
{
pain_panel.alpha = 80;
pain_stat = 1;
pain_panel.visible = on;
while(pain_panel.alpha > 0)
{
pain_panel.alpha -= pain_speed * time;
wait(1);
}
pain_panel.alpha = 0;
pain_panel.visible = off;
pain_stat = 0;
}

function pain_remain_on_screen_effect()
{
pain_stat = 1;
pain_panel.visible = on;
wait(5);
while(pain_stat == 1)
{
pain_panel.alpha = 100 - player._HEALTH;
wait(1);
}
pain_panel.alpha = 0;
pain_panel.visible = off;
pain_stat = 0;
}

function shutdown_effects()
{
pain_stat = 0;
poison_stat = 0;
}

function normal_camera()
{
camera.alpha = 50;
camera.transparent = off;
drugged_working = 0;
}

function slowmo_camera()
{
camera.transparent = on;
camera.alpha = 30;
}

function drugged_camera()
{
camera.transparent = on;
camera.alpha = 8;
drugged_working = 1;
while (drugged_working == 1)
{
camera.x += 10 * time;
wait(1);
camera.x -= 10 * time;
wait(1);
}
}

function nos_camera()
{
camera.transparent = on;
camera.alpha = 20;
}



Edit: I belive i had used the alpha values wrong so i just fixed them. Also so small improvments on the poison code and the pain code.

Edit: Thank you Snake67 for the "* time" help.

Should I make the camera.alpha codes run off a .bmp file to support lower editions?
single choice
Votes accepted starting: 01/13/05 22:28
You must vote before you can view the results of this poll.
Last edited by Davetheave; 01/15/05 05:23.

Latest Project: RadioWave www.NeoeliteUSA.com Computer System: Motherboard: DFI LanParty CPU: AMD Athlon XP 2800 AGP: Radeon 9600XT Ram: 1GB Case: Antec PlusView OS: Windows XP (Modded)
Re: Poison/Camera Effect WDL [Re: Davetheave] #39201
01/14/05 19:41
01/14/05 19:41
Joined: Sep 2003
Posts: 648
Switzerland
snake67 Offline
User
snake67  Offline
User

Joined: Sep 2003
Posts: 648
Switzerland
I just wanted to mention: you forgot to tine correct the "*_speed" variables.

while(poison_panel.alpha > 0)
{
poison_panel.alpha -= poison_speed *time ;
wait(1);
}

Re: Poison/Camera Effect WDL [Re: snake67] #39202
01/14/05 20:30
01/14/05 20:30
Joined: Aug 2004
Posts: 44
RI, USA, Earth (or Mars dk rly...
Davetheave Offline OP
Newbie
Davetheave  Offline OP
Newbie

Joined: Aug 2004
Posts: 44
RI, USA, Earth (or Mars dk rly...
Well thank you for posting and i did at the "* time". I don't know what that does so thats why i never added it. If you can plz tell what how that affects my code.


Latest Project: RadioWave www.NeoeliteUSA.com Computer System: Motherboard: DFI LanParty CPU: AMD Athlon XP 2800 AGP: Radeon 9600XT Ram: 1GB Case: Antec PlusView OS: Windows XP (Modded)
Re: Poison/Camera Effect WDL [Re: Davetheave] #39203
01/15/05 03:10
01/15/05 03:10
Joined: Sep 2003
Posts: 648
Switzerland
snake67 Offline
User
snake67  Offline
User

Joined: Sep 2003
Posts: 648
Switzerland
Since the time "wait(1);" will wait depends on the hardware, you must time correct your counter. Otherwise the effect does depend on system speed too.
I encountered two more bugs in your code. It should be:

while(pain_stat == 1)
{
pain_panel.alpha = 100 - player._HEALTH * time;
wait(1);
}

and

while (drugged_working == 1)
{
camera.x += 10;
sleep(0.1);
camera.x -= 10;
sleep(0.1);
}

or

while (drugged_working == 1)
{
camera.x += 10*time;
wait(1);
camera.x -= 10*time;
wait(1);
}



Re: Poison/Camera Effect WDL [Re: snake67] #39204
01/15/05 04:32
01/15/05 04:32
Joined: Jul 2002
Posts: 2,002
Europe
ShoreVietam Offline
Expert
ShoreVietam  Offline
Expert

Joined: Jul 2002
Posts: 2,002
Europe
I really like the idea, I didn't knew the camera.transparent = on stuff is possible, thanks!


My project Schlacht um Kyoto - Das Samurai Browsergame! (sorry, german only)
Re: Poison/Camera Effect WDL [Re: snake67] #39205
01/15/05 04:40
01/15/05 04:40
Joined: Aug 2004
Posts: 44
RI, USA, Earth (or Mars dk rly...
Davetheave Offline OP
Newbie
Davetheave  Offline OP
Newbie

Joined: Aug 2004
Posts: 44
RI, USA, Earth (or Mars dk rly...
Snake67 i have updated the code thank you for your help. Everyone else plz leave your feedback, vote on the poll, and any ideas are much needed.


Latest Project: RadioWave www.NeoeliteUSA.com Computer System: Motherboard: DFI LanParty CPU: AMD Athlon XP 2800 AGP: Radeon 9600XT Ram: 1GB Case: Antec PlusView OS: Windows XP (Modded)
Re: Poison/Camera Effect WDL [Re: Davetheave] #39206
01/15/05 10:03
01/15/05 10:03
Joined: Nov 2004
Posts: 832
United States, Utah
Braxton Offline
Developer
Braxton  Offline
Developer

Joined: Nov 2004
Posts: 832
United States, Utah
So what does this do exactly???


"The GREAT LAW: Life is and always will be justly ordered, and that all past experiences, good and bad, were the equitable out working of our evolving, yet unevolved selves" - As A Man Thinketh
Re: Poison/Camera Effect WDL [Re: Braxton] #39207
01/15/05 10:46
01/15/05 10:46
Joined: Aug 2004
Posts: 44
RI, USA, Earth (or Mars dk rly...
Davetheave Offline OP
Newbie
Davetheave  Offline OP
Newbie

Joined: Aug 2004
Posts: 44
RI, USA, Earth (or Mars dk rly...
Well this code basicly will blur the screen givin it a Drug effect (or whatever the fuction effect is called), also i added some fuctions that you can call get your player gets shot that will make the screen flash red, or get darker with every shot. Then theres a poison code that will flash the screen green when the player is poisoned (script must call it).


Latest Project: RadioWave www.NeoeliteUSA.com Computer System: Motherboard: DFI LanParty CPU: AMD Athlon XP 2800 AGP: Radeon 9600XT Ram: 1GB Case: Antec PlusView OS: Windows XP (Modded)
Re: Poison/Camera Effect WDL [Re: Davetheave] #39208
01/20/06 18:08
01/20/06 18:08
Joined: Dec 2005
Posts: 47
USA, Texas
kmangwing Offline
Newbie
kmangwing  Offline
Newbie

Joined: Dec 2005
Posts: 47
USA, Texas
sweet. Did you change it so it can work in the lower editions?


(\__/) This bunny's dead (x.X ) (> < ) My aim is kmangwing
Re: Poison/Camera Effect WDL [Re: Davetheave] #39209
01/20/06 18:46
01/20/06 18:46
Joined: Jun 2005
Posts: 4,875
broozar Offline
Expert
broozar  Offline
Expert

Joined: Jun 2005
Posts: 4,875
Quote:

Note: I belive the camera.alpha code needs pro edition to run currectly.





no, it doesnīt. "camera.transparent=on; camera.alpha=xyz;" works very well for me (commercial). strange, however. i looked it up in the manual, and itīs a "pro" feature. dunno why it works ^^

Last edited by DaBro0zar; 01/20/06 18:47.

Moderated by  adoado, checkbutton, mk_1, Perro 

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