Search found 303 matches

  • 1
  • 2
  • 3
  • 4
  • 5
  • 31
Search found 303 matches Page 1 of 31
by rlranft
Sun Apr 07, 2019 8:18 pm
Forum: C++
Topic: Define a 2D array in C++ and passing to TS
Replies: 17
Views: 764
One option might be to rework your C++ 'funcThatCreatesArrays()' function to instead spit out a tab-delimited string containing the row, column, and value of each array index. You could then use that string to make your own array on the script side, something like: %arrData = funcThatCreatesArrays(...
by rlranft
Fri Mar 22, 2019 10:40 pm
Forum: Beginner
Topic: AI tutorial
Replies: 17
Views: 3390
This is a complex topic. I highly recommend working through all of the World Editor and Scripting documents : http://www.roostertailgames.com/TorqueRef/index.html (this is my personal copy - there are others available that may be more up-to-date). Much of the documentation is outdated but if you're ...
by rlranft
Fri Mar 22, 2019 10:25 pm
Forum: C++
Topic: Define a 2D array in C++ and passing to TS
Replies: 17
Views: 764
You can already define a 2d array in torquescript. Why are you fixated on thunking back and forth to C++?

http://www.roostertailgames.com/TorqueRef/index.html
by rlranft
Fri Mar 22, 2019 8:51 pm
Forum: C++
Topic: Define a 2D array in C++ and passing to TS
Replies: 17
Views: 764
Okay, can we get the actual use-case?
You can't find any examples of this because there is no need to do this. TorqueScript has multi-dimensional arrays. Why are you not just using them? What is the perceived bottleneck?
by rlranft
Tue Mar 12, 2019 7:51 pm
Forum: C++
Topic: Define a 2D array in C++ and passing to TS
Replies: 17
Views: 764
Do you need it to do exactly that? Because it'd be pretty simple to create a SimGroup in your engine function, populate it, and return that. SimGroups can be indexed and iterated over in TS.

Easier still would be to just make a quick "SimGroup manager" class script-side.

What's the exact use-case?
by rlranft
Sat Jul 30, 2016 2:39 pm
Forum: Beginner
Topic: What did I collide with?
Replies: 6
Views: 2892
Excellent - now we're getting somewhere! Or, maybe nowhere, because it looks like the code that generates the callback isn't actually passing our object reference to script. Congratulations! Sounds like a bug, buddy! Perhaps wander over to the GitHub repo and log an issue?
by rlranft
Fri Jul 29, 2016 6:58 pm
Forum: Beginner
Topic: What did I collide with?
Replies: 6
Views: 2892
In vehicle.cs I used onCollision and onImpact, in these functions have tried using %col.getClassName(), %col.getType(), %col.GetName(), %col.GetTargetName(0), %col.GetInternalName() etc. but nothing works. If you don't name every rock and tree in your level how do you know the getName() methods don...
by rlranft
Thu Jul 28, 2016 7:28 pm
Forum: Beginner
Topic: How to destroy decal
Replies: 16
Views: 5271
I'm just gonna chime in here and say that when the engine was written people were happy just to have decals working - most didn't bother doing anything besides let the decals fade (like T3D does). Old code is old, bro.
by rlranft
Wed Jul 27, 2016 6:47 pm
Forum: Beginner
Topic: How to destroy decal
Replies: 16
Views: 5271
On the client functions exist for adding/removing decals, but you have to have the decal's id: decalManagerRemoveDecal(%unit.decal); decalManagerAddDecal(%position, %norm, 0, 1, "destDecal", true); http://www.roostertailgames.com/TorqueRef/content/documentation/Scripting/Advanced/RTSPrototype.html#S...
by rlranft
Wed Jul 27, 2016 5:10 pm
Forum: Gameplay
Topic: [C++]Bullet decals disappear if the base is destroyed
Replies: 9
Views: 5007
Hmm, that's a good question - I thought these decals were handled client-side, but in source it references gDecalManager so perhaps these are server-side and replicated.... <shrug>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 31
Search found 303 matches Page 1 of 31