Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, dr_panther), 791 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
set health in wed by using a skill. #455969
11/05/15 00:20
11/05/15 00:20
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
Question i want to set health points for a model in wed.

Now I understand it not fully but here's is what i got so far.

First i need to define it right like this :

#define power skill1

then how in the action will it take the number i insert in wed in skill 1 ?


thx for your time grin


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: set health in wed by using a skill. [Re: Realspawn] #455972
11/05/15 00:31
11/05/15 00:31

M
Malice
Unregistered
Malice
Unregistered
M



If you select the model and set skill1 to 110 in WED the action should set the skill1 =110 when it starts up. However make sure you do not reset it in the action start up like this ...


action my_guy()
{
my.skill1=0; /// NO YOU RESET IT.


Last edited by Malice; 11/05/15 00:32.
Re: set health in wed by using a skill. [Re: ] #455973
11/05/15 00:58
11/05/15 00:58
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
i created an event that takes points of when the skill hits 0 it gets removed. I tried with 3 differend models each there own number skilled laugh

it works.

Code:
function remove_brick()
{
	my.skill1 -=1;
	wait(1);
	if(my.skill1 ==0){
		
		set(my,PASSABLE | INVISIBLE);
		my.event = NULL;
		wait(1);
		ent_remove(me);
	}
}



Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: set health in wed by using a skill. [Re: Realspawn] #455974
11/05/15 01:13
11/05/15 01:13

M
Malice
Unregistered
Malice
Unregistered
M



Cool^

Notes - If this is a event, using a naming convention is a good idea. Also, while with a straight -1 you comp works but if you did -7(odd number) it will fail, consider using a <=. If this is a event, check event_type if using many event trigger ENABLE_IMPACT ENABLE_BLOCK ect...

Code:
function remove_brick_evnt() // Naming
{
if(event_type == EVENT_WHATEVER)
{
	my.skill1 -=1;
}
	wait(1);
	if(my.skill1 <=0){
		my.emask &= ~ENABLE_WHATEVER; 
		set(my,PASSABLE | INVISIBLE); // Should not be need and slows removal over all
		//my.event = NULL; // Should not be needed 
		wait(1);
		ent_remove(me);
	}
}



Those are my note - Awesome job, good work.
Mal

Re: set health in wed by using a skill. [Re: ] #455975
11/05/15 01:17
11/05/15 01:17

M
Malice
Unregistered
Malice
Unregistered
M



If your using WED to set skill1 this helps to know http://www.conitec.net/beta/customscript.htm

look at
// skill1: name default
// FLAG1: name default

section

Re: set health in wed by using a skill. [Re: Realspawn] #455983
11/05/15 05:52
11/05/15 05:52
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: Realspawn
Question i want to set health points for a model in wed.

Now I understand it not fully but here's is what i got so far.

First i need to define it right like this :

#define power skill1

then how in the action will it take the number i insert in wed in skill 1 ?


thx for your time grin


It would be nice to show names of those skills in WED. F.e. you want to set health in WED, but how do you know that first skill is for HEALTH? It's pretty easy laugh
Code:
#define health skill1 

// uses: health
action actHero(){
	
}

When you write comment 'uses' followed by ':' and the name of the skill, it will appear in WED skill list, so you'll be able to navigate in WED easily. BTW, I would suggest you to do now remove entity in it's event, just in case it all won't mess up at the end with some pointer problems. And I'm absolutely agree with Malice, about his advice of checking what kind of event currently is running.

Best regards


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: set health in wed by using a skill. [Re: 3run] #455984
11/05/15 06:56
11/05/15 06:56
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
3run is right but (as additional information) it's even easier if you don't want to define the skills first:

Code:
//skill1: health 100
//skill3: speed 10
//flag3: decoration 0
action actHero()
{
	...
}


Note that this will NOT work if you don't set default values (like 100,10,0 in my example).


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: set health in wed by using a skill. [Re: Superku] #455985
11/05/15 07:18
11/05/15 07:18
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: Superku
3run is right but (as additional information) it's even easier if you don't want to define the skills first:

Code:
//skill1: health 100
//skill3: speed 10
//flag3: decoration 0
action actHero()
{
	...
}


Note that this will NOT work if you don't set default values (like 100,10,0 in my example).
I didn't know this one! laugh Very useful, thank you Superku!

Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: set health in wed by using a skill. [Re: 3run] #455995
11/05/15 11:10
11/05/15 11:10
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
very usefull from the both of you laugh
some good information thank you. I gues i am still doing stuff wrong. here is what i got now :

Code:
#define power skill1 

// uses: power

action crashing_b()
{

	set(my,METAL | SHADOW);
	my.emask |= (ENABLE_IMPACT | ENABLE_ENTITY);
	my.event = remove_br;
	c_setminmax(my);

	

}



No txt is showing up on skill1 and that is in Wed where i want to
insert the power number laugh to be used.

what am i missing ?

Last edited by Realspawn; 11/05/15 11:20.

Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: set health in wed by using a skill. [Re: Realspawn] #456001
11/05/15 11:42
11/05/15 11:42
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
The problem in your code is the empty line between "//uses:" and "action ...".


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Page 1 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