Add more abilities in wc3 ft ... but how

Read log files for errors! If this fails, come here for help

Moderator: Forum Moderator

Post Reply
erik2k3
Militia
Posts: 73
Joined: Wed Aug 03, 2005 6:34 am
Location: Germany / UK
Contact:

Add more abilities in wc3 ft ... but how

Post by erik2k3 » Mon Mar 13, 2006 5:55 am

Hi folks,

i`m currently playing with the idea of enabling shadowmeld for the elfs again, the code itself aint the problem, wrote an amxx plugin tht renders the user invisible every time he holds the knife and isnt moving.

the only problem im having is to include it into wc3:ft.

If someone could tell me which of the includes i need, or how i tell the plugin to use the wc3.amxx and all its functions tht would be gr8.

atm i have a specific file ( shadowmeld.inl ) and a line in the warcraft3.sma (include shadowmeld.inl ) but stil get too many errors in the compiling process... cant deal with RACE_ELF for examle...

seems like something is missing in the includes for i cannot access the wc3 specific race and level functions...

please gimme a hint !

User avatar
eM-Viper
Militia
Posts: 79
Joined: Thu Jul 07, 2005 9:38 am
Contact:

Post by eM-Viper » Mon Apr 10, 2006 9:10 am

try putting the code in the wc3ft sma/inl where another elf ability is instead of a seperate inl. Thats kinda what i did to add a feature to shadow hunters. but it was a much shorter code :-p.

nub2
Peon
Posts: 1
Joined: Sun Sep 17, 2006 12:05 pm

Post by nub2 » Sun Sep 17, 2006 12:08 pm

hey,

is somebody able to post the whole code or
give some hints how to enable shadowmeld
the way it was in the older versions ?

Post or pm me !

Thx
nub2

User avatar
Geesu
<b>King of the world!</b>
Posts: 3159
Joined: Tue Jul 05, 2005 9:24 pm
Contact:

Post by Geesu » Mon Sep 18, 2006 1:36 pm

uhhhh I doubt it, and it never actually worked
No Support via PM

erik2k3
Militia
Posts: 73
Joined: Wed Aug 03, 2005 6:34 am
Location: Germany / UK
Contact:

Post by erik2k3 » Mon Sep 18, 2006 3:28 pm

yep, never worked ;) meanwhile the whole project is "iced" ... maybe one day il find the time and the commitment to continue ;)
Image

User avatar
Geesu
<b>King of the world!</b>
Posts: 3159
Joined: Tue Jul 05, 2005 9:24 pm
Contact:

Post by Geesu » Tue Sep 19, 2006 12:12 pm

i'm confused, what do you mean by the whole project is "iced" ?
No Support via PM

ek
Peon
Posts: 5
Joined: Sun Sep 17, 2006 4:39 pm

Post by ek » Tue Sep 19, 2006 1:37 pm

he probably mean it dead
streamlineservers.com

User avatar
Geesu
<b>King of the world!</b>
Posts: 3159
Joined: Tue Jul 05, 2005 9:24 pm
Contact:

Post by Geesu » Wed Sep 20, 2006 12:53 am

like he even knows anything
No Support via PM

erik2k3
Militia
Posts: 73
Joined: Wed Aug 03, 2005 6:34 am
Location: Germany / UK
Contact:

Post by erik2k3 » Mon Nov 13, 2006 11:31 am

right, back on topic... included the script into "skills.inl" as a new public function, called in "events.inl"

still some problems : while in shadowmeld mode, the screen in fading to a slight blue, and of course u remain invisible.... however, as soon as someone flashbang or hits you, the effects are overwritten by flashbang and the glowing of the attack.

Now, I could go through the entire code and add a if to every glow that occurs on the victim if hit, but I was hoping you might have a better idea @ Geesu ?

Can I call this funkction anywhere so that it is constantly checked, over and over again ( yes, I know, a lot of CPU usages goes.... but atm that`s not my concern... ) and overrrides the glow of a hit ?
Image

User avatar
Geesu
<b>King of the world!</b>
Posts: 3159
Joined: Tue Jul 05, 2005 9:24 pm
Contact:

Post by Geesu » Mon Nov 13, 2006 2:13 pm

erik, post all the shadowmeld code that you have... I'll take a peak at it
No Support via PM

erik2k3
Militia
Posts: 73
Joined: Wed Aug 03, 2005 6:34 am
Location: Germany / UK
Contact:

Post by erik2k3 » Tue Nov 14, 2006 12:50 am

so far :

included in skills.inl :

Code: Select all

// ****************************************
// Elf`s Shadowmeld
// ****************************************
public Skill_Shadowmeld(id) 
{
	if ( p_data[id][P_RACE]==RACE_ELF && p_data[id][P_LEVEL]>=6) {
		new clipamount = 0, ammoamount = 0, weaponnum = 0
		weaponnum = get_user_weapon(id,clipamount,ammoamount)
		
		#if MOD == 0
			if (weaponnum==CSW_KNIFE){
		#endif
		#if MOD == 1
			if (weaponnum==DODW_AMERKNIFE || weaponnum==DODW_GERKNIFE || weaponnum==DODW_SPADE){
		#endif
				if(p_data[id][P_TIME]>=400) {
					if(task_exists(id))
					remove_task(id)
				}
				if(p_data[id][P_TIME]<=400) {
				new origin[3]
				get_user_origin(id,origin)
				p_data[id][P_LOCATIONX]=origin[0]
				Create_ScreenFade(id, (1<<15), (1<<10), (1<<12), 0, 0, 255, 150)
				set_user_rendering(id,kRenderFxNone, 0,0,0, kRenderTransTexture,0)
				set_task(1.0,"shadow_move",id,"",0,"b")
				set_task(0.01,"shadowmeld",id,"",0,"b")
				}
			}
			else{
				set_user_rendering(id,kRenderFxNone, 0,0,0, kRenderTransTexture,255)
				Create_ScreenFade(id, (1<<15), (1<<10), (1<<12), 255, 255, 255, 0)
				remove_task(id)
			}
	}
}
public shadow_move(id)
{
	new origin[3]
	
	get_user_origin(id,origin)
	p_data[id][P_LOCATIONX]=origin[0]
	p_data[id][P_LOCATIONY]=origin[2]
	p_data[id][P_LOCATIONZ]=origin[2]
}
public shadowmeld(id)
{

		
	new oldOrigin[3];
	new minus,plus
	new time_remaining=400
	get_user_origin(id,oldOrigin)

	
	minus = oldOrigin[0]
	plus = oldOrigin[0]
	minus-=2
	plus+=2
	time_remaining=400-p_data[id][P_TIME]
	p_data[id][P_TIME]+=1
	
	
	
	if(p_data[id][P_TIME]<=400) {
		
	set_user_rendering(id,kRenderFxNone, 0,0,0, kRenderTransTexture,0)
	set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 0.08)
	show_hudmessage(id, "SHADOWMELD ACTIVE^remaining : %i",time_remaining)
	Create_ScreenFade(id, (1<<15), (1<<10), (1<<12), 0, 0, 255, 90)
	if(p_data[id][P_LOCATIONX]<minus || p_data[id][P_LOCATIONX]>plus){
		set_user_rendering(id,kRenderFxNone, 0,0,0, kRenderTransTexture,255)
		Create_ScreenFade(id, (1<<15), (1<<10), (1<<12), 255, 255, 255, 0)
		remove_task(id)
		
	}
	
	
		
	if(p_data[id][P_TIME]>=400) {
		set_user_rendering(id,kRenderFxNone, 0,0,0, kRenderTransTexture,255)
		Create_ScreenFade(id, (1<<15), (1<<10), (1<<12), 255, 255, 255, 0)
		remove_task(id)
		set_hudmessage(255, 255, 255, -1.0, -1.0, 0, 6.0, 1.0)
		show_hudmessage(id, "No more shadowmeld this round...")
		
	}
	
}
}
in events.inl

onCurWeapon : initialise on change to knife the function

Code: Select all

//Check Shadowmeld
	Skill_Shadowmeld(id)
on_ResetHud to set things straight agan after a new round :
if ( endround )
{
// have "fake" ultimate delay
iUltimateDelay = iCvar[FT_ULTIMATE_DELAY];

new parm[1];
parm[0] = 0;
_Ultimate_Delay(parm);
remove_task(id) <-
p_data[id][P_TIME]=0 <-
}
cstrike.inl on_endRound :

remove_task(id)
p_data[id][P_TIME]=0 ( dunno if that one here actually changes something or not....

and of course in constants.inl defining some of the variables

now, I know that the code could be far better... out of lazyness and testing I used "CreateScreenFade" just to see how it works...

had a problem with the tasks : whenever i wanted to assign a proper name to the task, other than "id" it would not pass the id on to the function, even tho it was declared ( to the best of my knowledge ) correctly.

What I havent done yet, checking the movement properly, X Y Z ... but fot the moment the check, the way it is, will do ....

Still, the problem with orcs and elf`s landing a shot on u stil exists... for 0.01 seconds u become visible again...

...and stil need to add a c_var for the sm length... but as u can see, all of it stil is very very... well ? just playing with it and seeing how it works ? took me 100 times more time to work myself through your code than actually putting this together ;-)

THX for havin a peak at it ! really appreciate this !

and please dont mind my bad coding... more used to php and hings like that ;)
Image

Post Reply