set health in wed by using a skill.

Posted By: Realspawn

set health in wed by using a skill. - 11/05/15 00:20

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
Posted By: Anonymous

Re: set health in wed by using a skill. - 11/05/15 00:31

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.

Posted By: Realspawn

Re: set health in wed by using a skill. - 11/05/15 00:58

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);
	}
}

Posted By: Anonymous

Re: set health in wed by using a skill. - 11/05/15 01:13

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
Posted By: Anonymous

Re: set health in wed by using a skill. - 11/05/15 01:17

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
Posted By: 3run

Re: set health in wed by using a skill. - 11/05/15 05:52

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
Posted By: Superku

Re: set health in wed by using a skill. - 11/05/15 06:56

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).
Posted By: 3run

Re: set health in wed by using a skill. - 11/05/15 07:18

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!
Posted By: Realspawn

Re: set health in wed by using a skill. - 11/05/15 11:10

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 ?
Posted By: Superku

Re: set health in wed by using a skill. - 11/05/15 11:42

The problem in your code is the empty line between "//uses:" and "action ...".
Posted By: Realspawn

Re: set health in wed by using a skill. - 11/05/15 12:06

thank you so that is important to know lol laugh thank you both this it really showed me how to use these skill settings in wed and how i can use it in
many ways. Like for example i am using it now also to choose a skin laugh
© 2024 lite-C Forums