Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
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
1 registered members (7th_zorro), 793 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
Page 3 of 3 1 2 3
Re: Panel Fading Problems [Re: DJBMASTER] #214610
07/05/08 18:28
07/05/08 18:28
Joined: Nov 2006
Posts: 497
Ohio
xbox Offline OP
Senior Member
xbox  Offline OP
Senior Member

Joined: Nov 2006
Posts: 497
Ohio
I found my problem, its a problem with the video/graphics card. i tried the fade_test packet and it worked on a good computer and in A7, keep in mind i have A6 Pro. So i hope when i finish the game the panel fading works well.

Also, now i have a slight situation. I have two gun action that i wrote, and what i want is when you have that gun out, a string appears with the name of the gun. When you switch the guns, (Q and E), the gun names will switch too. Can somebody please help me out.

Re: Panel Fading Problems [Re: xbox] #214619
07/05/08 19:07
07/05/08 19:07
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Ok here is an example of the top of my head...

1) Create a variable to act as counter.
2) Create a TEXT object with the string set as the longest gun name.
3) Create a function for the Q and E keys, which inside increments the counter.
4) Check the counter number against gun number or something
5) Finally change the TEXT object's string by using str_cpy( my_text.string[0], "Gun name here!!!" );

Here is an example to clear things up. Just copy all of this into a blank WDL file and then run it. Press Q & E and the weapon names will switch.

Code:
var gun_number=1;

TEXT gun_label
{
pos_x=0;
pos_y=0;
string="Rocket Launcher";
flags=VISIBLE;
}

function check_weapon()
{	
if(gun_number==1){str_cpy(gun_label.string[0], "Machine Gun");}
if(gun_number==2){str_cpy(gun_label.string[0], "Shotgun");}
if(gun_number==3){str_cpy(gun_label.string[0], "Rocket Launcher");}
if(gun_number==4){str_cpy(gun_label.string[0], "Shock Rifle");}
if(gun_number==5){str_cpy(gun_label.string[0], "Railgun");}
}

function prev_weapon()
{	
if (gun_number==5){gun_number=1;}else{gun_number+=1;}	
check_weapon();
}

function next_weapon()
{
if (gun_number==1){gun_number=5;}else{gun_number-=1;}
check_weapon();
}


function main()
{
vec_set(screen_color,vector(255,0,0)); // set background to prevent blur rendering
check_weapon();
on_q=prev_weapon;
on_e=next_weapon;
}





I've built this example with 5 weapons although it is easy to add more.

Just make sure that the TEXT object's string is set to the longest name of a weapon.

Last edited by DJBMASTER; 07/05/08 19:12.
Re: Panel Fading Problems [Re: DJBMASTER] #214641
07/06/08 00:56
07/06/08 00:56
Joined: Nov 2006
Posts: 497
Ohio
xbox Offline OP
Senior Member
xbox  Offline OP
Senior Member

Joined: Nov 2006
Posts: 497
Ohio
It works correctly if i do what u said and put it in a separate file. But i tried using the code in my current project and it doesn't work. I have the two weapons, and the first line of each says this,
Code:
 action ak47
{
gun_number = 1;
...
}

action mp5
{
gun_number = 2;
...
}

Now when i start the game, the AK47 string loads along with the gun, but when i pick up the mp5, the string does not update. (the check function of mine is the same as yours).

Any ideas?

Re: Panel Fading Problems [Re: xbox] #214643
07/06/08 03:00
07/06/08 03:00
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
No, don't call it straight away in the action.
When you pick up a certain weapon, set the gun_number and then call the check function.

Last edited by DJBMASTER; 07/06/08 03:01.
Re: Panel Fading Problems [Re: DJBMASTER] #214652
07/06/08 05:41
07/06/08 05:41
Joined: Dec 2005
Posts: 116
T
tD_Datura_v Offline
Member
tD_Datura_v  Offline
Member
T

Joined: Dec 2005
Posts: 116
An icky alternative, for those that don't want it (probably most).
Code:

var gun_id  = 0;
define guns_max = 8;  // only 8 guns in this game
TEXT gun_strs {
	pos_x = 0;
	pos_y = 0;
	strings = guns_max;
	string = "Mental Manni's Middle Finger";
	string = "Machine Gun";
	string = "Shotgun";
	string = "Rocket Launcher";
	string = "Granny Panties";
	string = "Bear Trap";
	string = "Rolling Papers";
	string = "Bob Saget's Decapitated Head";
}

// add to above
TEXT gun_display {
	pos_x = 0;
	pos_y = 0;
	strings = 1;
}
function gun_show(gunn_id) {
	gunn_id %= guns_max;
	str_cpy(gun_display.string[0], gun_strs.string[gunn_id]);
	return(gunn_id);
}
function gun_next() {
	gun_id += 1; gun_id = gun_show(gun_id);
}
function gun_prev() {
	gun_id -= 1; gun_id = gun_show(gun_id);
}

define _gun_id, skill?;
function gun_grab_event() {
	my.event_impact = NULL;
	gun_show(my._gun_id);
	my._gun_id = -1;
}
function gun_spawn(gunn_id);
	my._gun_id = gunn_id;
	my.enable_impact = on;
	my.event_impact = gun_grab_event;
	while(ME != NULL) {
		if (my._gun_id <= -1) {
			break;
		}
		wait(1);
	}
	ent_remove(me);
}

Just ignore that, if appropriate.




Re: Panel Fading Problems [Re: tD_Datura_v] #214735
07/06/08 23:11
07/06/08 23:11
Joined: Nov 2006
Posts: 497
Ohio
xbox Offline OP
Senior Member
xbox  Offline OP
Senior Member

Joined: Nov 2006
Posts: 497
Ohio
First of all, i have my ammo panel and my health panel. Currently, they both display there values and thats it. So can any one give me any ideas on what to add to the two panels to make it look better. I spent about an hour in photoshop designing the two panels, just to only put two different variables in them, all in all , They look pretty BLANK.

Re: Panel Fading Problems [Re: xbox] #214737
07/06/08 23:13
07/06/08 23:13
Joined: Nov 2006
Posts: 497
Ohio
xbox Offline OP
Senior Member
xbox  Offline OP
Senior Member

Joined: Nov 2006
Posts: 497
Ohio
Sorry for double posting, my edit button won't work. Can any one tell me what AUM the "endless level" is in? Thanks, it would be greatly appreciated.

Re: Panel Fading Problems [Re: xbox] #214983
07/08/08 15:27
07/08/08 15:27
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Infinite terrain/levels > AUM 44

Page 3 of 3 1 2 3

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