2 quick questions

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
fuhrer
Captain
Posts: 253
Joined: Sun Mar 14, 2004 3:36 am

2 quick questions

Post by fuhrer »

1)

im using mohradiant and im missing textures in breakthrough, how can i rectify that?

2)

and when i use iprintln and i use a number with decimals i.e. "3.555 " how can i make it only print the number before the decimals?

i tried using int after reading the references but it only prints 0
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post by blue60007 »

Well I don't know if BT textures show in radiant, I think they do work in the SH SDK though...

well the 3.555 is a float. Are you using a number or printing a variable? For numbers you can do:

Code: Select all

iprintln (int 3) "Blah blah"
for variables (and Im not sure):

Code: Select all

iprintln (int "level.yourvariable") "Blah"
not sure if that will work, but give it a try.
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

int

Post by tltrude »

This is how you do the integer thing.

(int(3.555)) = 3

If you are using a variable for the 3.555, make sure it is that number by using "iprintln (level.number)" because the integer of 0 is 0.

I don't understand #1.
Last edited by tltrude on Thu Apr 29, 2004 2:19 am, edited 1 time in total.
Tom Trude,

Image
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post by blue60007 »

ah, but what about casting a variable? Like I did it? :?

Um I think he means the bt textures are not showing in radiant? :?
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

bt

Post by tltrude »

If you made a map with the SDK and then moved it to MOHradiant, the textures from SH and BT will not show up because the path to the textures has changed.
Tom Trude,

Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

well, MOHScript is based of C++/Java/Basic so it stands to reason....

iprintln ("float level.myvariable")

(i almost put printf!!!)

because int (integer) is used for whole numbers and negatives. oh wait, i tested on this, ahah, i fogot it.

i wish someone would post a sticky on what subsets of real numbers (think Algebra people) variables take.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
fuhrer
Captain
Posts: 253
Joined: Sun Mar 14, 2004 3:36 am

Post by fuhrer »

i made the map purely in mohradiant not spearhead sdk, and he i loaded the map in bt some of the textures loaded funny..

as for the print thing i was using

Code: Select all

iprintln "speed " level.speed
if the speed was at 3.555 it would print that i just need the 3

tltrude i tried what u said it prints 0
fuhrer
Captain
Posts: 253
Joined: Sun Mar 14, 2004 3:36 am

Post by fuhrer »

i made the map purely in mohradiant not spearhead sdk, and he i loaded the map in bt some of the textures loaded funny..

as for the print thing i was using

Code: Select all

iprintln "speed " level.speed
if the speed was at 3.555 it would print that i just need the 3

tltrude i tried what u said it prints 0
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

speed

Post by tltrude »

If this line prints 0, it is because level.speed is 0 (or less than 1) and not 3.555.

iprintln "speed: " (int(level.speed))

Try this.

level.speed1 = 3.555
iprintln "speed1: " (int(level.speed1))

"level.speed" is probably not a good variable name because "speed" is a command word.
Tom Trude,

Image
Post Reply