Hardened scripting -1 reply

  • 1
  • 2

Please wait...

jk3editor

Retard Hungarian Modder

50 XP

21st August 2008

0 Uploads

1,520 Posts

0 Threads

#1 8 years ago

[COLOR=Navy]Okay...now I want a strange thing: Move a func_usable. But if I affect() it with icarus script, it writes, that it's az invalid affect() target. Is there a way to move a func_usable somewhere? Thank you. [/COLOR]




lassev

Degenerate scripter

50 XP

21st June 2004

0 Uploads

847 Posts

0 Threads

#2 8 years ago

I move them all the time. You want to give it an origin brush if you do, though. Great many brush entities don't require an origin brush for their usual purposes but if you move them with a script, it's better to give them one as it might otherwise be a bother to pinpoint the mathematical point of origin the game uses for those entities.

So, give it an origin brush and a script_targetname and that's it. I don't remember if I've tried to affect one that is off by default in Radiant. Maybe that was your problem if you did it otherwise correctly?




jk3editor

Retard Hungarian Modder

50 XP

21st August 2008

0 Uploads

1,520 Posts

0 Threads

#3 8 years ago

[COLOR=Navy]These have origin, and script_targetname too. Here is one on these:

Spoiler: Show
// entity 25 { "origin" "-32 2016 -102" "script_targetname" "symbols1" "classname" "func_usable" "targetname" "symbol_bl" "spawnflags" "1" // brush 0 { ( 0 2048 -104 ) ( -64 2048 -104 ) ( -64 1984 -104 ) system/caulk 0 0 0 0.250000 0.250000 0 4 0 ( -64 1984 -102 ) ( -64 2048 -102 ) ( 0 2048 -102 ) rift/symbol2_fx1 -256 -256 0 0.250000 0.250000 0 0 0 ( -64 1984 -96 ) ( 0 1984 -96 ) ( 0 1984 -104 ) colors/black 0 0 0 0.250000 0.250000 0 4 0 ( 0 1984 -112 ) ( 0 2048 -112 ) ( 0 2048 -120 ) system/caulk 0 0 0 0.250000 0.250000 0 4 0 ( 0 2048 -112 ) ( -64 2048 -112 ) ( -64 2048 -120 ) system/caulk 0 0 0 0.250000 0.250000 0 4 0 ( -64 2048 -112 ) ( -64 1984 -112 ) ( -64 1984 -120 ) colors/black 0 0 0 0.250000 0.250000 0 4 0 } }
And the script command:
Spoiler: Show
affect ( "symbols1", /*@AFFECT_TYPE*/ INSERT ) { move ( < 0.000 2048.000 -132.000 >, < 0.000 0.000 0.000 >, 0.000 ); }

[/COLOR]




lassev

Degenerate scripter

50 XP

21st June 2004

0 Uploads

847 Posts

0 Threads

#4 8 years ago

Maybe the game doesn't like it that you enter an origin key by hand in Radiant? Normally only non-brush entities have such a key/value (like ref_tags). Brush entities aren't given such a thing automatically by Radiant and the game might not like it if you do. Just give it an ordinary origin brush like you do with func_statics and func_rotatings.

And what's wrong with those spoiler tags? Why do they only work in IE and not in Firefox? In the future I might not bother to launch IE just to check what people hide under them, but I did it this time because I had already posted in the thread. Not your fault, jk3editor, of course, but this forum's.




~*Seto*~

Trapped in the interchet

50 XP

19th October 2007

0 Uploads

334 Posts

0 Threads

#5 8 years ago

I'm pretty sure an origin brush is simply Radiant's representation of the origin key for brush-models anyway... regardless, I can confirm that there's no problem with adding one manually, and even if there was that doesn't explain an invalid affect error... though, you are moving in 0 time? I've always used 1ms time if I wanted instantaneous movement, I'm not sure about using 0.

But still I'm not seeing a good reason why you'd get an invalid affect error. Is there anything more to the error? Are you looking in the console with /developer 1?

/offtopic: I'm using FF and spoiler tags work fine for me o.O... maybe you have something disabled that would interfere with em?




lassev

Degenerate scripter

50 XP

21st June 2004

0 Uploads

847 Posts

0 Threads

#6 8 years ago

Yeah, the spoiler tags work for me now. Who knows why they didn't work before. Must be something about this forum engine.

Anyway, moving in zero time works fine. I do it all the time (or rather make entities do it - I wish I could move myself in zero time). If the origin key is fine, then it must be the fact the func_usable is turned off in Radiant. Maybe it doesn't exist in game before it's used for the first time?




MaceCrusherMadunusus

Movie Battles II Mapper

50 XP

12th January 2005

0 Uploads

323 Posts

0 Threads

#7 8 years ago

I am not sure if this is the cause, but it seems like it could be somewhat logical. If I have both Targetname and script_targetname I am sure they use the same value. In yours you have "targetname" "symbol_bl", try changing that to symbols1 if you can. (Possible conflict)

Again, I always do it anyway to be sure, but it may work.

Also, adding in origins manually via keys isn't a problem either. I use it all of the time.




lassev

Degenerate scripter

50 XP

21st June 2004

0 Uploads

847 Posts

0 Threads

#8 8 years ago

I use a different targetname and script_targetname all the time, for various reasons (one being that it can prove disastrous to make multiple entities share the same script_targetname) so that's definitely not the problem.




jk3editor

Retard Hungarian Modder

50 XP

21st August 2008

0 Uploads

1,520 Posts

0 Threads

#9 8 years ago

[COLOR=Navy]Hmm...now it looks this error 'disappeared', now just it don't give me any error, the g_icarusdebug writes, that it moved the func_usables, but it moved only one...I have 8 entity with the same name, why doesn't it move all of them? I should move them [/COLOR][COLOR=Navy]singular[/COLOR][COLOR=Navy]? [/COLOR]




lassev

Degenerate scripter

50 XP

21st June 2004

0 Uploads

847 Posts

0 Threads

#10 8 years ago

Like I said in my previous post, having multiple entities share the same script_targetname is error-prone. I dropped any attempts to do that years ago. So, you should try with unique script_targetnames. The ordinary targetnames don't matter.




  • 1
  • 2