* Translator


Author Topic: Mapping and Scripting Problem Megathread  (Read 21702 times)

Krish

  • The Challenger
  • Posts: 134
  • Country: gb
  • Respect: 6
  • Mostly playing CJ on FNRP Servers.
    • My Channel
Mapping and Scripting Problem Megathread
« on: June 13, 2015, 06:36:17 PM »
Another question. I've been trying to make a spike trap that brings up several spikes, and it's just not working. I also want the trigger hurt to go up with it, so this is my script as to what I've done thus far:
Quote
maptrap4()
{
trapbrush = getEntArray ("trap4", "targetname");
trapbrushpartly = getEnt ("trap4part1", "targetname");
trapactivation = getEnt ("activatortrap4", "targetname");

trapactivation waittill ("trigger", player);
trapactivation setHintString ( "Git gud" );

trapbrush moveZ (500, 1);
trapbrushpartly moveZ (500, 1);
wait 5;
trapbrush moveZ (-500, 1);
trapbrushpartly moveZ (-500, 1);

trapactivation delete();
}
« Last Edit: June 14, 2015, 09:18:57 PM by HaiseSasaki »

Hechsler

  • Posts: 154
  • Country: de
  • Respect: 3
  • That's the joy of armageddon


Re: Spikes will not go up.
« Reply #1 on: June 13, 2015, 07:02:10 PM »
you cant move a trigger with moveZ. You must link the trigger to a brush:

trig = getEnt("example", "targetname");
brush = getEnt("example", "targetname");

trig enableLinkTo();
trig linkTo(brush);

brush moveZ(...);

Krish

  • The Challenger
  • Posts: 134
  • Country: gb
  • Respect: 6
  • Mostly playing CJ on FNRP Servers.
    • My Channel
Re: Spikes will not go up.
« Reply #2 on: June 13, 2015, 07:04:52 PM »
Thanks. I'll start asking most of my questions here because I'm making way too much short term threads.

Krish

  • The Challenger
  • Posts: 134
  • Country: gb
  • Respect: 6
  • Mostly playing CJ on FNRP Servers.
    • My Channel
Re: Spikes will not go up.
« Reply #3 on: June 13, 2015, 08:04:50 PM »
Ah, there is a problem amongst your script. Whenever I run the map, there is a script runtime error saying 'not an entity'. This is my script so far:
Quote
maptrap4()
{
brush = getEntArray ("trap4", "targetname");
trig = getEnt ("trap4part1", "targetname");
trapactivation = getEnt ("activatortrap4", "targetname");

trig enableLinkTo();
trig LinkTo(brush);

trapactivation waittill ("trigger", player);
trapactivation setHintString ( "Git gud" );

brush moveZ (500, 1);
wait 5;
brush moveZ (-500, 1);


trapactivation delete();
}
There isn't a runtime error when I put it after the trapactivation bits but the spikes will still not move up.

BosnianArmy

  • Posts: 3001
  • Country: nl
  • Respect: 46
  • #Chilling now
Re: Spikes will not go up.
« Reply #4 on: June 13, 2015, 08:43:46 PM »
Watch in Radiant it self , if you named the objects correctly and look in the script as well.
[img]http://i.imgur.com/LKirqMA.png[/img]

[img]http://i.imgur.com/huzk95Q.png[/img]
Your signature does not comply to the new signature rules. Go to Profile => Forum Profile to modify your signature.

Krish

  • The Challenger
  • Posts: 134
  • Country: gb
  • Respect: 6
  • Mostly playing CJ on FNRP Servers.
    • My Channel
Re: Spikes will not go up.
« Reply #5 on: June 13, 2015, 10:03:15 PM »
The entities are named correctly and script has the right names, but in comes another problem. I'm now getting an assertion failure from the Compile BSP bit.
ASSERTBEGIN -------------------------------------------------------------------
Expression:
    diskBrushModels[modelIndex].numBrushes || diskBrushModels[modelIndex].numSur
faces || (diskBrushModels[modelIndex].triSoupCount[TRIS_TYPE_LAYERED] && diskBru
shModels[modelIndex].triSoupCount[TRIS_TYPE_SIMPLE])

Module:    C:\Users\Krish\Desktop\Call of Duty 4 Modern Warfare\Call of Duty
Modern Warfare\bin\cod4map.exe
File:    .\bsp.cpp
Line:    343

Hechsler

  • Posts: 154
  • Country: de
  • Respect: 3
  • That's the joy of armageddon


Re: Spikes will not go up.
« Reply #6 on: June 13, 2015, 10:54:02 PM »
btw why do you use getEntArray?

Krish

  • The Challenger
  • Posts: 134
  • Country: gb
  • Respect: 6
  • Mostly playing CJ on FNRP Servers.
    • My Channel
Re: Spikes will not go up.
« Reply #7 on: June 13, 2015, 11:15:52 PM »
btw why do you use getEntArray?
There are 4 spikes in total, and they all have the same targetname of 'trap4'.

Hechsler

  • Posts: 154
  • Country: de
  • Respect: 3
  • That's the joy of armageddon


Re: Spikes will not go up.
« Reply #8 on: June 14, 2015, 12:20:03 AM »
btw why do you use getEntArray?
There are 4 spikes in total, and they all have the same targetname of 'trap4'.
you can just select all brushes at the same time and make them a brushmodel. Than you dont need to use an array. If you want todo so just select all, rightclick, ungroup entity, and then make them a brushmodel

Krish

  • The Challenger
  • Posts: 134
  • Country: gb
  • Respect: 6
  • Mostly playing CJ on FNRP Servers.
    • My Channel
Re: Spikes will not go up.
« Reply #9 on: June 14, 2015, 02:09:15 AM »
btw why do you use getEntArray?
There are 4 spikes in total, and they all have the same targetname of 'trap4'.
you can just select all brushes at the same time and make them a brushmodel. Than you dont need to use an array. If you want todo so just select all, rightclick, ungroup entity, and then make them a brushmodel
Ah, wow. That might just fix my problem but the Assertion Failure problem still stands above, a bit confused on that one.

Krish

  • The Challenger
  • Posts: 134
  • Country: gb
  • Respect: 6
  • Mostly playing CJ on FNRP Servers.
    • My Channel
Re: Mapping and Scripting Problem Megathread
« Reply #10 on: June 14, 2015, 09:19:45 PM »
Ah, fixed the assertion failure bit. Turns out it was a really small and buggy trigger_hurt that I forgot to delete. For those that have this problem try to overlook your entities to make sure nothing is wrong.

Krish

  • The Challenger
  • Posts: 134
  • Country: gb
  • Respect: 6
  • Mostly playing CJ on FNRP Servers.
    • My Channel
Re: Mapping and Scripting Problem Megathread
« Reply #11 on: June 30, 2015, 05:32:26 PM »
Hello everyone once again. I am surfaced with yet another problem. I want to make a minefield trigger by activating it and also close the doors. I have gotten the part of how to close the doors and how to make a minefield, but I am wondering if it is possible to enable the trigger right after the doors close. Thank you in advance :)

Pixel

  • Posts: 3085
  • Country: 00
  • Respect: 64


Re: Mapping and Scripting Problem Megathread
« Reply #12 on: June 30, 2015, 05:45:22 PM »
Code: [Select]
#include maps\mp\_utility;

main()
{

thread doors();
thread onPlayerConnect();

}

onPlayerConnect()
{

level waittill( "player_spawned" );

mine = getEnt( "minefield_trigger" , "targetname" );
mine triggerOff();

}

doors()
{

door = getEnt( "door " , "targetname" );
trigger = getEnt( "trigger_door" , "targetname" );

trigger waittill( "trigger" , player );

door moveZ( 100, 4 );
door waittill( "movedone" );

thread mine();

}

mine()
{

mine = getEnt( "minefield_trigger" , "targetname" );
mine triggerOn();

//Mine script here

}

Not tested, not quite sure what you wanted, so maybe this could help you

Krish

  • The Challenger
  • Posts: 134
  • Country: gb
  • Respect: 6
  • Mostly playing CJ on FNRP Servers.
    • My Channel
Re: Mapping and Scripting Problem Megathread
« Reply #13 on: June 30, 2015, 06:06:40 PM »
Code: [Select]
#include maps\mp\_utility;

main()
{

thread doors();
thread onPlayerConnect();

}

onPlayerConnect()
{

level waittill( "player_spawned" );

mine = getEnt( "minefield_trigger" , "targetname" );
mine triggerOff();

}

doors()
{

door = getEnt( "door " , "targetname" );
trigger = getEnt( "trigger_door" , "targetname" );

trigger waittill( "trigger" , player );

door moveZ( 100, 4 );
door waittill( "movedone" );

thread mine();

}

mine()
{

mine = getEnt( "minefield_trigger" , "targetname" );
mine triggerOn();

//Mine script here

}

Not tested, not quite sure what you wanted, so maybe this could help you
Ah, this should work. So when it is activated, I turn it on?

Pixel

  • Posts: 3085
  • Country: 00
  • Respect: 64


Re: Mapping and Scripting Problem Megathread
« Reply #14 on: June 30, 2015, 08:35:39 PM »
Code: [Select]
#include maps\mp\_utility;

main()
{

thread doors();
thread onPlayerConnect();

}

onPlayerConnect()
{

level waittill( "player_spawned" );

mine = getEnt( "minefield_trigger" , "targetname" );
mine triggerOff();

}

doors()
{

door = getEnt( "door " , "targetname" );
trigger = getEnt( "trigger_door" , "targetname" );

trigger waittill( "trigger" , player );

door moveZ( 100, 4 );
door waittill( "movedone" );

thread mine();

}

mine()
{

mine = getEnt( "minefield_trigger" , "targetname" );
mine triggerOn();

//Mine script here

}

Not tested, not quite sure what you wanted, so maybe this could help you
Ah, this should work. So when it is activated, I turn it on?

Where I put //mine script here:

Add the script for land mines and it should work

 

SimplePortal 2.3.7 © 2008-2022, SimplePortal