Page 1 of 1

RPG Explosion Smoke Ring

Posted: Tue May 21, 2019 5:09 am
by daren adler
Can someone help me on turning this into sp please? Or tell me how to do it? I got rid of my eventscripts and a friend said use source-python. a ring of fire would be kool,,i have vmt and vtf for fire and smoke. This is very old,but its the only one i could find to have someone look at it,,there is a eventscripts that does all of that called- HL2DM_SERVER x update v1- http://addons.eventscripts.com/addons/view/x but thats eventscripts and that what i dont want to get back to(crashes way to much becouse of it).

Code: Select all

// RPG Explosion Smoke Ring written 021009:1232 by BJP
// Feel free to use this however you want.. Mucho thanks to MacDGuy
// For writing good code I could learn from. :)
//
// A variation of this script is in use on our own server.. This is
// a slightly dumbed-down version, but it achieves the same effect. :)
//

block load
{
   es_msg #green BRAND NEW FOR 1979 - RPG Explosion Smoke Ring 021009:1232 loaded. 
   es_xsetinfo bnf1979_smokering 1
}
   
block unload
{
   es_msg #green BRAND NEW FOR 1979 - RPG Explosion Smoke Ring 021009:1232 removed.
   es_xsetinfo bnf1979_smokering 0
}
   
event player_death
{
   //
   // This will both rattle and momentarrily flash the point of view of the attacker..
   // The flash effect only lasts for 0.15 seconds....tuned just right.
   //

   if (event_var(weapon) equalto "rpg_missile") do
   {
      es est_shake event_var(attacker) 0.5 5 0.1
      es est_fade event_var(attacker) 0 0.15 0 255 255 220 160
      es_doblock smokering/fragcloud
   }
}
   
event player_spawn
{
   est_RemoveIdle env_ar2explosion
}
   
block fragcloud
{
   // Feel free to substitute whatever sprite you want to use for the smoke. Here, the standard
   // smoke particle in the SDK is used. We painted up our own, which has nice swirls of dust
   // within it, so it looks even better. The default will do, however.

   es_give event_var(userid) env_ar2explosion
   es_fire event_var(userid) env_ar2explosion addoutput "Material particle/particle_smokegrenade1.vmt"
   es_fire event_var(userid) env_ar2explosion explode
   es_delayed 8 es_fire event_var(userid) env_ar2explosion Kill
   es_delayed 10 es_xcreateentitylist clouds env_ar2explosion
   es_foreachkey cloud in clouds "es_fire event_var(userid) server_var(cloud) Kill"
   es_xkeygroupdelete clouds
}

Re: RPG Explosion Smoke Ring

Posted: Tue May 21, 2019 10:33 am
by Painkiller

Re: RPG Explosion Smoke Ring

Posted: Tue May 21, 2019 7:03 pm
by daren adler
I get this error now, it still works,but on serverside it says this

Code: Select all

[sp] Caught an Exception:
Traceback (most recent call last)
File " . .\addons\source-python\packages\source-python\listeners\tick.py" , line 80 in tick
    self .pop(0) .execute()
File " . .\addons\source-python\packages\source-python\listeners\tick.py" , line 161 in tick in execute
    return self.callback(*self .kwargs

TypeError: _remove_overlay() argument after * must be an iterable, not int


And for the blood.py,,,it says this on my serverside

Code: Select all

[sp] Caught an Exception:
Traceback (most recent call last)
File " . .\addons\source-python\plugins\blood.py" , line 24 in _pre_take_damage
weapon_index - info.weapon

ValueError: Attacter is not a player.

Re: RPG Explosion Smoke Ring

Posted: Tue May 21, 2019 8:09 pm
by Ayuto
Do you perhaps type the tracebacks by hand instead of copying and pasting them? Because there are several typos, which are not in our code base and the tracebacks seem to be incomplete.

Please also use code tags to post tracebacks or code.

Re: RPG Explosion Smoke Ring

Posted: Tue May 21, 2019 8:10 pm
by daren adler
i copyed it hit Code: Select all and pasted it on a py
i used the copy and paste from viewtopic.php?f=37&t=1427&p=9485&hilit=explode#p9485

Syntax: Select all

from entities import TakeDamageInfo
from entities.entity import Entity
from entities.hooks import EntityCondition, EntityPreHook
from memory import make_object
from players.entity import Player
from weapons.manager import weapon_manager


DAMAGE_TRIGGERS = [
'npc_grenade_frag',
'grenade_ar2',
'rpg_missile',
'npc_tripmine',
]

@EntityPreHook(EntityCondition.is_player, 'on_take_damage')
def _pre_take_damage(stack_data):
victim = make_object(Entity, stack_data[0])
if not victim.is_player():
return

info = make_object(TakeDamageInfo, stack_data[1])

weapon_index = info.weapon
try:
weapon = Entity(weapon_index).classname
except AttributeError:
return

if weapon in DAMAGE_TRIGGERS:
fragcloud(Player(victim.index))


def fragcloud(victim):
entity = make_object(Entity, victim.give_named_item('env_ar2explosion'))
entity.set_key_value_string('material', 'x/killstreaks_v2/realex1.vmt')
entity.call_input('Explode')
entity.delay(8, entity.remove)

Re: RPG Explosion Smoke Ring

Posted: Tue May 21, 2019 8:22 pm
by satoon101
For Python code tags, use [python]your code here[/python]

Re: RPG Explosion Smoke Ring

Posted: Sun May 26, 2019 8:31 am
by Painkiller
Calming all is difficult, but you make an effort.

even if it drives you into delusion.

Things that are easy for a scripter to listen to are simply difficult for people without a plan.

Re: RPG Explosion Smoke Ring

Posted: Sun May 26, 2019 7:15 pm
by daren adler
ty