AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [The Specialists] Trying to create an entity (https://forums.alliedmods.net/showthread.php?t=92204)

Shinkoru 05-11-2009 18:02

[The Specialists] Trying to create an entity
 
I've been trying to create an entity using the following:
PHP Code:

public Slowmo(id){
    new 
ent create_entity("ts_slowmotion");

    
DispatchKeyValue(ent,"model","*3")  
    
DispatchKeyValue(ent,"duration","100")    
    
DispatchKeyValue(ent,"slowamt","0.1")
    
DispatchKeyValue(ent,"targetname","slow")   
    
DispatchKeyValue(ent,"spawnflags","4")  

    
DispatchSpawn(ent)

    new 
Float:origin[3]
    
entity_get_vector(id,EV_VEC_origin,origin)
    
entity_set_origin(ent,origin)
    new 
Float:maxs[3] = {35.0,35.0,50.0},
    new 
Float:mins[3] = {-35.0,-35.0,-50.0}
    
entity_set_size(ent,mins,maxs)


    
client_print(id,print_chat,"Entity created.")


The debug message is shown, however, the entity has no effect. I've searched the forum, and I really couldn't find anything that helped this problem. I'm assuming I set a flag wrong, or it's something to do with the entity itself. Anyway, heres the entity information from the .fgd :
Code:

//Ts SlowMotion (trigger entity)
//this entity must be called from somewhere (a door, a trigger, a TS dm hill, a powerup...).
//"duration": self explanatory.
//"slowmotion ammount(0.0/1.0)": works exactly like the "globalslow" cvar or TS, it's a number between 0.0 and 1.0 (0.3,0.7 etc).
//"range": if set to "entity size" this entity will works as a trigger, the player that collide with it will be slowed;
//if you set "all map" the entity size doesnt count and the entity works for the whole map.
//you can use the target.
//=========================================

@SolidClass base(Targetname,Target) = ts_slowmotion : "TS SlowMotion"
[
    duration(string) : "Duration(sec)" : "5"
    slowamt(string) : "SlowMotion ammount(0.0/1.0)" : "0.5"
       
    spawnflags(flags) =
    [
        1: "Start ON" : 0
        2: "All map" : 0
        4: "Slow bullets" : 0
    ]

    message(string) : "message when triggered" : ""
]

And heres a screenshot of the entity in use (if it's any help).
[IMG]http://img12.**************/img12/5599/inuse.png[/IMG]
I've tried a multitude of ways to get it to work but I can't seem to get the effect.
Edit: My bad, posted in wrong section, thanks for moving it whoever did it.

Arkshine 05-11-2009 18:32

Re: [The Specialists] Trying to create an entity
 
Maybe should you try '5' as flags.

Shinkoru 05-11-2009 18:44

Re: [The Specialists] Trying to create an entity
 
Quote:

Originally Posted by arkshine (Post 825848)
Maybe should you try '5' as flags.

Hello, Arkshine. I did as you suggested, and there seems to be no difference. The debug message is still printed, but there is no slow motion effect.


All times are GMT -4. The time now is 01:35.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.